16 */ |
16 */ |
17 //USER |
17 //USER |
18 #include "logsservicehandler.h" |
18 #include "logsservicehandler.h" |
19 #include "logslogger.h" |
19 #include "logslogger.h" |
20 #include "logsdefs.h" |
20 #include "logsdefs.h" |
21 #include "logsmainwindow.h" |
|
22 #include <xqserviceutil.h> |
21 #include <xqserviceutil.h> |
23 |
22 |
24 //SYSTEM |
23 //SYSTEM |
25 |
24 |
26 // ----------------------------------------------------------------------------- |
25 // ----------------------------------------------------------------------------- |
27 // LogsServiceHandler::LogsServiceHandler |
26 // LogsServiceHandler::LogsServiceHandler |
28 // ----------------------------------------------------------------------------- |
27 // ----------------------------------------------------------------------------- |
29 // |
28 // |
30 LogsServiceHandler::LogsServiceHandler(LogsMainWindow& mainWindow) |
29 LogsServiceHandler::LogsServiceHandler() |
31 : XQServiceProvider(QLatin1String("logs.com.nokia.symbian.ILogsView"),0), |
30 : XQServiceProvider(QLatin1String("logs.com.nokia.symbian.ILogsView"),0) |
32 mMainWindow(mainWindow) |
|
33 { |
31 { |
34 LOGS_QDEBUG( "logs [UI] -> LogsServiceHandler::LogsServiceHandler(), ILogsView" ) |
32 LOGS_QDEBUG( "logs [UI] -> LogsServiceHandler::LogsServiceHandler(), ILogsView" ) |
35 |
33 |
36 publishAll(); |
34 publishAll(); |
37 mIsAppStartedUsingService = XQServiceUtil::isService(); |
35 mIsAppStartedUsingService = XQServiceUtil::isService(); |
61 QVariant((int)LogsServices::ViewAll)).toInt(); |
59 QVariant((int)LogsServices::ViewAll)).toInt(); |
62 bool showDialpad = params.value(logsShowDialpadParam, |
60 bool showDialpad = params.value(logsShowDialpadParam, |
63 QVariant(false)).toBool(); |
61 QVariant(false)).toBool(); |
64 QString dialpadText = params.value(logsDialpadTextParam, |
62 QString dialpadText = params.value(logsDialpadTextParam, |
65 QVariant(QString())).toString(); |
63 QVariant(QString())).toString(); |
66 |
64 |
67 LOGS_QDEBUG_2( "logs [UI] activatedView:", activatedView ) |
65 LOGS_QDEBUG_2( "logs [UI] activatedView:", activatedView ) |
68 LOGS_QDEBUG_2( "logs [UI] showDialpad:", showDialpad ) |
66 LOGS_QDEBUG_2( "logs [UI] showDialpad:", showDialpad ) |
69 LOGS_QDEBUG_2( "logs [UI] dialpadText:", dialpadText ) |
67 LOGS_QDEBUG_2( "logs [UI] dialpadText:", dialpadText ) |
|
68 |
|
69 if (params.contains(logsViewIndexParamNew)) { |
|
70 activatedView = params.value(logsViewIndexParamNew).toInt(); |
|
71 LOGS_QDEBUG_2( "logs [UI] new activatedView:", activatedView ) |
|
72 } |
|
73 if (params.contains(logsShowDialpadParamNew)) { |
|
74 showDialpad = params.value(logsShowDialpadParamNew).toBool(); |
|
75 LOGS_QDEBUG_2( "logs [UI] new showDialpad:", showDialpad ) |
|
76 } |
|
77 if (params.contains(logsDialpadTextParamNew)) { |
|
78 dialpadText = params.value(logsDialpadTextParamNew).toString(); |
|
79 LOGS_QDEBUG_2( "logs [UI] new dialpadText:", dialpadText ) |
|
80 } |
70 |
81 |
71 if ( activatedView < LogsServices::ViewAll || |
82 if ( activatedView < LogsServices::ViewAll || |
72 activatedView > LogsServices::ViewMissed ){ |
83 activatedView > LogsServices::ViewMissed ){ |
73 LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::show(), incorrect view" ) |
84 LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::show(), incorrect view" ) |
74 return -1; |
85 return -1; |
75 } |
86 } |
76 |
87 |
77 mIsAppStartedUsingService = true; |
88 mIsAppStartedUsingService = true; |
78 |
|
79 LOGS_QDEBUG( "logs [UI] Bring app to foreground" ) |
|
80 mMainWindow.bringAppToForeground(); |
|
81 |
89 |
82 if (!dialpadText.isEmpty()) { |
90 if (!dialpadText.isEmpty()) { |
83 emit activateView(dialpadText); |
91 emit activateView(dialpadText); |
84 } else { |
92 } else { |
85 emit activateView((LogsServices::LogsView)activatedView, showDialpad, dialpadText); |
93 emit activateView((LogsServices::LogsView)activatedView, showDialpad, dialpadText); |