Mercurial > hg > octave-lyh
annotate gui/src/ResourceManager.h @ 13668:421afeae929b
Added a settings wizard that appears at first startup of Octave GUI.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sat, 10 Sep 2011 18:33:58 +0200 |
parents | ddc3c20d0e2f |
children | c0e66d6e3dc8 |
rev | line source |
---|---|
13539
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
1 /* OctaveGUI - A graphical user interface for Octave |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
2 * Copyright (C) 2011 Jacob Dawid |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
3 * jacob.dawid@googlemail.com |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
4 * |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
5 * This program is free software: you can redistribute it and/or modify |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
7 * the Free Software Foundation, either version 3 of the License, or |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
8 * (at your option) any later version. |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
9 * |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
13 * GNU General Public License for more details. |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
14 * |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
17 */ |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
18 |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
19 #ifndef RESOURCEMANAGER_H |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
20 #define RESOURCEMANAGER_H |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
21 |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
22 #include <QSettings> |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
23 #include <QDesktopServices> |
13613
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
24 #include <QMap> |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
25 #include <QIcon> |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
26 |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
27 class ResourceManager |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
28 { |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
29 public: |
13613
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
30 enum Icon |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
31 { |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
32 Octave, |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
33 Terminal, |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
34 Documentation, |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
35 Chat, |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
36 ChatNewMessage |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
37 }; |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
38 |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
39 ~ResourceManager (); |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
40 |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
41 static ResourceManager * |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
42 instance () |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
43 { |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
44 return &m_singleton; |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
45 } |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
46 |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
47 QSettings *settings (); |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
48 QString homePath (); |
13668
421afeae929b
Added a settings wizard that appears at first startup of Octave GUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13665
diff
changeset
|
49 void reloadSettings (); |
13539
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
50 void setSettings (QString file); |
13551
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
51 QString findTranslatorFile (QString language); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13551
diff
changeset
|
52 void updateNetworkSettings (); |
13613
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
53 void loadIcons (); |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
54 QIcon icon (Icon icon); |
13668
421afeae929b
Added a settings wizard that appears at first startup of Octave GUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13665
diff
changeset
|
55 bool isFirstRun (); |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13551
diff
changeset
|
56 |
13665
ddc3c20d0e2f
Implemented highlighting of octave keywords in terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13613
diff
changeset
|
57 const char *octaveKeywords (); |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
58 private: |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
59 ResourceManager (); |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
60 |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
61 QSettings *m_settings; |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
62 QString m_homePath; |
13613
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
63 QMap <Icon, QIcon> m_icons; |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
64 static ResourceManager m_singleton; |
13668
421afeae929b
Added a settings wizard that appears at first startup of Octave GUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13665
diff
changeset
|
65 bool m_firstRun; |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
66 }; |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
67 |
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
68 #endif // RESOURCEMANAGER_H |