comparison 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
comparison
equal deleted inserted replaced
19894:e8ccfc5d892b 19895:19755f4fc851
43 }; 43 };
44 44
45 45
46 46
47 initial_page::initial_page (welcome_wizard *wizard) 47 initial_page::initial_page (welcome_wizard *wizard)
48 : QWidget (wizard), 48 : QWidget (wizard),
49 title (new QLabel (tr ("Welcome to Octave!"), this)), 49 title (new QLabel (tr ("Welcome to Octave!"), this)),
50 message (new QLabel (this)), 50 message (new QLabel (this)),
51 logo (make_octave_logo (this)), 51 logo (make_octave_logo (this)),
52 next (new QPushButton (tr ("Next"), this)), 52 next (new QPushButton (tr ("Next"), this)),
53 cancel (new QPushButton (tr ("Cancel"), this)) 53 cancel (new QPushButton (tr ("Cancel"), this))
54 { 54 {
55 QFont ft; 55 QFont ft;
56 ft.setPointSize (20); 56 ft.setPointSize (20);
57 title->setFont (ft); 57 title->setFont (ft);
58 58
59 message->setText 59 message->setText
60 (tr ("<html><body>\n" 60 (tr ("<html><body>\n"
61 "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n" 61 "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n"
62 "Click 'Next' to create a configuration file and launch Octave.</p>\n" 62 "Click 'Next' to create a configuration file and launch Octave.</p>\n"
63 "<p>The configuration file is stored in<br>%1.</p>\n" 63 "<p>The configuration file is stored in<br>%1.</p>\n"
64 "</body></html>"). 64 "</body></html>").
65 arg (resource_manager::get_settings_file ())); 65 arg (resource_manager::get_settings_file ()));
66 message->setWordWrap (true); 66 message->setWordWrap (true);
67 message->setMinimumWidth (400); 67 message->setMinimumWidth (400);
68 68
69 QVBoxLayout *message_layout = new QVBoxLayout; 69 QVBoxLayout *message_layout = new QVBoxLayout;
70 70
71 message_layout->addWidget (title); 71 message_layout->addWidget (title);
72 message_layout->addWidget (message); 72 message_layout->addWidget (message);
73 73
74 QHBoxLayout *message_and_logo = new QHBoxLayout; 74 QHBoxLayout *message_and_logo = new QHBoxLayout;
75 75
76 message_and_logo->addLayout (message_layout); 76 message_and_logo->addLayout (message_layout);
77 message_and_logo->addStretch (10); 77 message_and_logo->addStretch (10);
78 message_and_logo->addWidget (logo, 0, Qt::AlignTop); 78 message_and_logo->addWidget (logo, 0, Qt::AlignTop);
79 79
80 QHBoxLayout *button_bar = new QHBoxLayout; 80 QHBoxLayout *button_bar = new QHBoxLayout;
81 81
82 button_bar->addStretch (10); 82 button_bar->addStretch (10);
83 button_bar->addWidget (next); 83 button_bar->addWidget (next);
84 button_bar->addWidget (cancel); 84 button_bar->addWidget (cancel);
85 85
86 QVBoxLayout *page_layout = new QVBoxLayout (this); 86 QVBoxLayout *page_layout = new QVBoxLayout (this);
87 setLayout (page_layout); 87 setLayout (page_layout);
88 88
89 page_layout->addLayout (message_and_logo); 89 page_layout->addLayout (message_and_logo);
90 page_layout->addStretch (10); 90 page_layout->addStretch (10);
91 page_layout->addLayout (button_bar); 91 page_layout->addLayout (button_bar);
92 92
93 next->setDefault (true); 93 next->setDefault (true);
94 next->setFocus (); 94 next->setFocus ();
95 95
96 connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ())); 96 connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
97 connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ())); 97 connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
98 } 98 }
99 99
100 100
101 101
102 setup_community_news::setup_community_news (welcome_wizard *wizard) 102 setup_community_news::setup_community_news (welcome_wizard *wizard)
103 : QWidget (wizard), 103 : QWidget (wizard),
104 title (new QLabel (tr ("Community News"), this)), 104 title (new QLabel (tr ("Community News"), this)),
105 message (new QLabel (this)), 105 message (new QLabel (this)),
106 checkbox (new QCheckBox (this)), 106 checkbox (new QCheckBox (this)),
107 checkbox_message (new QLabel (this)), 107 checkbox_message (new QLabel (this)),
108 logo (make_octave_logo (this)), 108 logo (make_octave_logo (this)),
109 previous (new QPushButton (tr ("Previous"), this)), 109 previous (new QPushButton (tr ("Previous"), this)),
110 next (new QPushButton (tr ("Next"), this)), 110 next (new QPushButton (tr ("Next"), this)),
111 cancel (new QPushButton (tr ("Cancel"), this)) 111 cancel (new QPushButton (tr ("Cancel"), this))
112 { 112 {
113 QFont ft; 113 QFont ft;
114 ft.setPointSize (20); 114 ft.setPointSize (20);
115 title->setFont (ft); 115 title->setFont (ft);
116 116
117 message->setText 117 message->setText
118 (tr ("<html><body>\n" 118 (tr ("<html><body>\n"
119 "<p>When the Octave GUI starts, it will check the Octave web site for current news and information about the Octave community.\n" 119 "<p>When the Octave GUI starts, it will check the Octave web site for current news and information about the Octave community.\n"
120 "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" 120 "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"
121 "<p>You may also view the news by selecting the \"Community News\" item in the \"Help\" menu in the GUI, or by visiting\n" 121 "<p>You may also view the news by selecting the \"Community News\" item in the \"Help\" menu in the GUI, or by visiting\n"
122 "<a href=\"http://octave.org/community-news.html\">http://octave.org/community-news.html</a>.</p>\n" 122 "<a href=\"http://octave.org/community-news.html\">http://octave.org/community-news.html</a>.</p>\n"
123 "</body></html>")); 123 "</body></html>"));
124 message->setWordWrap (true); 124 message->setWordWrap (true);
125 message->setMinimumWidth (400); 125 message->setMinimumWidth (400);
126 message->setOpenExternalLinks (true); 126 message->setOpenExternalLinks (true);
127 127
128 QVBoxLayout *message_layout = new QVBoxLayout; 128 QVBoxLayout *message_layout = new QVBoxLayout;
129 129
130 message_layout->addWidget (title); 130 message_layout->addWidget (title);
131 message_layout->addWidget (message); 131 message_layout->addWidget (message);
132 132
133 QHBoxLayout *message_and_logo = new QHBoxLayout; 133 QHBoxLayout *message_and_logo = new QHBoxLayout;
134 134
135 message_and_logo->addLayout (message_layout); 135 message_and_logo->addLayout (message_layout);
136 message_and_logo->addStretch (10); 136 message_and_logo->addStretch (10);
137 message_and_logo->addWidget (logo, 0, Qt::AlignTop); 137 message_and_logo->addWidget (logo, 0, Qt::AlignTop);
138 138
139 QHBoxLayout *checkbox_layout = new QHBoxLayout; 139 QHBoxLayout *checkbox_layout = new QHBoxLayout;
140 140
141 checkbox->setCheckState (Qt::Checked); 141 checkbox->setCheckState (Qt::Checked);
142 142
143 checkbox_message->setText 143 checkbox_message->setText
144 (tr ("<html><head>\n" 144 (tr ("<html><head>\n"
145 "<style>\n" 145 "<style>\n"
146 "a:link { text-decoration: underline; color: #0000ff; }\n" 146 "a:link { text-decoration: underline; color: #0000ff; }\n"
147 "</style>\n" 147 "</style>\n"
148 "<head/><body>\n" 148 "<head/><body>\n"
149 "<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" 149 "<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"
150 "</body></html>")); 150 "</body></html>"));
151 checkbox_message->setWordWrap (true); 151 checkbox_message->setWordWrap (true);
152 checkbox_message->setOpenExternalLinks (true); 152 checkbox_message->setOpenExternalLinks (true);
153 checkbox_message->setMinimumWidth (500); 153 checkbox_message->setMinimumWidth (500);
154 154
155 checkbox_layout->addWidget (checkbox, 0, Qt::AlignTop); 155 checkbox_layout->addWidget (checkbox, 0, Qt::AlignTop);
156 checkbox_layout->addSpacing (20); 156 checkbox_layout->addSpacing (20);
157 checkbox_layout->addWidget (checkbox_message, 0, Qt::AlignTop); 157 checkbox_layout->addWidget (checkbox_message, 0, Qt::AlignTop);
158 checkbox_layout->addStretch (10); 158 checkbox_layout->addStretch (10);
159 159
160 QVBoxLayout *message_logo_and_checkbox = new QVBoxLayout; 160 QVBoxLayout *message_logo_and_checkbox = new QVBoxLayout;
161 161
162 message_logo_and_checkbox->addLayout (message_and_logo); 162 message_logo_and_checkbox->addLayout (message_and_logo);
163 message_logo_and_checkbox->addSpacing (20); 163 message_logo_and_checkbox->addSpacing (20);
164 message_logo_and_checkbox->addLayout (checkbox_layout); 164 message_logo_and_checkbox->addLayout (checkbox_layout);
165 165
166 QHBoxLayout *button_bar = new QHBoxLayout; 166 QHBoxLayout *button_bar = new QHBoxLayout;
167 167
168 button_bar->addStretch (10); 168 button_bar->addStretch (10);
169 button_bar->addWidget (previous); 169 button_bar->addWidget (previous);
170 button_bar->addWidget (next); 170 button_bar->addWidget (next);
171 button_bar->addWidget (cancel); 171 button_bar->addWidget (cancel);
172 172
173 QVBoxLayout *page_layout = new QVBoxLayout (this); 173 QVBoxLayout *page_layout = new QVBoxLayout (this);
174 setLayout (page_layout); 174 setLayout (page_layout);
175 175
176 page_layout->addLayout (message_logo_and_checkbox); 176 page_layout->addLayout (message_logo_and_checkbox);
177 page_layout->addStretch (10); 177 page_layout->addStretch (10);
178 page_layout->addLayout (button_bar); 178 page_layout->addLayout (button_bar);
179 179
180 next->setDefault (true); 180 next->setDefault (true);
181 next->setFocus (); 181 next->setFocus ();
182 182
183 connect (checkbox, SIGNAL (stateChanged (int)), 183 connect (checkbox, SIGNAL (stateChanged (int)),
184 wizard, SLOT (handle_web_connect_option (int))); 184 wizard, SLOT (handle_web_connect_option (int)));
185 185
186 connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ())); 186 connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
187 connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ())); 187 connect (next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
188 connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ())); 188 connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
189 } 189 }
190 190
191 191
192 final_page::final_page (welcome_wizard *wizard) 192 final_page::final_page (welcome_wizard *wizard)
193 : QWidget (wizard), 193 : QWidget (wizard),
194 title (new QLabel (tr ("Enjoy!"), this)), 194 title (new QLabel (tr ("Enjoy!"), this)),
195 message (new QLabel (this)), 195 message (new QLabel (this)),
196 logo (make_octave_logo (this)), 196 logo (make_octave_logo (this)),
197 links (new QLabel (this)), 197 links (new QLabel (this)),
198 previous (new QPushButton (tr ("Previous"), this)), 198 previous (new QPushButton (tr ("Previous"), this)),
199 finish (new QPushButton (tr ("Finish"), this)), 199 finish (new QPushButton (tr ("Finish"), this)),
200 cancel (new QPushButton (tr ("Cancel"), this)) 200 cancel (new QPushButton (tr ("Cancel"), this))
201 { 201 {
202 QFont ft; 202 QFont ft;
203 ft.setPointSize (20); 203 ft.setPointSize (20);
204 title->setFont (ft); 204 title->setFont (ft);
205 205
206 message->setText 206 message->setText
207 (tr ("<html><body>\n" 207 (tr ("<html><body>\n"
208 "<p>We hope you find Octave to be a useful tool.</p>\n" 208 "<p>We hope you find Octave to be a useful tool.</p>\n"
209 "<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" 209 "<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"
210 "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" 210 "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"
211 "</body></html>")); 211 "</body></html>"));
212 message->setWordWrap (true); 212 message->setWordWrap (true);
213 message->setMinimumWidth (400); 213 message->setMinimumWidth (400);
214 message->setOpenExternalLinks (true); 214 message->setOpenExternalLinks (true);
215 215
216 QVBoxLayout *message_layout = new QVBoxLayout; 216 QVBoxLayout *message_layout = new QVBoxLayout;
217 217
218 message_layout->addWidget (title); 218 message_layout->addWidget (title);
219 message_layout->addWidget (message); 219 message_layout->addWidget (message);
220 220
221 QHBoxLayout *message_and_logo = new QHBoxLayout; 221 QHBoxLayout *message_and_logo = new QHBoxLayout;
222 222
223 message_and_logo->addLayout (message_layout); 223 message_and_logo->addLayout (message_layout);
224 message_and_logo->addStretch (10); 224 message_and_logo->addStretch (10);
225 message_and_logo->addWidget (logo, 0, Qt::AlignTop); 225 message_and_logo->addWidget (logo, 0, Qt::AlignTop);
226 226
227 links->setText 227 links->setText
228 (tr ("<html><head>\n" 228 (tr ("<html><head>\n"
229 "<style>\n" 229 "<style>\n"
230 "a:link { text-decoration: underline; color: #0000ff; }\n" 230 "a:link { text-decoration: underline; color: #0000ff; }\n"
231 "</style>\n" 231 "</style>\n"
232 "<head/><body>\n" 232 "<head/><body>\n"
233 "<p>For more information about Octave:</p>\n" 233 "<p>For more information about Octave:</p>\n"
234 "<ul>\n" 234 "<ul>\n"
235 "<li>Visit <a href=\"http://octave.org\">http://octave.org</a> (opens in external browser)</li>\n" 235 "<li>Visit <a href=\"http://octave.org\">http://octave.org</a> (opens in external browser)</li>\n"
236 "<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" 236 "<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"
237 "<li>Open the documentation browser of the Octave GUI with the help menu</li>\n" 237 "<li>Open the documentation browser of the Octave GUI with the help menu</li>\n"
238 "</ul>\n" 238 "</ul>\n"
239 "</body></html>")); 239 "</body></html>"));
240 links->setWordWrap (true); 240 links->setWordWrap (true);
241 links->setOpenExternalLinks (true); 241 links->setOpenExternalLinks (true);
242 242
243 QHBoxLayout *button_bar = new QHBoxLayout; 243 QHBoxLayout *button_bar = new QHBoxLayout;
244 244
245 button_bar->addStretch (10); 245 button_bar->addStretch (10);
246 button_bar->addWidget (previous); 246 button_bar->addWidget (previous);
247 button_bar->addWidget (finish); 247 button_bar->addWidget (finish);
248 button_bar->addWidget (cancel); 248 button_bar->addWidget (cancel);
249 249
250 QVBoxLayout *page_layout = new QVBoxLayout (this); 250 QVBoxLayout *page_layout = new QVBoxLayout (this);
251 setLayout (page_layout); 251 setLayout (page_layout);
252 252
253 page_layout->addLayout (message_and_logo); 253 page_layout->addLayout (message_and_logo);
254 page_layout->addSpacing (20); 254 page_layout->addSpacing (20);
255 page_layout->addWidget (links); 255 page_layout->addWidget (links);
256 page_layout->addStretch (10); 256 page_layout->addStretch (10);
257 page_layout->addLayout (button_bar); 257 page_layout->addLayout (button_bar);
258 258
259 finish->setDefault (true); 259 finish->setDefault (true);
260 finish->setFocus (); 260 finish->setFocus ();
261 261
262 connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ())); 262 connect (previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
263 connect (finish, SIGNAL (clicked ()), wizard, SLOT (accept ())); 263 connect (finish, SIGNAL (clicked ()), wizard, SLOT (accept ()));
264 connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ())); 264 connect (cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
265 } 265 }
266 266
267 267
268 welcome_wizard::welcome_wizard (QWidget *p) 268 welcome_wizard::welcome_wizard (QWidget *p)
269 : QDialog (p), page_ctor_list (), page_list_iterator (), 269 : QDialog (p), page_ctor_list (), page_list_iterator (),
270 current_page (initial_page::create (this)), 270 current_page (initial_page::create (this)),