76 } |
76 } |
77 #endif |
77 #endif |
78 |
78 |
79 int main(int argc, char **argv) |
79 int main(int argc, char **argv) |
80 { |
80 { |
81 // if else loop to launch the splash screen based on the service called. |
81 // Need splashScreen at construction time itself? |
82 |
82 bool needImmdSplashScreen = true; |
|
83 |
|
84 // Decision logic to launch the splash screen based on the service called |
83 QString serviceName = XQServiceUtil::interfaceName( argc, argv); |
85 QString serviceName = XQServiceUtil::interfaceName( argc, argv); |
84 |
|
85 if( !serviceName.compare( QString( "com.nokia.symbian.IMessageSend") ) ) |
86 if( !serviceName.compare( QString( "com.nokia.symbian.IMessageSend") ) ) |
86 { |
87 { |
87 HbSplashScreen::setScreenId( "sendservice" ); |
88 HbSplashScreen::setScreenId( "sendservice" ); |
88 } |
89 } |
89 else if ( !serviceName.compare( "com.nokia.symbian.IMessageView") ) |
90 else if ( !serviceName.compare( "com.nokia.symbian.IMessageView") ) |
90 { |
91 { |
91 HbSplashScreen::setScreenId( "viewservice" ); |
92 HbSplashScreen::setScreenId( "viewservice" ); |
|
93 needImmdSplashScreen = false; |
92 } |
94 } |
93 |
95 |
94 HbApplication app( argc, argv ); |
96 // Appropriate HbApplication initialization |
95 |
97 HbApplication app( argc, argv, |
96 //installing translator. |
98 needImmdSplashScreen? Hb::DefaultApplicationFlags : Hb::NoSplash); |
|
99 |
|
100 // Install translator. |
97 QString locale = QLocale::system().name(); |
101 QString locale = QLocale::system().name(); |
98 QTranslator translator; |
102 QTranslator translator; |
99 QTranslator translator_comm; |
103 QTranslator translator_comm; |
100 translator.load(TRANSLATOR_FILE_PATH + QString("messaging_") + locale); |
104 translator.load(TRANSLATOR_FILE_PATH + QString("messaging_") + locale); |
101 translator_comm.load(TRANSLATOR_FILE_PATH + QString("common_") + locale); |
105 translator_comm.load(TRANSLATOR_FILE_PATH + QString("common_") + locale); |
102 app.installTranslator(&translator); |
106 app.installTranslator(&translator); |
103 app.installTranslator(&translator_comm); |
107 app.installTranslator(&translator_comm); |
|
108 app.setApplicationName(LOC_TITLE); |
104 |
109 |
105 app.setApplicationName(LOC_TITLE); |
110 // Create mainwindow, but don't show it just yet. |
106 |
111 // We shall show the mainwindow at appropriate places later in the code. |
107 QPointer<MsgServiceWindow> window = new MsgServiceWindow(); |
112 QPointer<MsgServiceWindow> window = new MsgServiceWindow(); |
108 window->show(); |
113 |
109 |
114 // Start event-loop |
110 int rv = app.exec(); |
115 int rv = app.exec(); |
111 delete window; |
116 delete window; |
112 return rv; |
117 return rv; |
113 } |
118 } |
114 |
119 |