15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <QtGui> |
19 #include <QtGui> |
20 #include <QTranslator> |
|
21 #include <xqserviceutil.h> |
20 #include <xqserviceutil.h> |
22 #include <hbapplication.h> |
21 #include <hbapplication.h> |
23 #include <hbmainwindow.h> |
22 #include <hbmainwindow.h> |
|
23 #include <hbtranslator.h> |
24 #include "calencontroller.h" |
24 #include "calencontroller.h" |
25 #include "calenserviceprovider.h" |
25 #include "calenserviceprovider.h" |
26 |
26 |
27 |
27 |
28 int main(int argc, char *argv[]) |
28 int main(int argc, char *argv[]) |
29 { |
29 { |
30 HbApplication app(argc, argv); |
30 HbApplication app(argc, argv); |
31 |
31 |
32 // Main window for providing the scene context |
32 // Main window for providing the scene context |
33 HbMainWindow window; |
33 HbMainWindow window; |
34 window.setRenderHints( |
|
35 QPainter::Antialiasing | QPainter::SmoothPixmapTransform); |
|
36 window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); |
|
37 |
34 |
38 //For translation, loading and installing translator |
35 //For translation, loading and installing translator |
39 QTranslator translator; |
36 HbTranslator translator("calendar"); |
40 QString lang = QLocale::system().name(); |
37 translator.loadCommon(); |
41 QString path = "Z:/resource/qt/translations/"; |
38 |
42 // TODO: Load the appropriate .qm file based on locale |
39 // Backup and restore code need to write here. |
43 //bool loaded = translator.load("calendar_" + lang, path); |
40 |
44 bool loaded = translator.load("calendar_en_GB",":/translations"); |
41 CCalenController *controller = new CCalenController(); |
45 app.installTranslator(&translator); |
|
46 |
42 |
47 //Backup and restore code need to write here. |
43 int retValue = 0; |
48 |
44 if (controller) { |
49 // Check if calendar is launched thru XQService framework |
45 controller->constructController(); |
50 bool isFromServiceFrmwrk = XQServiceUtil::isService(); |
46 // Create the Calendar service provider |
51 CCalenController *controller = new CCalenController(isFromServiceFrmwrk); |
47 CalenServiceProvider service(controller); |
52 |
48 |
53 // Create the Calendar service provider |
49 retValue = app.exec(); |
54 CalenServiceProvider service(controller); |
|
55 |
50 |
56 int retValue = app.exec(); |
51 // delete the controller |
57 |
52 controller->ReleaseCustomisations(); |
58 // delete the controller |
53 controller->Release(); |
59 controller->Release(); |
54 } |
60 |
|
61 return retValue; |
55 return retValue; |
62 } |
56 } |
63 |
57 |
64 |
58 |
65 //End of file |
59 //End of file |