Mercurial > hg > octave-nkf
changeset 17616:8cc19352fd74
prevent warnings about adding layouts to welcome_wizard at first start
* welcome-wizard.cc(constructor):
only the main lauyout has welcome_wizard as parent,
text replacement in label text not necessary anymore
author | Torsten <ttl@justmail.de> |
---|---|
date | Wed, 09 Oct 2013 08:36:17 +0200 |
parents | 3a7d5d655749 |
children | 9abb1422d60b |
files | libgui/src/welcome-wizard.cc |
diffstat | 1 files changed, 12 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/welcome-wizard.cc +++ b/libgui/src/welcome-wizard.cc @@ -47,28 +47,25 @@ QVBoxLayout *page_layout = new QVBoxLayout (this); setLayout (page_layout); - QHBoxLayout *message_and_logo = new QHBoxLayout (this); + QHBoxLayout *message_and_logo = new QHBoxLayout; - QVBoxLayout *message = new QVBoxLayout (this); + QVBoxLayout *message = new QVBoxLayout; - QLabel *title = new QLabel (tr ("Welcome to Octave!"), this); + QLabel *title = new QLabel (tr ("Welcome to Octave!")); QFont ft; ft.setPointSize (20); title->setFont (ft); - QLabel *msg_1 = new QLabel (tr ("You seem to be using the Octave graphical interface for the first time on this computer. Click 'Finish' to write a configuration file and launch Octave GUI."), - this); + QLabel *msg_1 = new QLabel (tr ("You seem to be using the Octave graphical interface for the first time on this computer. Click 'Finish' to write a configuration file and launch Octave GUI.")); msg_1->setWordWrap (true); - QLabel *msg_2 = new QLabel (tr ("The configuration file is stored in __%1__. If that file exists, you will not see this dialog when Octave starts again."), - this); + QString msg_2_text = QString (tr ("The configuration file is stored in %1. " + "If that file exists, you will not see this " + "dialog when Octave starts again."). + arg (resource_manager::get_settings_file ())); + QLabel *msg_2 = new QLabel (msg_2_text); msg_2->setWordWrap (true); - QString msg_2_text = msg_2->text (); - msg_2_text.replace (QString ("__%1__"), - resource_manager::get_settings_file ()); - msg_2->setText (msg_2_text); - message->addWidget (title); message->addWidget (msg_1); message->addWidget (msg_2); @@ -76,7 +73,7 @@ QSpacerItem *logo_filler = new QSpacerItem (40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - QLabel *logo = new QLabel (this); + QLabel *logo = new QLabel; QPixmap logo_pixmap (":/actions/icons/logo.png"); logo->setPixmap (logo_pixmap.scaledToHeight (150)); @@ -104,12 +101,12 @@ QSpacerItem *hfill = new QSpacerItem (40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - QPushButton *finish_button = new QPushButton (this); + QPushButton *finish_button = new QPushButton; finish_button->setText (tr ("Finish")); QSpacerItem *vspace = new QSpacerItem (20, 40, QSizePolicy::Minimum); - QHBoxLayout *button_bar = new QHBoxLayout (this); + QHBoxLayout *button_bar = new QHBoxLayout; button_bar->addItem (hfill); button_bar->addWidget (finish_button);