Subversion Repositories Projects

Rev

Rev 674 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 674 Rev 908
1
/***************************************************************************
1
/***************************************************************************
2
 *   Copyright (C) 2009 by Manuel Schrape                                  *
2
 *   Copyright (C) 2009 by Manuel Schrape                                  *
3
 *   manuel.schrape@gmx.de                                                 *
3
 *   manuel.schrape@gmx.de                                                 *
4
 *                                                                         *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
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  *
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.        *
7
 *   the Free Software Foundation; either version 2 of the License.        *
8
 *                                                                         *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
18
 ***************************************************************************/
19
 
19
 
20
#include <QtGui/QApplication>
20
#include <QtGui/QApplication>
-
 
21
#include <QTranslator>
-
 
22
 
21
#include "Dialogs/dlg_Main.h"
23
#include "Dialogs/dlg_Main.h"
22
 
24
 
23
int main(int argc, char *argv[])
25
int main(int argc, char *argv[])
24
{
26
{
25
    QApplication App(argc, argv);
27
    QApplication App(argc, argv);
-
 
28
 
-
 
29
    QString locale = QLocale::system().name();
-
 
30
    qDebug() << "QMK-Communicator_" << locale;
-
 
31
 
-
 
32
    // Enable translation service
-
 
33
    QTranslator translator;
-
 
34
 
-
 
35
    QDir dir(argv[0]);
-
 
36
    QString appPath = dir.canonicalPath().toAscii().append("_");
-
 
37
 
-
 
38
     if (!translator.load(QString(appPath).append(locale))) {
-
 
39
         qDebug() << "Error loading translation file: " << appPath << locale;
-
 
40
     }
-
 
41
 
26
 
42
    App.installTranslator(&translator);
27
    dlg_Main *MainApp = new dlg_Main();
43
    dlg_Main *MainApp = new dlg_Main();
28
 
44
 
29
    MainApp->set_ARGV(argv[0]);
45
    MainApp->set_ARGV(argv[0]);
30
    MainApp->show();
46
    MainApp->show();
31
 
47
 
32
    int iReturn = App.exec();
48
    int iReturn = App.exec();
33
 
49
 
34
    delete MainApp;
50
    delete MainApp;
35
 
-
 
36
    return iReturn;
51
    return iReturn;
37
}
52
}
38
 
53