Mercurial > octave-libgccjit
annotate gui/src/OctaveGUI.cpp @ 13658:d5b84316610d
make gui active window after start
author | ttl <ttl@justmail.de> |
---|---|
date | Sun, 28 Aug 2011 00:19:14 +0200 |
parents | 8728061cd0ec |
children | 421afeae929b |
rev | line source |
---|---|
13504
13e3d60aff2d
Replaced Quint with OctaveGUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
1 /* OctaveGUI - A graphical user interface for Octave |
13501 | 2 * Copyright (C) 2011 Jacob Dawid |
3 * jacob.dawid@googlemail.com | |
4 * | |
5 * This program is free software: you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation, either version 3 of the License, or | |
8 * (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 */ | |
18 | |
19 #include <QtGui/QApplication> | |
20 #include <QTranslator> | |
21 #include <QSettings> | |
13539
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
22 #include "CommandLineParser.h" |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13510
diff
changeset
|
23 #include "ResourceManager.h" |
13501 | 24 #include "MainWindow.h" |
25 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
26 int |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
27 main (int argc, char *argv[]) |
13501 | 28 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
29 QApplication application (argc, argv); |
13539
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
30 CommandLineParser commandLineParser; |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
31 commandLineParser.registerOption ("--config", "-c", "Tells OctaveGUI to use that configuration file.", true); |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
32 commandLineParser.parse (argc, argv); |
a4b5cad8f7c6
Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13537
diff
changeset
|
33 |
13551
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
34 QSettings *settings = ResourceManager::instance ()->settings (); |
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
35 QString language = settings->value ("language").toString (); |
13501 | 36 |
13551
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
37 QString translatorFile = ResourceManager::instance ()->findTranslatorFile (language); |
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
38 QTranslator translator; |
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
39 translator.load (translatorFile); |
ad905cd33563
Hotfixed language support.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13539
diff
changeset
|
40 application.installTranslator (&translator); |
13501 | 41 |
13607
fd31226d4c3a
Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13551
diff
changeset
|
42 ResourceManager::instance ()->updateNetworkSettings (); |
13613
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
43 ResourceManager::instance ()->loadIcons (); |
8728061cd0ec
Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13607
diff
changeset
|
44 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
45 MainWindow w; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
46 w.show (); |
13658 | 47 w.activateWindow(); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
48 return application.exec (); |
13501 | 49 } |