13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 #include <hbsplashscreen.h> |
18 #include "nmuiheaders.h" |
19 #include "nmuiheaders.h" |
19 |
20 #include "nmapplication.h" |
20 const QString NmActivityName("EmailInboxView"); |
|
21 |
21 |
22 /*! |
22 /*! |
23 The main function. |
23 The main function. |
24 */ |
24 */ |
25 int main(int argc, char *argv[]) |
25 int main(int argc, char *argv[]) |
26 { |
26 { |
27 HbApplication app(argc,argv,Hb::NoSplash); |
27 // Decide which splash screen to show. |
28 |
28 if (!XQServiceUtil::isService(argc,argv)) { |
29 // Load the translation file. |
29 HbSplashScreen::setScreenId("messagelist_screen"); |
30 QTranslator translator; |
|
31 QString lang = QLocale::system().name(); |
|
32 QString appName = "mail_"; |
|
33 QString path = "Z:/resource/qt/translations/"; |
|
34 translator.load(appName + lang, path); |
|
35 app.installTranslator(&translator); |
|
36 |
|
37 app.setApplicationName(hbTrId("txt_mail_title_mail")); |
|
38 |
|
39 NmApplication *nmApplication = NULL; |
|
40 quint64 accountId = 0; |
|
41 QString activateId = app.activateId(); |
|
42 if (app.activateReason() == Hb::ActivationReasonActivity && |
|
43 activateId.startsWith(NmActivityName) ) { |
|
44 QString accountIdString = activateId.mid(NmActivityName.length()); |
|
45 accountId = accountIdString.toULongLong(); |
|
46 nmApplication = new NmApplication(&app,accountId); |
|
47 } else { |
30 } else { |
48 nmApplication = new NmApplication(&app); |
31 QString interfaceName = XQServiceUtil::interfaceName(argc,argv); |
|
32 |
|
33 if (interfaceName == XQI_EMAIL_MESSAGE_SEND || |
|
34 interfaceName == XQI_URI_VIEW || |
|
35 interfaceName == XQI_FILE_SHARE) { |
|
36 HbSplashScreen::setScreenId("editor_screen"); |
|
37 } |
|
38 else if (interfaceName == XQI_EMAIL_MESSAGE_VIEW) { |
|
39 HbSplashScreen::setScreenId("viewer_screen"); |
|
40 } |
|
41 else if (interfaceName == XQI_EMAIL_INBOX_VIEW) { |
|
42 HbSplashScreen::setScreenId("messagelist_screen"); |
|
43 } |
49 } |
44 } |
50 |
45 |
|
46 NmApplication app(argc,argv); |
|
47 |
51 int ret = app.exec(); |
48 int ret = app.exec(); |
52 delete nmApplication; |
|
53 return ret; |
49 return ret; |
54 } |
50 } |