1a49f53e04e4abb173b024b44dac9906becc434a
[medard] / src / main.cpp
1 /*
2  *  Medard for Maemo.
3  *  Copyright (C) 2011 Roman Moravcik
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 2 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, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #ifdef Q_WS_MAEMO_6
21 #include <MApplication>
22 #include <MApplicationWindow>
23 #else
24 #include <QApplication>
25 #endif
26
27 #include <QTranslator>
28 #include <QLocale>
29
30 #include "mainwindow.h"
31
32 int main(int argc, char *argv[])
33 {
34 #ifdef Q_WS_MAEMO_6
35     MApplication app(argc, argv);
36 #else
37     QApplication app(argc, argv);
38 #endif
39
40     QString translatorFileName = "medard_" + QLocale::system().name();
41     QTranslator translator;
42     if (translator.load(translatorFileName, "/opt/medard/share/l10n/"))
43         app.installTranslator(&translator);
44
45 #ifdef Q_WS_MAEMO_6
46     MApplicationWindow window;
47     MainWindow page;
48     page.appear(&window);
49     window.show();
50 #else
51     MainWindow window;
52     window.showMaximized();
53 #endif
54
55     return app.exec();
56 }