diff libgui/src/welcome-wizard.cc @ 19895:19755f4fc851

maint: Cleanup C++ code to follow Octave coding conventions. Try to wrap long lines to < 80 characters. Use GNU style and don't indent first brace of function definition. "case" statement is aligned flush left with brace of switch stmt. Remove trailing '\' line continuation from the end of #define macros. Use 2 spaces for indent. * files-dock-widget.cc, history-dock-widget.cc, main-window.cc, octave-cmd.cc, octave-dock-widget.cc, octave-gui.cc, resource-manager.cc, settings-dialog.cc, shortcut-manager.cc, welcome-wizard.cc, workspace-view.cc, cellfun.cc, data.cc, debug.cc, debug.h, dirfns.cc, error.h, file-io.cc, gl-render.cc, gl-render.h, gl2ps-renderer.h, graphics.cc, graphics.in.h, help.cc, input.cc, load-path.cc, load-path.h, lookup.cc, lu.cc, oct-stream.cc, octave-default-image.h, ordschur.cc, pr-output.cc, qz.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc, variables.cc, zfstream.h, __fltk_uigetfile__.cc, __init_fltk__.cc, __magick_read__.cc, __osmesa_print__.cc, audiodevinfo.cc, ov-classdef.cc, ov-classdef.h, ov-fcn.h, ov-float.cc, ov-flt-complex.cc, ov-java.cc, ov-range.cc, ov-re-mat.cc, ov-usr-fcn.h, ov.cc, op-int.h, options-usage.h, pt-eval.cc, Array-C.cc, Array-fC.cc, Array.cc, Array.h, PermMatrix.cc, Sparse.cc, chMatrix.h, dSparse.cc, dim-vector.h, bsxfun-decl.h, bsxfun-defs.cc, oct-norm.cc, Sparse-op-defs.h, oct-inttypes.cc, oct-inttypes.h, main.in.cc, mkoctfile.in.cc: Cleanup C++ code to follow Octave coding conventions.
author Rik <rik@octave.org>
date Wed, 25 Feb 2015 11:55:49 -0800
parents 4197fc428c7d
children 17d21d68888d
line wrap: on
line diff
--- a/libgui/src/welcome-wizard.cc	Wed Feb 25 16:23:45 2015 +0100
+++ b/libgui/src/welcome-wizard.cc	Wed Feb 25 11:55:49 2015 -0800
@@ -45,224 +45,224 @@
 
 
 initial_page::initial_page (welcome_wizard *wizard)
-    : QWidget (wizard),
-      title (new QLabel (tr ("Welcome to Octave!"), this)),
-      message (new QLabel (this)),
-      logo (make_octave_logo (this)),
-      next (new QPushButton (tr ("Next"), this)),
-      cancel (new QPushButton (tr ("Cancel"), this))
-  {
-    QFont ft;
-    ft.setPointSize (20);
-    title->setFont (ft);
+  : QWidget (wizard),
+    title (new QLabel (tr ("Welcome to Octave!"), this)),
+    message (new QLabel (this)),
+    logo (make_octave_logo (this)),
+    next (new QPushButton (tr ("Next"), this)),
+    cancel (new QPushButton (tr ("Cancel"), this))
+{
+  QFont ft;
+  ft.setPointSize (20);
+  title->setFont (ft);
 
-    message->setText
-      (tr ("<html><body>\n"
-           "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n"
-           "Click 'Next' to create a configuration file and launch Octave.</p>\n"
-           "<p>The configuration file is stored in<br>%1.</p>\n"
-           "</body></html>").
-           arg (resource_manager::get_settings_file ()));
-    message->setWordWrap (true);
-    message->setMinimumWidth (400);
+  message->setText
+  (tr ("<html><body>\n"
+       "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n"
+       "Click 'Next' to create a configuration file and launch Octave.</p>\n"
+       "<p>The configuration file is stored in<br>%1.</p>\n"
+       "</body></html>").
+   arg (resource_manager::get_settings_file ()));
+  message->setWordWrap (true);
+  message->setMinimumWidth (400);
 
-    QVBoxLayout *message_layout = new QVBoxLayout;
+  QVBoxLayout *message_layout = new QVBoxLayout;
 
-    message_layout->addWidget (title);
-    message_layout->addWidget (message);
+  message_layout->addWidget (title);
+  message_layout->addWidget (message);
 
-    QHBoxLayout *message_and_logo = new QHBoxLayout;
+  QHBoxLayout *message_and_logo = new QHBoxLayout;
 
-    message_and_logo->addLayout (message_layout);
-    message_and_logo->addStretch (10);
-    message_and_logo->addWidget (logo, 0, Qt::AlignTop);
+  message_and_logo->addLayout (message_layout);
+  message_and_logo->addStretch (10);
+  message_and_logo->addWidget (logo, 0, Qt::AlignTop);
 
-    QHBoxLayout *button_bar = new QHBoxLayout;
+  QHBoxLayout *button_bar = new QHBoxLayout;
 
-    button_bar->addStretch (10);
-    button_bar->addWidget (next);
-    button_bar->addWidget (cancel);
+  button_bar->addStretch (10);
+  button_bar->addWidget (next);
+  button_bar->addWidget (cancel);
 
-    QVBoxLayout *page_layout = new QVBoxLayout (this);
-    setLayout (page_layout);
+  QVBoxLayout *page_layout = new QVBoxLayout (this);
+  setLayout (page_layout);
 
-    page_layout->addLayout (message_and_logo);
-    page_layout->addStretch (10);
-    page_layout->addLayout (button_bar);
+  page_layout->addLayout (message_and_logo);
+  page_layout->addStretch (10);
+  page_layout->addLayout (button_bar);
 
-    next->setDefault (true);
-    next->setFocus ();
+  next->setDefault (true);
+  next->setFocus ();
 
-    connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
-    connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
-  }
+  connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
+  connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
+}
 
 
 
 setup_community_news::setup_community_news (welcome_wizard *wizard)
-    : QWidget (wizard),
-      title (new QLabel (tr ("Community News"), this)),
-      message (new QLabel (this)),
-      checkbox (new QCheckBox (this)),
-      checkbox_message (new QLabel (this)),
-      logo (make_octave_logo (this)),
-      previous (new QPushButton (tr ("Previous"), this)),
-      next (new QPushButton (tr ("Next"), this)),
-      cancel (new QPushButton (tr ("Cancel"), this))
-  {
-    QFont ft;
-    ft.setPointSize (20);
-    title->setFont (ft);
+  : QWidget (wizard),
+    title (new QLabel (tr ("Community News"), this)),
+    message (new QLabel (this)),
+    checkbox (new QCheckBox (this)),
+    checkbox_message (new QLabel (this)),
+    logo (make_octave_logo (this)),
+    previous (new QPushButton (tr ("Previous"), this)),
+    next (new QPushButton (tr ("Next"), this)),
+    cancel (new QPushButton (tr ("Cancel"), this))
+{
+  QFont ft;
+  ft.setPointSize (20);
+  title->setFont (ft);
 
-    message->setText
-      (tr ("<html><body>\n"
-           "<p>When the Octave GUI starts, it will check the Octave web site for current news and information about the Octave community.\n"
-           "The check will happen at most once each day and news will only be displayed if there is something new since the last time you viewed the news.</p>\n"
-           "<p>You may also view the news by selecting the \"Community News\" item in the \"Help\" menu in the GUI, or by visiting\n"
-           "<a href=\"http://octave.org/community-news.html\">http://octave.org/community-news.html</a>.</p>\n"
-           "</body></html>"));
-    message->setWordWrap (true);
-    message->setMinimumWidth (400);
-    message->setOpenExternalLinks (true);
+  message->setText
+  (tr ("<html><body>\n"
+       "<p>When the Octave GUI starts, it will check the Octave web site for current news and information about the Octave community.\n"
+       "The check will happen at most once each day and news will only be displayed if there is something new since the last time you viewed the news.</p>\n"
+       "<p>You may also view the news by selecting the \"Community News\" item in the \"Help\" menu in the GUI, or by visiting\n"
+       "<a href=\"http://octave.org/community-news.html\">http://octave.org/community-news.html</a>.</p>\n"
+       "</body></html>"));
+  message->setWordWrap (true);
+  message->setMinimumWidth (400);
+  message->setOpenExternalLinks (true);
 
-    QVBoxLayout *message_layout = new QVBoxLayout;
+  QVBoxLayout *message_layout = new QVBoxLayout;
 
-    message_layout->addWidget (title);
-    message_layout->addWidget (message);
+  message_layout->addWidget (title);
+  message_layout->addWidget (message);
 
-    QHBoxLayout *message_and_logo = new QHBoxLayout;
+  QHBoxLayout *message_and_logo = new QHBoxLayout;
 
-    message_and_logo->addLayout (message_layout);
-    message_and_logo->addStretch (10);
-    message_and_logo->addWidget (logo, 0, Qt::AlignTop);
+  message_and_logo->addLayout (message_layout);
+  message_and_logo->addStretch (10);
+  message_and_logo->addWidget (logo, 0, Qt::AlignTop);
 
-    QHBoxLayout *checkbox_layout = new QHBoxLayout;
+  QHBoxLayout *checkbox_layout = new QHBoxLayout;
 
-    checkbox->setCheckState (Qt::Checked);
+  checkbox->setCheckState (Qt::Checked);
 
-    checkbox_message->setText
-      (tr ("<html><head>\n"
-           "<style>\n"
-           "a:link { text-decoration: underline; color: #0000ff; }\n"
-           "</style>\n"
-           "<head/><body>\n"
-           "<p>Allow Octave to connect to the Octave web site when it starts to display current news and information about the Octave community.</p>\n"
-           "</body></html>"));
-    checkbox_message->setWordWrap (true);
-    checkbox_message->setOpenExternalLinks (true);
-    checkbox_message->setMinimumWidth (500);
+  checkbox_message->setText
+  (tr ("<html><head>\n"
+       "<style>\n"
+       "a:link { text-decoration: underline; color: #0000ff; }\n"
+       "</style>\n"
+       "<head/><body>\n"
+       "<p>Allow Octave to connect to the Octave web site when it starts to display current news and information about the Octave community.</p>\n"
+       "</body></html>"));
+  checkbox_message->setWordWrap (true);
+  checkbox_message->setOpenExternalLinks (true);
+  checkbox_message->setMinimumWidth (500);
 
-    checkbox_layout->addWidget (checkbox, 0, Qt::AlignTop);
-    checkbox_layout->addSpacing (20);
-    checkbox_layout->addWidget (checkbox_message, 0, Qt::AlignTop);
-    checkbox_layout->addStretch (10);
+  checkbox_layout->addWidget (checkbox, 0, Qt::AlignTop);
+  checkbox_layout->addSpacing (20);
+  checkbox_layout->addWidget (checkbox_message, 0, Qt::AlignTop);
+  checkbox_layout->addStretch (10);
 
-    QVBoxLayout *message_logo_and_checkbox = new QVBoxLayout;
+  QVBoxLayout *message_logo_and_checkbox = new QVBoxLayout;
 
-    message_logo_and_checkbox->addLayout (message_and_logo);
-    message_logo_and_checkbox->addSpacing (20);
-    message_logo_and_checkbox->addLayout (checkbox_layout);
+  message_logo_and_checkbox->addLayout (message_and_logo);
+  message_logo_and_checkbox->addSpacing (20);
+  message_logo_and_checkbox->addLayout (checkbox_layout);
 
-    QHBoxLayout *button_bar = new QHBoxLayout;
+  QHBoxLayout *button_bar = new QHBoxLayout;
 
-    button_bar->addStretch (10);
-    button_bar->addWidget (previous);
-    button_bar->addWidget (next);
-    button_bar->addWidget (cancel);
+  button_bar->addStretch (10);
+  button_bar->addWidget (previous);
+  button_bar->addWidget (next);
+  button_bar->addWidget (cancel);
 
-    QVBoxLayout *page_layout = new QVBoxLayout (this);
-    setLayout (page_layout);
+  QVBoxLayout *page_layout = new QVBoxLayout (this);
+  setLayout (page_layout);
 
-    page_layout->addLayout (message_logo_and_checkbox);
-    page_layout->addStretch (10);
-    page_layout->addLayout (button_bar);
+  page_layout->addLayout (message_logo_and_checkbox);
+  page_layout->addStretch (10);
+  page_layout->addLayout (button_bar);
 
-    next->setDefault (true);
-    next->setFocus ();
+  next->setDefault (true);
+  next->setFocus ();
 
-    connect (checkbox, SIGNAL (stateChanged (int)),
-             wizard, SLOT (handle_web_connect_option (int)));
+  connect (checkbox, SIGNAL (stateChanged (int)),
+           wizard, SLOT (handle_web_connect_option (int)));
 
-    connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
-    connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
-    connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
-  }
+  connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
+  connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
+  connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
+}
 
 
 final_page::final_page (welcome_wizard *wizard)
-    : QWidget (wizard),
-      title (new QLabel (tr ("Enjoy!"), this)),
-      message (new QLabel (this)),
-      logo (make_octave_logo (this)),
-      links (new QLabel (this)),
-      previous (new QPushButton (tr ("Previous"), this)),
-      finish (new QPushButton (tr ("Finish"), this)),
-      cancel (new QPushButton (tr ("Cancel"), this))
-  {
-    QFont ft;
-    ft.setPointSize (20);
-    title->setFont (ft);
+  : QWidget (wizard),
+    title (new QLabel (tr ("Enjoy!"), this)),
+    message (new QLabel (this)),
+    logo (make_octave_logo (this)),
+    links (new QLabel (this)),
+    previous (new QPushButton (tr ("Previous"), this)),
+    finish (new QPushButton (tr ("Finish"), this)),
+    cancel (new QPushButton (tr ("Cancel"), this))
+{
+  QFont ft;
+  ft.setPointSize (20);
+  title->setFont (ft);
 
-    message->setText
-      (tr ("<html><body>\n"
-           "<p>We hope you find Octave to be a useful tool.</p>\n"
-           "<p>If you encounter problems, there are a number of ways to get help, including commercial support options, a mailing list, a wiki, and other commnity-based support channels.\n"
-           "You can find more information about each of these by visiting <a href=\"http://octave.org/support.html\">http://octave.org/support.html</a> (opens in external browser).</p>\n"
-           "</body></html>"));
-    message->setWordWrap (true);
-    message->setMinimumWidth (400);
-    message->setOpenExternalLinks (true);
+  message->setText
+  (tr ("<html><body>\n"
+       "<p>We hope you find Octave to be a useful tool.</p>\n"
+       "<p>If you encounter problems, there are a number of ways to get help, including commercial support options, a mailing list, a wiki, and other commnity-based support channels.\n"
+       "You can find more information about each of these by visiting <a href=\"http://octave.org/support.html\">http://octave.org/support.html</a> (opens in external browser).</p>\n"
+       "</body></html>"));
+  message->setWordWrap (true);
+  message->setMinimumWidth (400);
+  message->setOpenExternalLinks (true);
 
-    QVBoxLayout *message_layout = new QVBoxLayout;
+  QVBoxLayout *message_layout = new QVBoxLayout;
 
-    message_layout->addWidget (title);
-    message_layout->addWidget (message);
+  message_layout->addWidget (title);
+  message_layout->addWidget (message);
 
-    QHBoxLayout *message_and_logo = new QHBoxLayout;
+  QHBoxLayout *message_and_logo = new QHBoxLayout;
 
-    message_and_logo->addLayout (message_layout);
-    message_and_logo->addStretch (10);
-    message_and_logo->addWidget (logo, 0, Qt::AlignTop);
+  message_and_logo->addLayout (message_layout);
+  message_and_logo->addStretch (10);
+  message_and_logo->addWidget (logo, 0, Qt::AlignTop);
 
-    links->setText
-      (tr ("<html><head>\n"
-           "<style>\n"
-           "a:link { text-decoration: underline; color: #0000ff; }\n"
-           "</style>\n"
-           "<head/><body>\n"
-           "<p>For more information about Octave:</p>\n"
-           "<ul>\n"
-           "<li>Visit <a href=\"http://octave.org\">http://octave.org</a> (opens in external browser)</li>\n"
-           "<li>Get the documentation online as <a href=\"http://www.gnu.org/software/octave/doc/interpreter/index.html\">html</a>- or <a href=\"http://www.gnu.org/software/octave/octave.pdf\">pdf</span></a>-document (opens in external browser)</li>\n"
-           "<li>Open the documentation browser of the Octave GUI with the help menu</li>\n"
-           "</ul>\n"
-           "</body></html>"));
-    links->setWordWrap (true);
-    links->setOpenExternalLinks (true);
+  links->setText
+  (tr ("<html><head>\n"
+       "<style>\n"
+       "a:link { text-decoration: underline; color: #0000ff; }\n"
+       "</style>\n"
+       "<head/><body>\n"
+       "<p>For more information about Octave:</p>\n"
+       "<ul>\n"
+       "<li>Visit <a href=\"http://octave.org\">http://octave.org</a> (opens in external browser)</li>\n"
+       "<li>Get the documentation online as <a href=\"http://www.gnu.org/software/octave/doc/interpreter/index.html\">html</a>- or <a href=\"http://www.gnu.org/software/octave/octave.pdf\">pdf</span></a>-document (opens in external browser)</li>\n"
+       "<li>Open the documentation browser of the Octave GUI with the help menu</li>\n"
+       "</ul>\n"
+       "</body></html>"));
+  links->setWordWrap (true);
+  links->setOpenExternalLinks (true);
 
-    QHBoxLayout *button_bar = new QHBoxLayout;
+  QHBoxLayout *button_bar = new QHBoxLayout;
 
-    button_bar->addStretch (10);
-    button_bar->addWidget (previous);
-    button_bar->addWidget (finish);
-    button_bar->addWidget (cancel);
+  button_bar->addStretch (10);
+  button_bar->addWidget (previous);
+  button_bar->addWidget (finish);
+  button_bar->addWidget (cancel);
 
-    QVBoxLayout *page_layout = new QVBoxLayout (this);
-    setLayout (page_layout);
+  QVBoxLayout *page_layout = new QVBoxLayout (this);
+  setLayout (page_layout);
 
-    page_layout->addLayout (message_and_logo);
-    page_layout->addSpacing (20);
-    page_layout->addWidget (links);
-    page_layout->addStretch (10);
-    page_layout->addLayout (button_bar);
+  page_layout->addLayout (message_and_logo);
+  page_layout->addSpacing (20);
+  page_layout->addWidget (links);
+  page_layout->addStretch (10);
+  page_layout->addLayout (button_bar);
 
-    finish->setDefault (true);
-    finish->setFocus ();
+  finish->setDefault (true);
+  finish->setFocus ();
 
-    connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
-    connect (finish, SIGNAL (clicked ()), wizard, SLOT (accept ()));
-    connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
-  }
+  connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
+  connect (finish, SIGNAL (clicked ()), wizard, SLOT (accept ()));
+  connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
+}
 
 
 welcome_wizard::welcome_wizard (QWidget *p)