messagingapp/msgservices/msgserviceapp/src/main.cpp
changeset 52 12db4185673b
parent 34 84197e66a4bd
child 72 6f657153cbc5
equal deleted inserted replaced
44:36f374c67aa8 52:12db4185673b
    19 #include <QTranslator>
    19 #include <QTranslator>
    20 #include <QLocale>
    20 #include <QLocale>
    21 #include <QFile>
    21 #include <QFile>
    22 #include <QPointer>
    22 #include <QPointer>
    23 #include <QDateTime>
    23 #include <QDateTime>
       
    24 #include <HbSplashScreen>
       
    25 #include <xqserviceutil.h>
    24 
    26 
    25 #include "msgservicewindow.h"
    27 #include "msgservicewindow.h"
    26 #include "debugtraces.h"
    28 #include "debugtraces.h"
    27 
    29 
    28 //Localised constants
    30 //Localised constants
    29 #define LOC_TITLE hbTrId("txt_messaging_title_messaging")
    31 #define LOC_TITLE hbTrId("txt_messaging_title_messaging")
    30 
    32 
    31 const QString debugFileName("c:/msgservice_app.txt");
    33 const QString debugFileName("c:/msgservice_app.txt");
       
    34 const QString TRANSLATOR_FILE_PATH("z:/resource/qt/translations/");
    32 
    35 
    33 #ifdef _DEBUG_TRACES_
    36 #ifdef _DEBUG_TRACES_
    34 void debugInit(QtMsgType type, const char *msg)
    37 void debugInit(QtMsgType type, const char *msg)
    35 {
    38 {
    36 
    39 
    73 }
    76 }
    74 #endif
    77 #endif
    75 
    78 
    76 int main(int argc, char **argv)
    79 int main(int argc, char **argv)
    77 {
    80 {
       
    81     // if else loop to launch the splash screen based on the service called.
       
    82     
       
    83     QString serviceName = XQServiceUtil::interfaceName( argc, argv);
       
    84     
       
    85     if( !serviceName.compare( QString( "com.nokia.symbian.IMessageSend") ) )
       
    86         {
       
    87         HbSplashScreen::setScreenId( "sendservice" );
       
    88         }
       
    89     else if ( !serviceName.compare( "com.nokia.symbian.IMessageView") )
       
    90         {
       
    91         HbSplashScreen::setScreenId( "viewservice" );
       
    92         }
       
    93     
    78     HbApplication app( argc, argv );
    94     HbApplication app( argc, argv );
    79     
    95     
    80     //TODO: Uncomment the lines when actual 
    96    //installing translator.
    81     //translation files are available in sdk and remove loading locally.
       
    82     QString locale = QLocale::system().name();
    97     QString locale = QLocale::system().name();
    83     QString path = "z:/resource/qt/translations/";
       
    84     QTranslator translator;
    98     QTranslator translator;
    85     //QTranslator translator_comm;
    99     QTranslator translator_comm;
    86     //translator.load(path + QString("messaging_") + locale);
   100     translator.load(TRANSLATOR_FILE_PATH + QString("messaging_") + locale);
    87     //translator_comm.load(path + QString("common_") + locale);
   101     translator_comm.load(TRANSLATOR_FILE_PATH + QString("common_") + locale);
    88     translator.load( "messaging_en_GB", ":/translations" );
       
    89     app.installTranslator(&translator);
   102     app.installTranslator(&translator);
    90     //app.installTranslator(&translator_comm);
   103     app.installTranslator(&translator_comm);
    91 
   104 
    92     app.setApplicationName(LOC_TITLE);
   105     app.setApplicationName(LOC_TITLE);
    93     
   106     
    94     QPointer<MsgServiceWindow> window = new MsgServiceWindow();
   107     QPointer<MsgServiceWindow> window = new MsgServiceWindow();
    95     window->show();
   108     window->show();