Mercurial > octave
comparison libgui/src/welcome-wizard.cc @ 31638:474e184321d3
move some functions from resource_manager to gui_settings
* gui-settings.h, gui-settings.cc (gui_settings::get_default_font_family,
gui_settings::get_default_font, gui_settings::reload,
gui_settings::check): Rename and move here from resource-manager.h and
resource-manager.cc. Change all uses.
* resource-manager.h, resource-manager.cc
(resource_manager::is_first_run): Delete.
* gui-preferences-global.h (global_skip_welcome_wizard):
New gui_pref object.
* main-window.cc (main_window::main_window): Check this setting to
determine whether to display welcome wizard.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 04 Dec 2022 22:56:23 -0500 |
parents | ad014fc78bd6 |
children | ca7d58406f82 |
comparison
equal
deleted
inserted
replaced
31637:34c3cd39c4b9 | 31638:474e184321d3 |
---|---|
142 | 142 |
143 void welcome_wizard::accept (void) | 143 void welcome_wizard::accept (void) |
144 { | 144 { |
145 // Create default settings file. | 145 // Create default settings file. |
146 | 146 |
147 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); | |
148 rmgr.reload_settings (); | |
149 | |
150 gui_settings settings; | 147 gui_settings settings; |
148 | |
149 settings.reload (); | |
151 | 150 |
152 settings.setValue (nr_allow_connection.key, | 151 settings.setValue (nr_allow_connection.key, |
153 m_allow_web_connect_state); | 152 m_allow_web_connect_state); |
154 | 153 |
155 settings.sync (); | 154 settings.sync (); |
156 | 155 |
157 QDialog::accept (); | 156 QDialog::accept (); |
158 } | 157 } |
159 | 158 |
160 initial_page::initial_page (base_qobject& oct_qobj, welcome_wizard *wizard) | 159 initial_page::initial_page (base_qobject&, welcome_wizard *wizard) |
161 : QWidget (wizard), | 160 : QWidget (wizard), |
162 m_title (new QLabel (tr ("Welcome to Octave!"), this)), | 161 m_title (new QLabel (tr ("Welcome to Octave!"), this)), |
163 m_message (new QLabel (this)), | 162 m_message (new QLabel (this)), |
164 m_logo (make_octave_logo (this)), | 163 m_logo (make_octave_logo (this)), |
165 m_next (new QPushButton (tr ("Next"), this)), | 164 m_next (new QPushButton (tr ("Next"), this)), |
167 { | 166 { |
168 QFont ft; | 167 QFont ft; |
169 ft.setPointSize (20); | 168 ft.setPointSize (20); |
170 m_title->setFont (ft); | 169 m_title->setFont (ft); |
171 | 170 |
172 resource_manager& rmgr = oct_qobj.get_resource_manager (); | 171 gui_settings settings; |
173 | 172 |
174 m_message->setText | 173 m_message->setText |
175 (tr ("<html><body>\n" | 174 (tr ("<html><body>\n" |
176 "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n" | 175 "<p>You seem to be using the Octave graphical interface for the first time on this computer.\n" |
177 "Click 'Next' to create a configuration file and launch Octave.</p>\n" | 176 "Click 'Next' to create a configuration file and launch Octave.</p>\n" |
178 "<p>The configuration file is stored in<br>%1.</p>\n" | 177 "<p>The configuration file is stored in<br>%1.</p>\n" |
179 "</body></html>"). | 178 "</body></html>"). |
180 arg (rmgr.get_settings_file ())); | 179 arg (settings.file_name ())); |
181 m_message->setWordWrap (true); | 180 m_message->setWordWrap (true); |
182 m_message->setMinimumWidth (400); | 181 m_message->setMinimumWidth (400); |
183 | 182 |
184 QVBoxLayout *message_layout = new QVBoxLayout; | 183 QVBoxLayout *message_layout = new QVBoxLayout; |
185 | 184 |