26 #if defined (HAVE_CONFIG_H)
30 #include <QApplication>
31 #include <QDesktopWidget>
32 #include <QHBoxLayout>
33 #include <QPushButton>
34 #include <QVBoxLayout>
36 #if defined (OCTAVE_USE_WINDOWS_API)
37 #define WIN32_LEAN_AND_MEAN
50 QLabel *logo =
new QLabel (p);
51 QPixmap logo_pixmap (
":/actions/icons/logo.png");
52 logo->setPixmap (logo_pixmap.scaledToHeight (height));
57 :
QDialog (p), m_octave_qobj (oct_qobj), m_page_ctor_list (),
58 m_page_list_iterator (),
60 m_allow_web_connect_state (false),
61 m_max_height (0), m_max_width (0)
69 setWindowTitle (tr (
"Welcome to GNU Octave"));
73 setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
89 #if defined (OCTAVE_USE_WINDOWS_API)
91 ShowWindow (
reinterpret_cast<HWND
> (winId ()), SW_SHOWNORMAL);
122 QVBoxLayout *new_layout =
new QVBoxLayout ();
123 setLayout (new_layout);
164 m_title (new QLabel (tr (
"Welcome to Octave!"), this)),
165 m_message (new QLabel (this)),
171 ft.setPointSize (20);
177 (tr (
"<html><body>\n"
178 "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n"
179 "Click 'Next' to create a configuration file and launch Octave.</p>\n"
180 "<p>The configuration file is stored in<br>%1.</p>\n"
186 QVBoxLayout *message_layout =
new QVBoxLayout;
188 message_layout->addWidget (
m_title);
191 QHBoxLayout *message_and_logo =
new QHBoxLayout;
193 message_and_logo->addLayout (message_layout);
194 message_and_logo->addStretch (10);
195 message_and_logo->addWidget (
m_logo, 0, Qt::AlignTop);
197 QHBoxLayout *button_bar =
new QHBoxLayout;
199 button_bar->addStretch (10);
200 button_bar->addWidget (
m_next);
203 QVBoxLayout *page_layout =
new QVBoxLayout (
this);
204 setLayout (page_layout);
206 page_layout->addLayout (message_and_logo);
207 page_layout->addStretch (10);
208 page_layout->addSpacing (20);
209 page_layout->addLayout (button_bar);
211 setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
213 m_next->setDefault (
true);
216 connect (
m_next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
217 connect (
m_cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
223 m_title (new QLabel (tr (
"Community News"), this)),
224 m_message (new QLabel (this)),
225 m_checkbox (new QCheckBox (this)),
226 m_checkbox_message (new QLabel (this)),
228 m_previous (new
QPushButton (tr (
"Previous"), this)),
233 ft.setPointSize (20);
237 (tr (
"<html><body>\n"
238 "<p>When Octave starts, it will optionally check the Octave web site for current news and information about the Octave community.\n"
239 "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"
240 "<p>You may also view the news by selecting the \"Community News\" item in the \"Help\" menu, or by visiting\n"
241 "<a href=\"https://octave.org/community-news.html\">https://octave.org/community-news.html</a>.</p>\n"
247 QVBoxLayout *message_layout =
new QVBoxLayout;
249 message_layout->addWidget (
m_title);
252 QHBoxLayout *message_and_logo =
new QHBoxLayout;
254 message_and_logo->addLayout (message_layout);
255 message_and_logo->addStretch (10);
256 message_and_logo->addWidget (
m_logo, 0, Qt::AlignTop);
258 QHBoxLayout *checkbox_layout =
new QHBoxLayout;
261 if (allow_connection)
267 (tr (
"<html><head>\n"
269 "a:link { text-decoration: underline; color: #0000ff; }\n"
272 "<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"
278 checkbox_layout->addWidget (
m_checkbox, 0, Qt::AlignTop);
279 checkbox_layout->addSpacing (20);
281 checkbox_layout->addStretch (10);
283 QVBoxLayout *message_logo_and_checkbox =
new QVBoxLayout;
285 message_logo_and_checkbox->addLayout (message_and_logo);
286 message_logo_and_checkbox->addSpacing (20);
287 message_logo_and_checkbox->addLayout (checkbox_layout);
289 QHBoxLayout *button_bar =
new QHBoxLayout;
291 button_bar->addStretch (10);
293 button_bar->addWidget (
m_next);
296 QVBoxLayout *page_layout =
new QVBoxLayout (
this);
297 setLayout (page_layout);
299 page_layout->addLayout (message_logo_and_checkbox);
300 page_layout->addStretch (10);
301 page_layout->addSpacing (20);
302 page_layout->addLayout (button_bar);
304 setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
306 m_next->setDefault (
true);
309 connect (
m_checkbox, SIGNAL (stateChanged (
int)),
310 wizard, SLOT (handle_web_connect_option (
int)));
312 connect (
m_previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
313 connect (
m_next, SIGNAL (clicked ()), wizard, SLOT (next_page ()));
314 connect (
m_cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
319 m_title (new QLabel (tr (
"Enjoy!"), this)),
320 m_message (new QLabel (this)),
322 m_links (new QLabel (this)),
323 m_previous (new
QPushButton (tr (
"Previous"), this)),
328 ft.setPointSize (20);
332 (tr (
"<html><body>\n"
333 "<p>We hope you find Octave to be a useful tool.</p>\n"
334 "<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 community-based support channels.\n"
335 "You can find more information about each of these by visiting <a href=\"https://octave.org/support.html\">https://octave.org/support.html</a> (opens in external browser).</p>\n"
341 QVBoxLayout *message_layout =
new QVBoxLayout;
343 message_layout->addWidget (
m_title);
346 QHBoxLayout *message_and_logo =
new QHBoxLayout;
348 message_and_logo->addLayout (message_layout);
349 message_and_logo->addStretch (10);
350 message_and_logo->addWidget (
m_logo, 0, Qt::AlignTop);
353 (tr (
"<html><head>\n"
355 "a:link { text-decoration: underline; color: #0000ff; }\n"
358 "<p>For more information about Octave:</p>\n"
360 "<li>Visit <a href=\"https://octave.org\">https://octave.org</a> (opens in external browser)</li>\n"
361 "<li>Get the documentation online as <a href=\"https://www.gnu.org/software/octave/doc/interpreter/index.html\">html</a>- or <a href=\"https://www.gnu.org/software/octave/octave.pdf\">pdf</a>-document (opens in external browser)</li>\n"
362 "<li>Open the documentation browser of the Octave GUI with the help menu</li>\n"
366 m_links->setOpenExternalLinks (
true);
368 QHBoxLayout *button_bar =
new QHBoxLayout;
370 button_bar->addStretch (10);
375 QVBoxLayout *page_layout =
new QVBoxLayout (
this);
376 setLayout (page_layout);
378 page_layout->addLayout (message_and_logo);
379 page_layout->addSpacing (20);
380 page_layout->addWidget (
m_links);
381 page_layout->addStretch (10);
382 page_layout->addSpacing (20);
383 page_layout->addLayout (button_bar);
385 setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
390 connect (
m_previous, SIGNAL (clicked ()), wizard, SLOT (previous_page ()));
391 connect (
m_finish, SIGNAL (clicked ()), wizard, SLOT (accept ()));
392 connect (
m_cancel, SIGNAL (clicked ()), wizard, SLOT (reject ()));
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
final_page(base_qobject &oct_qobj, welcome_wizard *wizard)
static QWidget * create(base_qobject &oct_qobj, welcome_wizard *wizard)
initial_page(base_qobject &oct_qobj, welcome_wizard *wizard)
static QWidget * create(base_qobject &oct_qobj, welcome_wizard *wizard)
gui_settings * get_settings(void) const
QString get_settings_file(void)
void reload_settings(void)
QList< page_creator_fptr > m_page_ctor_list
QList< page_creator_fptr >::iterator m_page_list_iterator
void handle_web_connect_option(int state)
bool m_allow_web_connect_state
base_qobject & m_octave_qobj
welcome_wizard(base_qobject &oct_qobj, QWidget *parent=nullptr)
const gui_pref nr_allow_connection("news/allow_web_connection", QVariant(false))
static uint32_t state[624]
static QLabel * make_octave_logo(QWidget *p=nullptr, int height=100)