annotate libgui/src/resource-manager.h @ 27923:bd51beb6205e

update formatting of copyright notices * Use <https://octave.org/copyright/> instead of <https://octave.org/COPYRIGHT.html/>. * For consistency with other comments in the Octave sources, use C++-style comments for copyright blocks in C and C++ files. * Use delimiters above and below copyright blocks that are appropriate for the language used in the file. * Eliminate extra spacing inside copyright blocks. * lex.ll (looks_like_copyright): Also allow newlines and carriage returns before the word "Copyright". * scripts/mk-doc.pl (gethelp): Also skip empty comment lines. * bp-table.cc, type.m: Adjust tests.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Jan 2020 11:59:41 -0500
parents 1891570abac8
children bb6bb306b8a6 0a5b15007766
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 // Copyright (C) 2011-2020 The Octave Project Developers
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
13539
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13537
diff changeset
25
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
26 #if ! defined (octave_resource_manager_h)
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
27 #define octave_resource_manager_h 1
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26656
diff changeset
29 #include <QComboBox>
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 15161
diff changeset
30 #include <QIcon>
27556
410622ac120f improve run selection from editor (bug #42705)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27412
diff changeset
31 #include <QPointer>
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
32 #include <QTranslator>
27556
410622ac120f improve run selection from editor (bug #42705)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27412
diff changeset
33 #include <QTemporaryFile>
15787
b081fbe80174 provide separate icons for gui's floating widgets
Torsten <ttl@justmail.de>
parents: 15300
diff changeset
34
27611
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27583
diff changeset
35 #include "gui-settings.h"
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27583
diff changeset
36
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
37 namespace octave
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
38 {
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
39 class resource_manager : public QObject
16593
e13051d7a472 allow GUI window layout to be restored
John W. Eaton <jwe@octave.org>
parents: 15972
diff changeset
40 {
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
41 Q_OBJECT
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
42
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
43 protected:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
44
25103
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
45 public:
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
46
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
47 resource_manager (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
48
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
49 // No copying!
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
50
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
51 resource_manager (const resource_manager&) = delete;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
52
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
53 resource_manager& operator = (const resource_manager&) = delete;
16593
e13051d7a472 allow GUI window layout to be restored
John W. Eaton <jwe@octave.org>
parents: 15972
diff changeset
54
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
55 ~resource_manager ();
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
56
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
57 QString get_gui_translation_dir (void);
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
58
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
59 void config_translators (QTranslator *qt_tr, QTranslator *qsci_tr,
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
60 QTranslator *gui_tr);
17515
c8c0dff02538 gui: welcome wizard with new message text
Torsten <ttl@justmail.de>
parents: 17421
diff changeset
61
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
62 gui_settings * get_settings (void) const;
24282
a669809df612 update wrong setting keys accidentally introduced into the settings file
Torsten <mttl@mailbox.org>
parents: 23219
diff changeset
63
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
64 gui_settings * get_default_settings (void) const;
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
65
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
66 QString get_settings_directory (void);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
67
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
68 QString get_settings_file (void);
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
69
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
70 QString get_default_font_family (void);
25700
ba8227df92ae synchronize gui editor encoding when changing __mfile_encdoing__ (bug #54310)
Torsten <mttl@mailbox.org>
parents: 25103
diff changeset
71
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
72 QPointer<QTemporaryFile>
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
73 create_tmp_file (const QString& extension = QString (),
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
74 const QString& contents = QString ());
20774
5c5e085a1ae6 allow selecting an encoding when saving a file (bug #45688)
Torsten <ttl@justmail.de>
parents: 19899
diff changeset
75
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
76 void remove_tmp_file (QPointer<QTemporaryFile> tmp_file);
15972
22ab4fe661d7 gui: selectable language in settings dialog
Torsten <ttl@justmail.de>
parents: 15914
diff changeset
77
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
78 void reload_settings (void);
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 15161
diff changeset
79
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
80 void set_settings (const QString& file);
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
81
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
82 bool update_settings_key (const QString& new_key, const QString& old_key);
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
83
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
84 bool is_first_run (void) const;
27556
410622ac120f improve run selection from editor (bug #42705)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27412
diff changeset
85
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
86 void update_network_settings (void);
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
87
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
88 QIcon icon (const QString& icon_name, bool fallback = true);
27556
410622ac120f improve run selection from editor (bug #42705)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27412
diff changeset
89
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
90 void get_codecs (QStringList *codecs);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
91
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27618
diff changeset
92 void combo_encoding (QComboBox *combo, const QString& current = QString ());
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 15161
diff changeset
93
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
94 private:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
95
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
96 QString m_settings_directory;
15914
85f9aca30c76 gui: reorganized handling of different icons for dock widgets
Torsten <ttl@justmail.de>
parents: 15894
diff changeset
97
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
98 QString m_settings_file;
19899
a8a5415b05cb new gui icons
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
99
27611
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27583
diff changeset
100 gui_settings *m_settings;
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23927
diff changeset
101
27611
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27583
diff changeset
102 gui_settings *m_default_settings;
27556
410622ac120f improve run selection from editor (bug #42705)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27412
diff changeset
103
410622ac120f improve run selection from editor (bug #42705)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27412
diff changeset
104 QList<QTemporaryFile *> m_temporary_files;
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
105 };
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
106 }
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23927
diff changeset
107
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 20774
diff changeset
108 #endif