13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 //USER |
17 //USER |
|
18 #include "logsappsettings.h" |
18 #include "logsapplication.h" |
19 #include "logsapplication.h" |
19 #include "logsmainwindow.h" |
20 #include "logsmainwindow.h" |
20 #include "logsviewmanager.h" |
21 #include "logsviewmanager.h" |
21 #include "logsservicehandler.h" |
22 #include "logsservicehandler.h" |
22 #include "logsservicehandlerold.h" |
23 #include "logsservicehandlerold.h" |
38 |
39 |
39 int main(int argc, char *argv[]) |
40 int main(int argc, char *argv[]) |
40 { |
41 { |
41 LOGS_QDEBUG( "logs [UI] -> main()" ) |
42 LOGS_QDEBUG( "logs [UI] -> main()" ) |
42 |
43 |
43 LogsApplication app(argc, argv); |
44 LogsAppSettings appSettings(argc, argv); |
|
45 LogsApplication app(argc, argv, appSettings); |
44 |
46 |
45 #ifdef LOGS_USE_QTRANSLATOR |
47 #ifdef LOGS_USE_QTRANSLATOR |
46 QString lang = QLocale::system().name(); |
48 QString lang = QLocale::system().name(); |
47 QTranslator trans; |
49 QTranslator trans; |
48 QString path = "z:/resource/qt/translations/"; |
50 QString path = "z:/resource/qt/translations/"; |
63 translator.loadCommon(); |
65 translator.loadCommon(); |
64 #endif |
66 #endif |
65 |
67 |
66 LogsMainWindow window; |
68 LogsMainWindow window; |
67 //Application ready signal is emitted after startup when UI is fully loaded and functional |
69 //Application ready signal is emitted after startup when UI is fully loaded and functional |
68 QObject::connect( &window, SIGNAL(viewReady()), &app, SLOT(testLogsHandleAppViewReady()) ); |
70 QObject::connect( &window, SIGNAL(viewReady()), &app, SLOT(testLogsHandleAppViewReady()) ); |
|
71 QObject::connect( &window, SIGNAL(appLostForeground()), &app, SLOT(testLogsResetAppReady()) ); |
69 HbStyleLoader::registerFilePath(":/logslayouts"); |
72 HbStyleLoader::registerFilePath(":/logslayouts"); |
70 |
73 |
71 // Create service handler asap so that services are published fast. |
74 // Create service handler asap so that services are published fast. |
72 // Servicehandler cannot be created before HbApplication creation. |
75 // Servicehandler cannot be created before HbApplication creation. |
73 // This can cause problem of service request not coming through if |
76 // This can cause problem of service request not coming through if |
74 // HbApplication creation takes long time. |
77 // HbApplication creation takes long time. |
75 LogsServiceHandler service; |
78 LogsServiceHandler service; |
76 LogsServiceHandlerOld serviceOld; |
79 LogsServiceHandlerOld serviceOld; |
77 LogsViewManager viewManager(window, service, serviceOld); |
80 LogsViewManager viewManager(window, service, serviceOld, appSettings); |
78 |
81 |
79 // Don't show window yet as app might be started at background |
82 // Don't show window yet as app might be started at background |
80 int err = app.exec(); |
83 int err = app.exec(); |
81 |
84 |
82 HbStyleLoader::unregisterFilePath(":/logslayouts"); |
85 HbStyleLoader::unregisterFilePath(":/logslayouts"); |