106 // ---------------------------------------------------------------------------- |
112 // ---------------------------------------------------------------------------- |
107 // |
113 // |
108 int SecUiNotificationDialog::deviceDialogError() const |
114 int SecUiNotificationDialog::deviceDialogError() const |
109 { |
115 { |
110 RDEBUG("mLastError", mLastError); |
116 RDEBUG("mLastError", mLastError); |
|
117 RDEBUG("mMyId", mMyId); |
111 return mLastError; |
118 return mLastError; |
112 } |
119 } |
113 |
120 |
114 // ---------------------------------------------------------------------------- |
121 // ---------------------------------------------------------------------------- |
115 // SecUiNotificationDialog::closeDeviceDialog |
122 // SecUiNotificationDialog::closeDeviceDialog |
116 // ---------------------------------------------------------------------------- |
123 // ---------------------------------------------------------------------------- |
117 // |
124 // |
118 void SecUiNotificationDialog::closeDeviceDialog(bool byClient) |
125 void SecUiNotificationDialog::closeDeviceDialog(bool byClient) |
119 { |
126 { |
120 Q_UNUSED(byClient); |
127 Q_UNUSED(byClient); |
121 RDEBUG("0", 0); |
128 RDEBUG("mMyId", mMyId); |
|
129 RDEBUG("calling close()", 0); |
122 close(); |
130 close(); |
123 RDEBUG("mShowEventReceived", mShowEventReceived); |
131 RDEBUG("mShowEventReceived", mShowEventReceived); |
124 |
132 |
125 // If show event has been received, close is signalled from hide event. |
133 // If show event has been received, close is signalled from hide event. |
126 // If not, hide event does not come and close is signalled from here. |
134 // If not, hide event does not come and close is signalled from here. |
127 if (!mShowEventReceived) { |
135 if (!mShowEventReceived) { |
|
136 RDEBUG("emitting deviceDialogClosed", 0); |
128 emit deviceDialogClosed(); |
137 emit deviceDialogClosed(); |
129 } |
138 if(1==0 && subscriberKSecurityUIsDismissDialog) |
|
139 { |
|
140 RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0); |
|
141 disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
142 RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1); |
|
143 if(1==1) |
|
144 { |
|
145 RDEBUG("deleting subscriberKSecurityUIsDismissDialog", 0); |
|
146 delete subscriberKSecurityUIsDismissDialog; |
|
147 subscriberKSecurityUIsDismissDialog = NULL; |
|
148 RDEBUG("deleted subscriberKSecurityUIsDismissDialog", 1); |
|
149 } |
|
150 } |
|
151 } |
|
152 RDEBUG("0", 0); |
130 } |
153 } |
131 |
154 |
132 // ---------------------------------------------------------------------------- |
155 // ---------------------------------------------------------------------------- |
133 // SecUiNotificationDialog::deviceDialogWidget |
156 // SecUiNotificationDialog::deviceDialogWidget |
134 // ---------------------------------------------------------------------------- |
157 // ---------------------------------------------------------------------------- |
144 // |
167 // |
145 void SecUiNotificationDialog::hideEvent(QHideEvent *event) |
168 void SecUiNotificationDialog::hideEvent(QHideEvent *event) |
146 { |
169 { |
147 RDEBUG("0", 0); |
170 RDEBUG("0", 0); |
148 HbDialog::hideEvent(event); |
171 HbDialog::hideEvent(event); |
149 RDEBUG("close", 0); |
172 RDEBUG("mMyId", mMyId); |
|
173 RDEBUG("calling close()", 0); |
150 close(); |
174 close(); |
151 RDEBUG("deviceDialogClosed", 0); |
175 RDEBUG("emitting deviceDialogClosed", 0); |
152 emit deviceDialogClosed(); |
176 emit deviceDialogClosed(); |
153 RDEBUG("deviceDialogClosed", 1); |
177 RDEBUG("deviceDialogClosed", 1); |
|
178 if(1==0 && subscriberKSecurityUIsDismissDialog) |
|
179 { |
|
180 RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0); |
|
181 disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
182 RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1); |
|
183 if(1==1) |
|
184 { |
|
185 RDEBUG("deleting subscriberKSecurityUIsDismissDialog", 0); |
|
186 delete subscriberKSecurityUIsDismissDialog; |
|
187 subscriberKSecurityUIsDismissDialog = NULL; |
|
188 RDEBUG("deleted subscriberKSecurityUIsDismissDialog", 1); |
|
189 } |
|
190 } |
154 // old method was emit deviceDialogClosed(); |
191 // old method was emit deviceDialogClosed(); |
|
192 RDEBUG("0", 0); |
155 } |
193 } |
156 |
194 |
157 // ---------------------------------------------------------------------------- |
195 // ---------------------------------------------------------------------------- |
158 // SecUiNotificationDialog::showEvent |
196 // SecUiNotificationDialog::showEvent |
159 // ---------------------------------------------------------------------------- |
197 // ---------------------------------------------------------------------------- |
160 // |
198 // |
161 void SecUiNotificationDialog::showEvent(QShowEvent *event) |
199 void SecUiNotificationDialog::showEvent(QShowEvent *event) |
162 { |
200 { |
163 RDEBUG("0", 0); |
201 RDEBUG("0", 0); |
|
202 RDEBUG("mMyId", mMyId); |
164 HbDialog::showEvent(event); |
203 HbDialog::showEvent(event); |
165 |
204 |
166 if(!(queryType & ESecUiTypeMaskLock)) |
205 if(!(queryType & ESecUiTypeMaskLock)) |
167 { // not for the "lock icon" |
206 { // not for the "lock icon" |
168 RDEBUG("check default.1", 0); |
207 RDEBUG("check default.1", 0); |
169 if(codeTop!=NULL) |
208 if(codeTop!=NULL) |
170 { |
209 { |
171 RDEBUG("check default.2", 0); |
210 RDEBUG("check default.2", 0); |
172 if(codeTop->text().length()>0) // there's a default value. Verify it and (might) enable OK |
211 if(codeTop->text().length()>0) // there's a default value. Verify it and (might) enable OK |
173 { |
212 { |
174 RDEBUG("check default.3", 0); |
213 RDEBUG("check default.3", 0); |
175 handleCodeTopChanged(codeTop->text()); |
214 handleCodeTopChanged(codeTop->text()); |
176 } |
215 } |
|
216 RDEBUG("setFocus", 0); |
|
217 codeTop->setFocus(); // this should open the VKB . Doesn't seem to work when it's done on the widget, so it's done here. |
|
218 |
|
219 } // codeTop!=NULL |
177 |
220 |
178 } |
|
179 const TUint32 KSecurityUIsTestCode = 0x00000307; |
221 const TUint32 KSecurityUIsTestCode = 0x00000307; |
180 TInt value = 0; |
222 TInt value = 0; |
181 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsTestCode, value ); |
223 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsTestCode, value ); |
182 RDEBUG("KSecurityUIsTestCode err", err); |
224 RDEBUG("KSecurityUIsTestCode err", err); |
183 RDEBUG("faking value", value); |
225 RDEBUG("faking value", value); |
|
226 RDEBUG("mShowEventReceived", mShowEventReceived); |
184 if(value>0 && mShowEventReceived==true) // show happens 2 times. Dialog can be closed only the second. |
227 if(value>0 && mShowEventReceived==true) // show happens 2 times. Dialog can be closed only the second. |
185 { |
228 { |
186 QString myString = ""; |
229 QString myString = ""; |
187 myString += QString("%1").arg(value); |
230 myString += QString("%1").arg(value); |
188 qDebug() << "SecUiNotificationDialog::faking myString=" << myString; |
231 qDebug() << "SecUiNotificationDialog::faking myString=" << myString; |
192 emit handleAccepted(); |
235 emit handleAccepted(); |
193 // handleAccepted already emit closeDeviceDialog(false); // false means "not by client", although it's not really used |
236 // handleAccepted already emit closeDeviceDialog(false); // false means "not by client", although it's not really used |
194 } |
237 } |
195 } |
238 } |
196 mShowEventReceived = true; |
239 mShowEventReceived = true; |
|
240 RDEBUG("1", 1); |
197 } |
241 } |
198 |
242 |
199 // ---------------------------------------------------------------------------- |
243 // ---------------------------------------------------------------------------- |
200 // SecUiNotificationDialog::constructDialog() |
244 // SecUiNotificationDialog::constructDialog() |
201 // ---------------------------------------------------------------------------- |
245 // ---------------------------------------------------------------------------- |
202 // |
246 // |
203 bool SecUiNotificationDialog::constructDialog(const QVariantMap ¶meters) |
247 bool SecUiNotificationDialog::constructDialog(const QVariantMap ¶meters) |
204 { |
248 { |
205 RDEBUG("0", 0); |
249 RDEBUG("0", 0); |
|
250 RDEBUG("mMyId", mMyId); |
206 setTimeout(HbPopup::NoTimeout); |
251 setTimeout(HbPopup::NoTimeout); |
207 setDismissPolicy(HbPopup::NoDismiss); |
252 setDismissPolicy(HbPopup::NoDismiss); |
208 setModal(true); |
253 setModal(true); |
209 mShowEventReceived = false; |
254 mShowEventReceived = false; |
|
255 subscriberKSecurityUIsDismissDialog = NULL; |
|
256 titleWidget = NULL; |
|
257 RDEBUG("subscriberKSecurityUIsDismissDialog NULL", 0); |
|
258 |
|
259 subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this); |
|
260 if(subscriberKSecurityUIsDismissDialog) |
|
261 { |
|
262 RDEBUG("subscriberKSecurityUIsDismissDialog created", 1); |
|
263 } |
|
264 else |
|
265 { |
|
266 RDEBUG("subscriberKSecurityUIsDismissDialog not created", 0); |
|
267 } |
|
268 connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
269 RDEBUG("subscriberKSecurityUIsDismissDialog", 1); |
210 |
270 |
211 // Title |
271 // Title |
|
272 // this is also done later in the widget |
|
273 // For now, it only says "Security" |
212 if (parameters.contains(KDialogTitle)) { |
274 if (parameters.contains(KDialogTitle)) { |
213 QString titleText = parameters.value(KDialogTitle).toString(); |
275 QString titleText = parameters.value(KDialogTitle).toString(); |
214 QString titleAttempts = ""; |
276 QString titleAttempts = ""; |
215 if(titleText.indexOf('|')>0) |
277 if(titleText.indexOf('|')>0) |
216 { // if separator, take only first part |
278 { // if separator, take only first part |
267 // nothing to do |
331 // nothing to do |
268 } |
332 } |
269 if(invalidNumber==EDeviceLockAutolockperiod) |
333 if(invalidNumber==EDeviceLockAutolockperiod) |
270 { |
334 { |
271 RDEBUG("EDeviceLockAutolockperiod", invalidNumber ); |
335 RDEBUG("EDeviceLockAutolockperiod", invalidNumber ); |
272 title->setPlainText("EDeviceLockAutolockperiod"); |
336 newTitleText+="EDeviceLockAutolockperiod"; |
273 } |
337 } |
274 if(invalidNumber==EDeviceLockMaxAutolockPeriod) |
338 if(invalidNumber==EDeviceLockMaxAutolockPeriod) |
275 { |
339 { |
276 RDEBUG("EDeviceLockAutolockperiod", invalidNumber ); |
340 RDEBUG("EDeviceLockAutolockperiod", invalidNumber ); |
277 title->setPlainText("EDeviceLockMaxAutolockPeriod"); |
341 newTitleText+="EDeviceLockMaxAutolockPeriod"; |
278 } |
342 } |
279 if(invalidNumber==EDeviceLockMinlength) |
343 if(invalidNumber==EDeviceLockMinlength) |
280 { |
344 { |
281 RDEBUG("EDeviceLockMinlength", invalidNumber ); |
345 RDEBUG("EDeviceLockMinlength", invalidNumber ); |
282 title->setPlainText("EDeviceLockMinlength"); |
346 newTitleText+="EDeviceLockMinlength"; |
283 } |
347 } |
284 if(invalidNumber==EDeviceLockMaxlength) |
348 if(invalidNumber==EDeviceLockMaxlength) |
285 { |
349 { |
286 RDEBUG("EDeviceLockMaxlength", invalidNumber ); |
350 RDEBUG("EDeviceLockMaxlength", invalidNumber ); |
287 title->setPlainText("EDeviceLockMaxlength"); |
351 newTitleText+="EDeviceLockMaxlength"; |
288 } |
352 } |
289 if(invalidNumber==EDeviceLockRequireUpperAndLower) |
353 if(invalidNumber==EDeviceLockRequireUpperAndLower) |
290 { |
354 { |
291 RDEBUG("EDeviceLockRequireUpperAndLower", invalidNumber ); |
355 RDEBUG("EDeviceLockRequireUpperAndLower", invalidNumber ); |
292 title->setPlainText("EDeviceLockRequireUpperAndLower"); |
356 newTitleText+="EDeviceLockRequireUpperAndLower"; |
293 } |
357 } |
294 if(invalidNumber==EDeviceLockRequireCharsAndNumbers) |
358 if(invalidNumber==EDeviceLockRequireCharsAndNumbers) |
295 { |
359 { |
296 RDEBUG("EDeviceLockMaxlength", invalidNumber ); |
360 RDEBUG("EDeviceLockMaxlength", invalidNumber ); |
297 title->setPlainText("EDeviceLockMaxlength"); |
361 newTitleText+="EDeviceLockMaxlength"; |
298 } |
362 } |
299 if(invalidNumber==EDeviceLockAllowedMaxRepeatedChars) |
363 if(invalidNumber==EDeviceLockAllowedMaxRepeatedChars) |
300 { |
364 { |
301 RDEBUG("EDeviceLockAllowedMaxRepeatedChars", invalidNumber ); |
365 RDEBUG("EDeviceLockAllowedMaxRepeatedChars", invalidNumber ); |
302 title->setPlainText("EDeviceLockAllowedMaxRepeatedChars"); |
366 newTitleText+="EDeviceLockAllowedMaxRepeatedChars"; |
303 } |
367 } |
304 if(invalidNumber==EDeviceLockHistoryBuffer) |
368 if(invalidNumber==EDeviceLockHistoryBuffer) |
305 { |
369 { |
306 RDEBUG("EDeviceLockHistoryBuffer", invalidNumber ); |
370 RDEBUG("EDeviceLockHistoryBuffer", invalidNumber ); |
307 title->setPlainText("EDeviceLockHistoryBuffer"); |
371 newTitleText+="EDeviceLockHistoryBuffer"; |
308 } |
372 } |
309 if(invalidNumber==EDeviceLockPasscodeExpiration) |
373 if(invalidNumber==EDeviceLockPasscodeExpiration) |
310 { |
374 { |
311 RDEBUG("EDeviceLockPasscodeExpiration", invalidNumber ); |
375 RDEBUG("EDeviceLockPasscodeExpiration", invalidNumber ); |
312 title->setPlainText("EDeviceLockPasscodeExpiration"); |
376 newTitleText+="EDeviceLockPasscodeExpiration"; |
313 } |
377 } |
314 if(invalidNumber==EDeviceLockMinChangeTolerance) |
378 if(invalidNumber==EDeviceLockMinChangeTolerance) |
315 { |
379 { |
316 RDEBUG("EDeviceLockMinChangeTolerance", invalidNumber ); |
380 RDEBUG("EDeviceLockMinChangeTolerance", invalidNumber ); |
317 title->setPlainText("EDeviceLockMinChangeTolerance"); |
381 newTitleText+="EDeviceLockMinChangeTolerance"; |
318 } |
382 } |
319 if(invalidNumber==EDeviceLockMinChangeInterval) |
383 if(invalidNumber==EDeviceLockMinChangeInterval) |
320 { |
384 { |
321 RDEBUG("EDeviceLockMinChangeInterval", invalidNumber ); |
385 RDEBUG("EDeviceLockMinChangeInterval", invalidNumber ); |
322 title->setPlainText("EDeviceLockMinChangeInterval"); |
386 newTitleText+="EDeviceLockMinChangeInterval"; |
323 } |
387 } |
324 if(invalidNumber==EDeviceLockDisallowSpecificStrings) |
388 if(invalidNumber==EDeviceLockDisallowSpecificStrings) |
325 { |
389 { |
326 RDEBUG("EDeviceLockDisallowSpecificStrings", invalidNumber ); |
390 RDEBUG("EDeviceLockDisallowSpecificStrings", invalidNumber ); |
327 title->setPlainText("EDeviceLockDisallowSpecificStrings"); |
391 newTitleText+="EDeviceLockDisallowSpecificStrings"; |
328 } |
392 } |
329 if(invalidNumber==EDeviceLockAllowedMaxAtempts) |
393 if(invalidNumber==EDeviceLockAllowedMaxAtempts) |
330 { |
394 { |
331 RDEBUG("EDeviceLockAllowedMaxAtempts", invalidNumber ); |
395 RDEBUG("EDeviceLockAllowedMaxAtempts", invalidNumber ); |
332 title->setPlainText("EDeviceLockAllowedMaxAtempts"); |
396 newTitleText+="EDeviceLockAllowedMaxAtempts"; |
333 } |
397 } |
334 if(invalidNumber==EDeviceLockConsecutiveNumbers) |
398 if(invalidNumber==EDeviceLockConsecutiveNumbers) |
335 { |
399 { |
336 RDEBUG("EDeviceLockConsecutiveNumbers", invalidNumber ); |
400 RDEBUG("EDeviceLockConsecutiveNumbers", invalidNumber ); |
337 title->setPlainText("EDeviceLockConsecutiveNumbers"); |
401 newTitleText+="EDeviceLockConsecutiveNumbers"; |
338 } |
402 } |
339 if(invalidNumber==EDeviceLockMinSpecialCharacters) |
403 if(invalidNumber==EDeviceLockMinSpecialCharacters) |
340 { |
404 { |
341 RDEBUG("EDeviceLockMinSpecialCharacters", invalidNumber ); |
405 RDEBUG("EDeviceLockMinSpecialCharacters", invalidNumber ); |
342 title->setPlainText("EDeviceLockMinSpecialCharacters"); |
406 newTitleText+="EDeviceLockMinSpecialCharacters"; |
343 } |
407 } |
344 if(invalidNumber==EDeviceLockSingleCharRepeatNotAllowed) |
408 if(invalidNumber==EDeviceLockSingleCharRepeatNotAllowed) |
345 { |
409 { |
346 RDEBUG("EDeviceLockSingleCharRepeatNotAllowed", invalidNumber ); |
410 RDEBUG("EDeviceLockSingleCharRepeatNotAllowed", invalidNumber ); |
347 title->setPlainText("EDeviceLockSingleCharRepeatNotAllowed"); |
411 newTitleText+="EDeviceLockSingleCharRepeatNotAllowed"; |
348 } |
412 } |
349 if(invalidNumber==EDevicelockConsecutiveCharsNotAllowed) |
413 if(invalidNumber==EDevicelockConsecutiveCharsNotAllowed) |
350 { |
414 { |
351 RDEBUG("EDevicelockConsecutiveCharsNotAllowed", invalidNumber ); |
415 RDEBUG("EDevicelockConsecutiveCharsNotAllowed", invalidNumber ); |
352 title->setPlainText("EDevicelockConsecutiveCharsNotAllowed"); |
416 newTitleText+="EDevicelockConsecutiveCharsNotAllowed"; |
353 } |
417 } |
354 if(invalidNumber>=EDevicelockTotalPolicies) |
418 if(invalidNumber>=EDevicelockTotalPolicies) |
355 { |
419 { |
356 RDEBUG("EDevicelockTotalPolicies", invalidNumber ); |
420 RDEBUG("EDevicelockTotalPolicies", invalidNumber ); |
357 title->setPlainText("EDevicelockTotalPolicies"); |
421 newTitleText+="EDevicelockTotalPolicies"; |
358 } |
422 } |
|
423 if( !titleWidget ) |
|
424 { |
|
425 RDEBUG("creating titleWidget", 0 ); |
|
426 titleWidget = new HbLabel("New lock code"); // it will be changed later |
|
427 setHeadingWidget(titleWidget); |
|
428 } |
|
429 RDEBUG("setPlainText", 0 ); |
|
430 titleWidget->setPlainText(newTitleText); |
|
431 |
359 if(invalidNumber<0) // everything is ok |
432 if(invalidNumber<0) // everything is ok |
360 { |
433 { |
361 okAction->setEnabled(true); // TODO check this : invalid -> valid. This allows verif ? |
434 okAction->setEnabled(true); // this might fail in the scenario: check this : invalid -> valid. This allows verif ? |
362 okAction->setText("Ok"); |
435 okAction->setText("Ok"); |
363 codeBottom->setEnabled(true); |
436 codeBottom->setEnabled(true); |
364 } |
437 } |
365 else |
438 else |
366 { |
439 { |
439 RDEBUG("aDismissDialog", aDismissDialog); |
512 RDEBUG("aDismissDialog", aDismissDialog); |
440 if(aDismissDialog==ESecurityUIsDismissDialogOn || aDismissDialog==ESecurityUIsDismissDialogProcessing) |
513 if(aDismissDialog==ESecurityUIsDismissDialogOn || aDismissDialog==ESecurityUIsDismissDialogProcessing) |
441 { |
514 { |
442 RDebug::Printf( "potential error: %s %s (%u) aDismissDialog=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aDismissDialog ); |
515 RDebug::Printf( "potential error: %s %s (%u) aDismissDialog=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aDismissDialog ); |
443 } |
516 } |
444 subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber( |
|
445 "/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this); |
|
446 connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, |
|
447 SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
448 RDEBUG("subscriberKSecurityUIsDismissDialog", 1); |
|
449 |
517 |
450 RDEBUG("check cancel", 0); |
518 RDEBUG("check cancel", 0); |
451 if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported) |
519 if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported) |
452 { |
520 { |
453 // nothing to do. Cancel is enabled by default |
521 // nothing to do. Cancel is enabled by default |
454 } |
522 } |
455 else |
523 else |
456 { |
524 { |
457 RDEBUG("disable Cancel", 1); |
525 RDEBUG("disable Cancel", 1); |
458 cancelAction->setEnabled(false); |
526 cancelAction->setEnabled(false); |
|
527 cancelAction->setText(""); |
|
528 cancelAction->setVisible(false); |
459 } |
529 } |
460 |
530 |
461 return true; |
531 return true; |
462 } |
532 } |
463 |
533 |
466 // ---------------------------------------------------------------------------- |
536 // ---------------------------------------------------------------------------- |
467 // |
537 // |
468 void SecUiNotificationDialog::sendResult(int accepted) |
538 void SecUiNotificationDialog::sendResult(int accepted) |
469 { |
539 { |
470 RDEBUG("0", 0); |
540 RDEBUG("0", 0); |
|
541 RDEBUG("mMyId", mMyId); |
471 QVariant acceptedValue(accepted); |
542 QVariant acceptedValue(accepted); |
472 RDEBUG("0", 0); |
543 RDEBUG("0", 0); |
473 mResultMap.insert(KResultAccepted, acceptedValue); |
544 mResultMap.insert(KResultAccepted, acceptedValue); |
474 RDEBUG("0", 0); |
545 RDEBUG("0", 0); |
475 qDebug() << mResultMap; |
546 qDebug() << mResultMap; |
476 emit deviceDialogData(mResultMap); |
547 RDEBUG("queryType", queryType); |
477 RDEBUG("0", 0); |
548 if(!(queryType & ESecUiTypeMaskLock)) |
|
549 { // the lock-icon should not reply |
|
550 RDEBUG("emit deviceDialogData", 0); |
|
551 emit deviceDialogData(mResultMap); |
|
552 } |
|
553 RDEBUG("1", 1); |
478 } |
554 } |
479 |
555 |
480 // ---------------------------------------------------------------------------- |
556 // ---------------------------------------------------------------------------- |
481 // SecUiNotificationDialog::handleAccepted() |
557 // SecUiNotificationDialog::handleAccepted() |
482 // ---------------------------------------------------------------------------- |
558 // ---------------------------------------------------------------------------- |
483 // |
559 // |
484 void SecUiNotificationDialog::handleAccepted() |
560 void SecUiNotificationDialog::handleAccepted() |
485 { |
561 { |
486 RDEBUG("0", 0); |
562 RDEBUG("0", 0); |
487 // okAction |
563 // okAction |
|
564 RDEBUG("mMyId", mMyId); |
488 QString codeTopText=""; |
565 QString codeTopText=""; |
489 |
566 |
490 if( (queryType & ESecUiTypeMaskLock)) |
567 if( (queryType & ESecUiTypeMaskLock)) |
491 { |
568 { |
492 codeTopText = "Unlock-Request"; |
569 codeTopText = "Unlock-Request"; |
509 } |
586 } |
510 mResultMap.insert(KCodeTopIndex, codeTopText); |
587 mResultMap.insert(KCodeTopIndex, codeTopText); |
511 } |
588 } |
512 else |
589 else |
513 codeTopText = codeTop->text(); |
590 codeTopText = codeTop->text(); |
514 // TODO check last time for codeBottom |
591 // no need to check last time for codeBottom |
515 qDebug() << "codeTopText=" << codeTopText; |
592 qDebug() << "codeTopText=" << codeTopText; |
516 sendResult(KErrNone); |
593 sendResult(KErrNone); |
|
594 RDEBUG("calling close()", 0); |
517 close(); // this is needed because Cancel doesn't automatically closes the dialog |
595 close(); // this is needed because Cancel doesn't automatically closes the dialog |
518 RDEBUG("close", 0); |
596 RDEBUG("emitting deviceDialogClosed", 0); |
519 emit deviceDialogClosed(); |
597 emit deviceDialogClosed(); |
520 } |
598 } |
521 |
599 |
522 // ---------------------------------------------------------------------------- |
600 // ---------------------------------------------------------------------------- |
523 // SecUiNotificationDialog::handleCancelled() |
601 // SecUiNotificationDialog::handleCancelled() |
524 // ---------------------------------------------------------------------------- |
602 // ---------------------------------------------------------------------------- |
525 // |
603 // |
526 void SecUiNotificationDialog::handleCancelled() |
604 void SecUiNotificationDialog::handleCancelled() |
527 { |
605 { |
528 RDEBUG("0", 0); |
606 RDEBUG("0", 0); |
|
607 RDEBUG("mMyId", mMyId); |
529 sendResult(KErrCancel); |
608 sendResult(KErrCancel); |
|
609 RDEBUG("callingclose()", 0); |
530 close(); // this is needed because Cancel doesn't automatically closes the dialog |
610 close(); // this is needed because Cancel doesn't automatically closes the dialog |
531 RDEBUG("close", 0); |
611 RDEBUG("emitting deviceDialogClosed", 0); |
532 emit deviceDialogClosed(); |
612 emit deviceDialogClosed(); |
533 } |
613 } |
534 |
614 |
535 // ---------------------------------------------------------------------------- |
615 // ---------------------------------------------------------------------------- |
536 // SecUiNotificationDialog::handleMemorySelectionChanged() |
616 // SecUiNotificationDialog::handleMemorySelectionChanged() |
537 // ---------------------------------------------------------------------------- |
617 // ---------------------------------------------------------------------------- |
538 // |
618 // |
539 void SecUiNotificationDialog::handleMemorySelectionChanged(const QString &text) |
619 void SecUiNotificationDialog::handleMemorySelectionChanged(const QString &text) |
540 { |
620 { |
541 RDEBUG("0", 0); |
621 RDEBUG("0", 0); |
542 qDebug() << text; |
622 RDEBUG("mMyId", mMyId); |
|
623 qDebug() << text; |
543 QVariant memorySelection(text); |
624 QVariant memorySelection(text); |
544 mResultMap.insert(KSelectedMemoryIndex, memorySelection); |
625 mResultMap.insert(KSelectedMemoryIndex, memorySelection); |
545 //TODO: do we need emit here, or would it be better to send all data at the end? |
|
546 //emit deviceDialogData(mResultMap); |
|
547 } |
626 } |
548 |
627 |
549 void SecUiNotificationDialog::handleCodeTopContentChanged() |
628 void SecUiNotificationDialog::handleCodeTopContentChanged() |
550 { |
629 { |
551 RDEBUG("0", 0); |
630 RDEBUG("0", 0); |
|
631 RDEBUG("mMyId", mMyId); |
552 qDebug() << codeTop->text(); |
632 qDebug() << codeTop->text(); |
553 handleCodeTopChanged(codeTop->text()); |
633 handleCodeTopChanged(codeTop->text()); |
554 } |
634 } |
555 |
635 |
556 // ---------------------------------------------------------------------------- |
636 // ---------------------------------------------------------------------------- |
647 qDebug() << codeTopText; |
727 qDebug() << codeTopText; |
648 codeTopText = codeTopText + "1" ; |
728 codeTopText = codeTopText + "1" ; |
649 qDebug() << "codeTopText+1"; |
729 qDebug() << "codeTopText+1"; |
650 qDebug() << codeTopText; |
730 qDebug() << codeTopText; |
651 codeTop->setText(codeTopText); |
731 codeTop->setText(codeTopText); |
|
732 |
|
733 RDEBUG("editorInterface", 0); |
|
734 HbEditorInterface editorInterface(codeTop); |
|
735 RDEBUG("actions", 0); |
|
736 QList<HbAction *> vkbList = editorInterface.actions(); |
|
737 RDEBUG("count", 0); |
|
738 int count = vkbList.count(); |
|
739 RDEBUG("got count", count); |
|
740 for (int i = 0; i < count; i++) |
|
741 { |
|
742 RDEBUG("i", i); |
|
743 HbAction *action = static_cast<HbAction *>(vkbList[i]); |
|
744 RDEBUG("action", 0); |
|
745 } |
|
746 |
|
747 RDEBUG("okVKBAction", 0); |
|
748 okVKBAction = new HbAction(tr("Ok")); |
|
749 RDEBUG("addAction", 0); |
|
750 editorInterface.addAction(okVKBAction); |
|
751 RDEBUG("addAction", 1); |
|
752 connect(okVKBAction, SIGNAL(triggered()), this, SLOT(handleAccepted())); |
|
753 RDEBUG("connect", 1); |
|
754 |
|
755 QList<HbAction *> vkbList2 = editorInterface.actions(); |
|
756 RDEBUG("count", 0); |
|
757 int count2 = vkbList2.count(); |
|
758 RDEBUG("got count2", count2); |
|
759 for (int i = 0; i < count2; i++) |
|
760 { |
|
761 RDEBUG("i", i); |
|
762 HbAction *action2 = static_cast<HbAction *>(vkbList2[i]); |
|
763 RDEBUG("action2", 0); |
|
764 } |
|
765 |
652 } |
766 } |
653 // ---------------------------------------------------------------------------- |
767 // ---------------------------------------------------------------------------- |
654 // SecUiNotificationDialog::handlebut3Changed() |
768 // SecUiNotificationDialog::handlebut3Changed() |
655 // ---------------------------------------------------------------------------- |
769 // ---------------------------------------------------------------------------- |
656 // |
770 // |
677 } |
791 } |
678 |
792 |
679 // ---------------------------------------------------------------------------- |
793 // ---------------------------------------------------------------------------- |
680 // SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged() |
794 // SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged() |
681 // A way for Autolock to dismiss any possible PIN dialog |
795 // A way for Autolock to dismiss any possible PIN dialog |
|
796 // This doesn't dismiss the lockIcon because P&S is not connected |
|
797 // Note: if this changes itself, then it becomes recursive |
682 // ---------------------------------------------------------------------------- |
798 // ---------------------------------------------------------------------------- |
683 // |
799 // |
684 void SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged() |
800 void SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged() |
685 { |
801 { |
686 |
802 |
687 RDEBUG("0", 0); |
803 RDEBUG("0", 0); |
|
804 RDEBUG("mMyId", mMyId); |
688 TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized; |
805 TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized; |
689 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog ); |
806 TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog ); |
690 RDEBUG("err", err); |
807 RDEBUG("err", err); |
691 RDEBUG("aDismissDialog", aDismissDialog); |
808 RDEBUG("aDismissDialog", aDismissDialog); |
692 if( aDismissDialog == ESecurityUIsDismissDialogOn ) |
809 if( aDismissDialog == ESecurityUIsDismissDialogOn ) |
693 { |
810 { |
694 err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogProcessing ); |
811 if(subscriberKSecurityUIsDismissDialog) |
695 RDEBUG("err", err); |
812 { |
696 // TODO perhaps do this only if Cancel is allowed? |
813 RDEBUG("subscriberKSecurityUIsDismissDialog", 1); |
697 RDEBUG("sendResult(KErrCancel)", KErrCancel); // another option is KErrDied |
814 } |
698 sendResult(KErrCancel); // similar to emit handleCancelled(); |
815 else |
699 RDEBUG("close", 0); |
816 { |
700 close(); |
817 RDEBUG("! subscriberKSecurityUIsDismissDialog", 0); |
701 RDEBUG("emit closeDeviceDialog", 0); |
818 } |
702 emit deviceDialogClosed(); |
819 |
703 // RDEBUG("emit closeDeviceDialog", 0); |
820 if(this) |
704 // this is old method emit closeDeviceDialog(false); // false means "not by client", although it's not really used |
821 { |
705 RDEBUG("all emited", 0); |
822 RDEBUG("this", 1); |
706 err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogDone ); // clear after using it |
823 } |
707 RDEBUG("err", err); |
824 else |
708 } |
825 { |
|
826 RDEBUG("! this", 0); |
|
827 } |
|
828 |
|
829 |
|
830 RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0); |
|
831 disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
832 // this doesn't really disconnect, because somehow the events are still queued. This is a QtMobility error |
|
833 RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1); |
|
834 |
|
835 RDEBUG("not set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogProcessing); |
|
836 // can't set it because it does recursion |
|
837 // err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogProcessing ); |
|
838 RDEBUG("err", err); |
|
839 // only if Cancel is allowed |
|
840 if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported) |
|
841 { |
|
842 RDEBUG("sendResult(KErrCancel)", KErrCancel); // another option is KErrDied |
|
843 sendResult(KErrCancel); // similar to emit handleCancelled(); |
|
844 RDEBUG("calling close()", 0); |
|
845 err = close(); |
|
846 RDEBUG("err", err); |
|
847 RDEBUG("emitting deviceDialogClosed", 0); |
|
848 emit deviceDialogClosed(); |
|
849 // RDEBUG("emit closeDeviceDialog", 0); |
|
850 // this is old method emit closeDeviceDialog(false); // false means "not by client", although it's not really used |
|
851 RDEBUG("all emited", 0); |
|
852 } |
|
853 RDEBUG("not set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogDone); |
|
854 // can't set it because it does recursion |
|
855 // err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogDone ); // clear after using it |
|
856 RDEBUG("err", err); |
|
857 |
|
858 RDEBUG("reconnect subscriberKSecurityUIsDismissDialog", 0); |
|
859 connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged())); |
|
860 RDEBUG("reconnected subscriberKSecurityUIsDismissDialog", 1); |
|
861 } |
|
862 RDEBUG("1", 1); |
709 } |
863 } |