26 #if defined (HAVE_CONFIG_H)
30 #include <QApplication>
31 #include <QHBoxLayout>
32 #include <QPushButton>
33 #include <QVBoxLayout>
35 #if defined (OCTAVE_USE_WINDOWS_API)
36 #define WIN32_LEAN_AND_MEAN
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);
217 connect (
m_cancel, &QPushButton::clicked, wizard, &welcome_wizard::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 "<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"
275 checkbox_layout->addWidget (
m_checkbox, 0, Qt::AlignTop);
276 checkbox_layout->addSpacing (20);
278 checkbox_layout->addStretch (10);
280 QVBoxLayout *message_logo_and_checkbox =
new QVBoxLayout;
282 message_logo_and_checkbox->addLayout (message_and_logo);
283 message_logo_and_checkbox->addSpacing (20);
284 message_logo_and_checkbox->addLayout (checkbox_layout);
286 QHBoxLayout *button_bar =
new QHBoxLayout;
288 button_bar->addStretch (10);
290 button_bar->addWidget (
m_next);
293 QVBoxLayout *page_layout =
new QVBoxLayout (
this);
294 setLayout (page_layout);
296 page_layout->addLayout (message_logo_and_checkbox);
297 page_layout->addStretch (10);
298 page_layout->addSpacing (20);
299 page_layout->addLayout (button_bar);
301 setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
303 m_next->setDefault (
true);
306 connect (
m_checkbox, &QCheckBox::stateChanged,
311 connect (
m_cancel, &QPushButton::clicked, wizard, &welcome_wizard::reject);
316 m_title (new
QLabel (tr (
"Enjoy!"), this)),
317 m_message (new
QLabel (this)),
319 m_links (new
QLabel (this)),
320 m_previous (new
QPushButton (tr (
"Previous"), this)),
325 ft.setPointSize (20);
329 (tr (
"<html><body>\n"
330 "<p>We hope you find Octave to be a useful tool.</p>\n"
331 "<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"
332 "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"
338 QVBoxLayout *message_layout =
new QVBoxLayout;
340 message_layout->addWidget (
m_title);
343 QHBoxLayout *message_and_logo =
new QHBoxLayout;
345 message_and_logo->addLayout (message_layout);
346 message_and_logo->addStretch (10);
347 message_and_logo->addWidget (
m_logo, 0, Qt::AlignTop);
350 (tr (
"<html><head>\n"
352 "<p>For more information about Octave:</p>\n"
354 "<li>Visit <a href=\"https://octave.org\">https://octave.org</a> (opens in external browser)</li>\n"
355 "<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"
356 "<li>Open the documentation browser of the Octave GUI with the help menu</li>\n"
360 m_links->setOpenExternalLinks (
true);
362 QHBoxLayout *button_bar =
new QHBoxLayout;
364 button_bar->addStretch (10);
369 QVBoxLayout *page_layout =
new QVBoxLayout (
this);
370 setLayout (page_layout);
372 page_layout->addLayout (message_and_logo);
373 page_layout->addSpacing (20);
374 page_layout->addWidget (
m_links);
375 page_layout->addStretch (10);
376 page_layout->addSpacing (20);
377 page_layout->addLayout (button_bar);
379 setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
387 connect (
m_cancel, &QPushButton::clicked, wizard, &welcome_wizard::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)
void handle_web_connect_option(int state)
base_qobject & m_octave_qobj
bool m_allow_web_connect_state
QList< page_creator_fptr >::iterator m_page_list_iterator
QList< page_creator_fptr > m_page_ctor_list
welcome_wizard(base_qobject &oct_qobj, QWidget *parent=nullptr)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
const QHash< QString, QString > dw_icon_set_names
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)