Initial commit
[timedsilencer] / main.cpp
1 /*
2  * This file is part of TimedSilencer.
3  *
4  *  TimedSilencer is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 3 of the License, or
7  *  (at your option) any later version.
8  *
9  *  TimedSilencer is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with TimedSilencer.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include <QtGui/QApplication>
19 #include <QTranslator>
20 #include <QLocale>
21 #include "mainwindow.h"
22
23 int main(int argc, char *argv[])
24 {
25   QApplication a(argc, argv);
26
27   // Load translation
28   QTranslator translator;
29   QString locale = QLocale::system().name();
30   qDebug("Detected locale is: %s", qPrintable(locale));
31   translator.load(":/lang/timedsilencer_"+locale);
32   a.installTranslator(&translator);
33
34   // Show Main window
35   MainWindow w;
36 #if defined(Q_WS_S60)
37   w.showMaximized();
38 #else
39   w.show();
40 #endif
41
42   return a.exec();
43 }