equal
deleted
inserted
replaced
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <QtPlugin> |
18 #include <QtPlugin> |
19 #include <QTranslator> |
19 #include <HbTranslator> |
20 #include <QLocale> |
20 #include <QLocale> |
21 #include <QList> |
21 #include <QList> |
22 #include <HbLabel> |
22 #include <HbLabel> |
23 #include <HbDialog> |
23 #include <HbDialog> |
24 #include <HbDocumentLoader> |
24 #include <HbDocumentLoader> |
92 OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_ENTRY ); |
92 OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_ENTRY ); |
93 |
93 |
94 Q_UNUSED(indicatorType) |
94 Q_UNUSED(indicatorType) |
95 |
95 |
96 // Install localization |
96 // Install localization |
97 QTranslator *translator = new QTranslator(this); |
97 HbTranslator *translator(new HbTranslator("cellularindicatorplugin")); |
98 |
|
99 QString lang = QLocale::system().name(); |
|
100 QString path = "Z:/resource/qt/translations/"; |
|
101 translator->load("cellularindicatorplugin_" + lang, path); |
|
102 qApp->installTranslator(translator); |
|
103 |
98 |
104 OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_EXIT ); |
99 OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_EXIT ); |
105 return this; |
100 return this; |
106 } |
101 } |
107 |
102 |
154 { |
149 { |
155 OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_HANDLEINTERACTION_ENTRY ); |
150 OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_HANDLEINTERACTION_ENTRY ); |
156 |
151 |
157 Q_UNUSED(type) |
152 Q_UNUSED(type) |
158 bool handled = false; |
153 bool handled = false; |
|
154 QVariantMap data; |
159 |
155 |
160 switch(type) { |
156 switch(type) { |
161 case InteractionActivated: |
157 case InteractionActivated: |
162 //connect error() to slot processError() to get error, |
158 // Emit a signal that will inform the client to start the connectionview client |
163 QObject::connect( &process, SIGNAL(error(QProcess::ProcessError)), |
159 emit userActivated(data); |
164 this, SLOT(processError(QProcess::ProcessError))); |
160 |
165 |
|
166 // Show connection view |
|
167 process.start("connview"); |
|
168 handled = true; |
161 handled = true; |
169 break; |
162 break; |
170 |
163 |
171 default: |
164 default: |
172 break; |
165 break; |
226 |
219 |
227 OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_INDICATORDATA_EXIT ); |
220 OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_INDICATORDATA_EXIT ); |
228 return ret; |
221 return ret; |
229 } |
222 } |
230 |
223 |
231 /*! |
|
232 The processError is a handler for error codes. |
|
233 */ |
|
234 void CellularIndicatorPlugin::processError(QProcess::ProcessError err) |
|
235 { |
|
236 OstTraceFunctionEntry1(CELLULARINDICATORPLUGIN_PROCESSERROR_ENTRY, this); |
|
237 |
|
238 switch (err) { |
|
239 case QProcess::FailedToStart: |
|
240 case QProcess::Crashed: |
|
241 case QProcess::Timedout: |
|
242 case QProcess::ReadError: |
|
243 case QProcess::WriteError: |
|
244 case QProcess::UnknownError: |
|
245 OstTrace1( CELLULARINDICATORPLUGIN_ERR,PROCESSERROR_KNOWN,"Process Error %u", err); |
|
246 break; |
|
247 default: |
|
248 OstTrace1( CELLULARINDICATORPLUGIN_ERR,PROCESSERROR_UNKNOWN,"Unknown Process Error %u", err); |
|
249 break; |
|
250 } |
|
251 OstTraceFunctionExit1(CELLULARINDICATORPLUGIN_PROCESSERROR_EXIT, this); |
|
252 } |
|
253 |
|