# HG changeset patch # User John W. Eaton # Date 1381271920 14400 # Node ID 0dd2cf2e31746cab5f61c8ddc98ccccf6c969d07 # Parent 3f8b3588a9f068979f15e91a7f75c4e2e97e292a don't use ui designer for welcome dialog box * welcome-wizard.ui: Delete. * module.mk: Update file list. * welcome-wizard.cc, welcome-wizard.h: Rewrite. diff -r 3f8b3588a9f0 -r 0dd2cf2e3174 libgui/src/module.mk --- a/libgui/src/module.mk Tue Oct 08 15:50:38 2013 -0700 +++ b/libgui/src/module.mk Tue Oct 08 18:38:40 2013 -0400 @@ -100,8 +100,7 @@ octave_gui_RC = src/qrc-resource.cc octave_gui_UI = \ - src/settings-dialog.ui \ - src/welcome-wizard.ui + src/settings-dialog.ui octave_gui_UI_H = $(patsubst src/%.ui, src/ui-%.h, $(octave_gui_UI)) diff -r 3f8b3588a9f0 -r 0dd2cf2e3174 libgui/src/welcome-wizard.cc --- a/libgui/src/welcome-wizard.cc Tue Oct 08 15:50:38 2013 -0700 +++ b/libgui/src/welcome-wizard.cc Tue Oct 08 18:38:40 2013 -0400 @@ -1,5 +1,6 @@ /* +Copyright (C) 2013 John W. Eaton Copyright (C) 2011-2012 Jacob Dawid This file is part of Octave. @@ -24,21 +25,103 @@ #include #endif +#include +#include +#include +#include +#include + #include "welcome-wizard.h" #include "resource-manager.h" -#include "ui-welcome-wizard.h" welcome_wizard::welcome_wizard (QWidget *p) - : QDialog (p), _ui (new Ui::welcome_wizard) + : QDialog (p) { - _ui->setupUi (this); - QString label_text = _ui->label_config_file->text (); - label_text.replace (QString ("__%1__"), + setWindowTitle (tr ("Welcome to GNU Octave")); + + setEnabled (true); + resize (600, 480); + setMinimumSize (QSize (600, 480)); + + + QVBoxLayout *page_layout = new QVBoxLayout (this); + setLayout (page_layout); + + QHBoxLayout *message_and_logo = new QHBoxLayout (this); + + QVBoxLayout *message = new QVBoxLayout (this); + + QLabel *title = new QLabel (tr ("Welcome to Octave!"), this); + 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); + 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); + msg_2->setWordWrap (true); + + QString msg_2_text = msg_2->text (); + msg_2_text.replace (QString ("__%1__"), resource_manager::get_settings_file ()); - _ui->label_config_file->setText (label_text); -} + msg_2->setText (msg_2_text); + + message->addWidget (title); + message->addWidget (msg_1); + message->addWidget (msg_2); + + QSpacerItem *logo_filler = new QSpacerItem (40, 20, QSizePolicy::Expanding, + QSizePolicy::Minimum); + + QLabel *logo = new QLabel (this); + QPixmap logo_pixmap (":/actions/icons/logo.png"); + logo->setPixmap (logo_pixmap.scaledToHeight (150)); + + message_and_logo->addLayout (message); + message_and_logo->addItem (logo_filler); + message_and_logo->addWidget (logo); -welcome_wizard::~welcome_wizard() -{ - delete _ui; + QLabel *links = new QLabel + (tr ("\n" + "\n" + "\n" + "

For more information about Octave:

\n" + "
    \n" + "
  • Visit http://octave.org
  • \n" + "
  • Get the documentation online as html- or pdf-document
  • \n" + "
  • Open the documentation browser of Octave GUI with the help menu
  • \n" + "
\n" + ""), + this); + links->setWordWrap (true); + links->setOpenExternalLinks (true); + + QSpacerItem *hfill = new QSpacerItem (40, 20, QSizePolicy::Expanding, + QSizePolicy::Minimum); + + QPushButton *finish_button = new QPushButton (this); + finish_button->setText (tr ("Finish")); + + QSpacerItem *vspace = new QSpacerItem (20, 40, QSizePolicy::Minimum); + + QHBoxLayout *button_bar = new QHBoxLayout (this); + + button_bar->addItem (hfill); + button_bar->addWidget (finish_button); + + QSpacerItem *vfill = new QSpacerItem (20, 40, QSizePolicy::Minimum, + QSizePolicy::Expanding); + + page_layout->addLayout (message_and_logo); + page_layout->addWidget (links); + page_layout->addItem (vspace); + page_layout->addLayout (button_bar); + page_layout->addItem (vfill); + + connect (finish_button, SIGNAL (clicked ()), this, SLOT (accept ())); } diff -r 3f8b3588a9f0 -r 0dd2cf2e3174 libgui/src/welcome-wizard.h --- a/libgui/src/welcome-wizard.h Tue Oct 08 15:50:38 2013 -0700 +++ b/libgui/src/welcome-wizard.h Tue Oct 08 18:38:40 2013 -0400 @@ -1,5 +1,6 @@ /* +Copyright (C) 2013 John W. Eaton Copyright (C) 2011-2012 Jacob Dawid This file is part of Octave. @@ -25,22 +26,15 @@ #include -namespace Ui { - class welcome_wizard; -} - class welcome_wizard : public QDialog { Q_OBJECT - public: - explicit welcome_wizard (QWidget *parent = 0); - ~welcome_wizard (); +public: -public slots: + welcome_wizard (QWidget *parent = 0); -private: - Ui::welcome_wizard *_ui; + ~welcome_wizard (void) { } }; #endif // WELCOMEWIZARD_H diff -r 3f8b3588a9f0 -r 0dd2cf2e3174 libgui/src/welcome-wizard.ui --- a/libgui/src/welcome-wizard.ui Tue Oct 08 15:50:38 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ - - - welcome_wizard - - - true - - - - 0 - 0 - 480 - 320 - - - - - 480 - 320 - - - - - 480 - 320 - - - - Welcome to GNU Octave - - - - - - - - - 20 - - - - Welcome to Octave! - - - - - - - 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. - - - true - - - - - - - The configuration file is stored in __%1__. If that file exists, you will not see this dialog when Octave starts again. - - - true - - - - - - - <html><head/><body><p>For more information about Octave,</p> -<ul> -<li>visit <a href="http://octave.org"><span style=" text-decoration: underline; color:#0000ff;">http://octave.org</span></a>,</li> -<li> get the documentation online as <a href="http://www.gnu.org/software/octave/doc/interpreter/index.html"><span style=" text-decoration: underline; color:#0000ff;">html</span></a>- or <a href="http://www.gnu.org/software/octave/octave.pdf"><span style=" text-decoration: underline; color:#0000ff;">pdf</span></a>-document, or</li> -<li>open the documentation browser of Octave GUI with the help menu.</li> -</ul> -</body></html> - - - true - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Finish - - - - - - - - - - - - - finishButton - clicked() - welcome_wizard - accept() - - - 577 - 372 - - - 323 - 199 - - - - -