FreeDebks  1.0.3
 All Classes Files Functions Variables Friends Pages
main.cpp
Go to the documentation of this file.
1 // --------------------------------------------------------------------
2 // Copyright © 2011-2013 Mathieu Schopfer
3 //
4 // This file is part of FreeDebks.
5 //
6 // FreeDebks is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // FreeDebks is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with FreeDebks. If not, see <http://www.gnu.org/licenses/>.
18 // --------------------------------------------------------------------
19 
20 #include <QApplication>
21 #include <QtGui>
22 #include "gui/FdMainWindow.hpp"
23 
24 QString DIR_PREFIX = QString("/usr");
25 
26 int main (int argc, char **argv)
27 {
28  QApplication app (argc, argv);
29  app.setApplicationName("FreeDebks");
30  app.setOrganizationName("Mathieu Schopfer");
31  app.setOrganizationDomain("http://freedebks.sf.net");
32  app.setApplicationVersion("1.0.3");
33 
34 #ifdef Q_OS_LINUX
35  app.setWindowIcon(QIcon(DIR_PREFIX + "/share/icons/hicolor/256x256/apps/freedebks.png"));
36 #else
37  app.setWindowIcon(QIcon("icons/icon.png"));
38 #endif
39 
40  QString locale = QLocale::system().name().section('_', 0, 0);
41  QTranslator custom;
42  QTranslator qt;
43 #ifdef Q_OS_LINUX
44  custom.load(DIR_PREFIX + "/share/freedebks/translations/FreeDebks_" + locale);
45  qt.load(DIR_PREFIX + "/share/freedebks/translations/qt_" + locale);
46 #else
47  custom.load("translations/FreeDebks_" + locale);
48  qt.load("translations/qt_" + locale);
49 #endif
50 
51  app.installTranslator(&custom);
52  app.installTranslator(&qt);
53 
54  FdMainWindow window;
55  mainWindow->show();
56 
57  return app.exec();
58 }