messagingapp/msgservices/msgserviceapp/src/main.cpp
changeset 51 3507212d340e
parent 46 b1f0785c289d
child 67 fc91263aee62
equal deleted inserted replaced
49:2a272ef608c4 51:3507212d340e
    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    //installing translator.
    96    //installing translator.
    81     QString locale = QLocale::system().name();
    97     QString locale = QLocale::system().name();
    82     QString path = "z:/resource/qt/translations/";
       
    83     QTranslator translator;
    98     QTranslator translator;
    84     QTranslator translator_comm;
    99     QTranslator translator_comm;
    85     translator.load(path + "messaging_" + locale);
   100     translator.load(TRANSLATOR_FILE_PATH + QString("messaging_") + locale);
    86     translator_comm.load(path + "common_" + locale);
   101     translator_comm.load(TRANSLATOR_FILE_PATH + QString("common_") + locale);
    87     app.installTranslator(&translator);
   102     app.installTranslator(&translator);
    88     app.installTranslator(&translator_comm);
   103     app.installTranslator(&translator_comm);
    89 
   104 
    90     app.setApplicationName(LOC_TITLE);
   105     app.setApplicationName(LOC_TITLE);
    91     
   106