14 * Description: main.cpp |
14 * Description: main.cpp |
15 * |
15 * |
16 */ |
16 */ |
17 #include <hbapplication.h> |
17 #include <hbapplication.h> |
18 #include <hbstyleloader.h> |
18 #include <hbstyleloader.h> |
19 #include <QDir> |
19 #include <hbtranslator.h> |
20 #include <QTranslator> |
|
21 #include <QLocale> |
20 #include <QLocale> |
22 #include "cpservicemainwindow.h" |
21 #include "cpservicemainwindow.h" |
23 #include "cpsplogger.h" |
22 #include "cpsplogger.h" |
24 |
23 |
25 int main(int argc, char **argv) |
24 int main(int argc, char **argv) |
26 { |
25 { |
27 HbApplication app(argc,argv ); |
26 HbApplication app(argc,argv ); |
|
27 |
|
28 #ifdef ENABLE_CPSP_LOG |
|
29 INIT_LOGGER(CPSP_LOGGER_NAME,CPSP_LOGGER_CONFIG_PATH) |
|
30 #endif |
28 |
31 |
29 Logger::instance(CPSP_LOGGER_NAME)->configure( |
|
30 CPSP_LOGGER_CONFIG_PATH,QSettings::IniFormat); |
|
31 CPSP_LOG("Entering CpServiceProvider.exe..."); |
32 CPSP_LOG("Entering CpServiceProvider.exe..."); |
32 |
33 |
33 QTranslator translator; |
34 HbTranslator translator("control_panel"); |
34 if (translator.load("control_panel_" + QLocale::system().name(),"Z:/resource/qt/translations")) |
35 translator.loadCommon(); |
35 { |
|
36 qApp->installTranslator(&translator); |
|
37 } |
|
38 |
36 |
39 HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.css"); |
37 HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.css"); |
40 HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem_color.css"); |
38 HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem_color.css"); |
41 HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.widgetml"); |
39 HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.widgetml"); |
42 |
40 |
43 CpServiceMainWindow wnd; |
41 CpServiceMainWindow wnd; |
44 wnd.show(); |
42 /* |
|
43 DON'T call wnd.show(), |
|
44 it will cause deadlock problem if cpserviceprovider is launched from an indicator plugin. |
|
45 */ |
45 |
46 |
46 int ret = app.exec(); |
47 int ret = app.exec(); |
47 |
48 |
48 CPSP_LOG("Exiting CpServiceProvider.exe."); |
49 CPSP_LOG("Exiting CpServiceProvider.exe."); |
49 |
|
50 Logger::closeAll(); |
|
51 |
50 |
52 return ret; |
51 return ret; |
53 } |
52 } |
54 |
53 |
55 //End of File |
54 //End of File |