Mercurial > octave
comparison libgui/src/resource-manager.h @ 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 | 0645ea65ca6b |
children | 431f80aba37a |
comparison
equal
deleted
inserted
replaced
31637:34c3cd39c4b9 | 31638:474e184321d3 |
---|---|
57 QString get_gui_translation_dir (void); | 57 QString get_gui_translation_dir (void); |
58 | 58 |
59 void config_translators (QTranslator *qt_tr, QTranslator *qsci_tr, | 59 void config_translators (QTranslator *qt_tr, QTranslator *qsci_tr, |
60 QTranslator *gui_tr); | 60 QTranslator *gui_tr); |
61 | 61 |
62 QString get_settings_directory (void); | |
63 | |
64 QString get_settings_file (void); | |
65 | |
66 QString get_default_font_family (void); | |
67 | |
68 QStringList get_default_font (void); | |
69 | |
70 QPointer<QTemporaryFile> | 62 QPointer<QTemporaryFile> |
71 create_tmp_file (const QString& extension = QString (), | 63 create_tmp_file (const QString& extension = QString (), |
72 const QString& contents = QString ()); | 64 const QString& contents = QString ()); |
73 | 65 |
74 void remove_tmp_file (QPointer<QTemporaryFile> tmp_file); | 66 void remove_tmp_file (QPointer<QTemporaryFile> tmp_file); |
75 | |
76 void reload_settings (void); | |
77 | 67 |
78 #if defined (HAVE_QSCINTILLA) | 68 #if defined (HAVE_QSCINTILLA) |
79 int get_valid_lexer_styles (QsciLexer *lexer, int *styles); | 69 int get_valid_lexer_styles (QsciLexer *lexer, int *styles); |
80 void read_lexer_settings (QsciLexer *lexer, int mode = 0, int def = 0); | 70 void read_lexer_settings (QsciLexer *lexer, int mode = 0, int def = 0); |
81 #endif | 71 #endif |
82 | 72 |
83 bool update_settings_key (const QString& new_key, const QString& old_key); | 73 bool update_settings_key (const QString& new_key, const QString& old_key); |
84 | 74 |
85 bool is_first_run (void) const; | |
86 | |
87 void update_network_settings (void); | 75 void update_network_settings (void); |
88 | 76 |
89 void get_codecs (QStringList *codecs); | 77 void get_codecs (QStringList *codecs); |
90 | 78 |
91 void combo_encoding (QComboBox *combo, const QString& current = QString ()); | 79 void combo_encoding (QComboBox *combo, const QString& current = QString ()); |
92 | 80 |
93 private: | 81 private: |
94 | |
95 void check_settings (void); | |
96 | 82 |
97 /*! | 83 /*! |
98 * Copys the attributes bold, italic and underline from QFont | 84 * Copys the attributes bold, italic and underline from QFont |
99 * @p attr to the font @p base and returns the result without | 85 * @p attr to the font @p base and returns the result without |
100 * changing @p base, | 86 * changing @p base, |
101 * @param attr QFont with the desired attributes | 87 * @param attr QFont with the desired attributes |
102 * @param base QFont with desired family and size | 88 * @param base QFont with desired family and size |
103 */ | 89 */ |
104 QFont copy_font_attributes (const QFont& attr, const QFont& base) const; | 90 QFont copy_font_attributes (const QFont& attr, const QFont& base) const; |
105 | 91 |
106 QString m_settings_directory; | |
107 | |
108 QString m_settings_file; | |
109 | |
110 QList<QTemporaryFile *> m_temporary_files; | 92 QList<QTemporaryFile *> m_temporary_files; |
111 }; | 93 }; |
112 } | 94 } |
113 | 95 |
114 #endif | 96 #endif |