2 \brief main + loading translations
3 \author Jakub Šplíchal <jakub.bzouk@gmail.com>
5 #include <QtGui/QApplication>
6 #include <QtCore/QTextCodec>
7 #include <QtCore/QLocale>
8 #include <QtCore/QTranslator>
9 #include <QtCore/QDebug> //Debug pro informace
10 #include <QtDBus/QDBusConnection>
11 #include <QtDBus/QDBusError>
12 #include "mainwindow.h"
14 int main(int argc, char *argv[])
18 QApplication a(argc, argv);
20 //names for app and setting class
21 a.setOrganizationName("N9Profil");
22 a.setApplicationName("N9Profil");
23 a.setApplicationVersion("0.1");
26 QTextCodec* utf = QTextCodec::codecForName("UTF-8");
27 QTextCodec::setCodecForCStrings(utf);
28 QTextCodec::setCodecForTr(utf);
32 /*! http://www.abclinuxu.cz/clanky/programovani/graficke-programy-v-qt-4-7-lokalizace-a-data-programu
33 Sets the application name and the text codec to UTF-8 and
34 reads the translation according to the currently set language:
35 program name + _ + language of the country
36 where language is a two-language code (ISO 639) in lowercase
37 and the country is a two-country code (ISO 3166) in capitals,
38 eg cs_CZ lupdate N9Profil.pro for updating translation
40 t.load(":/translations/" + a.applicationName() + "_" + QLocale::system().name() ); //QLocale::system() vrati info o jaz. systemu
41 //qDebug() << "In file:" << __FILE__ << ":" << "on line:" << __LINE__ << " in function:" << __FUNCTION__ << "bude se nahravat" << (":/translations/" + a.applicationName() + "_" + QLocale::system().name()) ;
43 a.installTranslator(&t);
49 if (!QDBusConnection::sessionBus().isConnected()) {
50 qWarning("Cannot connect to the D-Bus session bus.");
54 if (!QDBusConnection::sessionBus().registerService("org.indt.N9Profil")) {
55 qWarning("%s", qPrintable(QDBusConnection::sessionBus().lastError().
60 if (!QDBusConnection::sessionBus().registerObject("/org/indt/N9Profil", &w,
61 QDBusConnection::ExportAllContents)) {
62 qWarning("%s", qPrintable(QDBusConnection::sessionBus().lastError().
75 /** \mainpage N9Profile for N900
76 N9Profile can create profiles for N900 and set them via libprofile
78 \section instal_section Instalation
79 You can use scratchbox and compile source or use .deb packege <br>
84 \> QT4.6.2 for maemo( in /opt/qt..)