176 mDialog->setAttribute( Qt::WA_DeleteOnClose, true ); |
188 mDialog->setAttribute( Qt::WA_DeleteOnClose, true ); |
177 mDialog->close(); |
189 mDialog->close(); |
178 // Remove the pointer from QScopedPointer to prevent double deallocation |
190 // Remove the pointer from QScopedPointer to prevent double deallocation |
179 mDialog.take(); |
191 mDialog.take(); |
180 |
192 |
181 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_DWLANWIZARDPRIVATE_DONE, |
193 OstTrace1( |
|
194 TRACE_BORDER, |
|
195 WLANWIZARDPRIVATE_DWLANWIZARDPRIVATE_DONE, |
182 "WlanWizardPrivate::~WlanWizardPrivate-Done;this=%x", |
196 "WlanWizardPrivate::~WlanWizardPrivate-Done;this=%x", |
183 this ); |
197 this); |
184 OstTraceFunctionExit0( DUP1_WLANWIZARDPRIVATE_WLANWIZARDPRIVATE_EXIT ); |
198 |
|
199 OstTraceFunctionExit0(DUP1_WLANWIZARDPRIVATE_WLANWIZARDPRIVATE_EXIT); |
185 } |
200 } |
186 |
201 |
187 /*! |
202 /*! |
188 See WlanWizard::setParameters(). |
203 See WlanWizard::setParameters(). |
189 */ |
204 */ |
190 void WlanWizardPrivate::setParameters( |
205 void WlanWizardPrivate::setParameters( |
191 const QString &ssid, |
206 const QString &ssid, |
192 int networkMode, |
207 int networkMode, |
193 int securityMode, |
208 int securityMode, |
194 bool usePsk, |
209 bool usePsk, |
195 bool hidden, |
|
196 bool wps) |
210 bool wps) |
197 { |
211 { |
198 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SETPARAMETERS_ENTRY ); |
212 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_SETPARAMETERS_ENTRY); |
199 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_SETPARAMETERS, |
213 |
|
214 OstTrace1( |
|
215 TRACE_BORDER, |
|
216 WLANWIZARDPRIVATE_SETPARAMETERS, |
200 "WlanWizardPrivate::setParameters;this=%x", |
217 "WlanWizardPrivate::setParameters;this=%x", |
201 this ); |
218 this); |
202 |
219 |
203 mFirstPageId = getNextPageId( |
220 mFirstPageId = getNextPageId( |
204 ssid, networkMode, securityMode, usePsk, hidden, wps); |
221 ssid, |
205 |
222 networkMode, |
206 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_SETPARAMETERS_DONE, |
223 securityMode, |
|
224 usePsk, |
|
225 false, |
|
226 wps); |
|
227 |
|
228 OstTrace1( |
|
229 TRACE_BORDER, |
|
230 WLANWIZARDPRIVATE_SETPARAMETERS_DONE, |
207 "WlanWizardPrivate::setParameters - Done;this=%x", |
231 "WlanWizardPrivate::setParameters - Done;this=%x", |
208 this ); |
232 this); |
209 OstTraceFunctionExit0( WLANWIZARDPRIVATE_SETPARAMETERS_EXIT ); |
233 |
|
234 OstTraceFunctionExit0(WLANWIZARDPRIVATE_SETPARAMETERS_EXIT); |
210 } |
235 } |
211 |
236 |
212 /*! |
237 /*! |
213 See WlanWizard::show(). |
238 See WlanWizard::show(). |
214 */ |
239 */ |
215 void WlanWizardPrivate::show() |
240 void WlanWizardPrivate::show() |
216 { |
241 { |
217 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SHOW_ENTRY ); |
242 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_SHOW_ENTRY); |
218 OstTraceExt2( TRACE_BORDER, WLANWIZARDPRIVATE_SHOW, |
243 |
|
244 OstTraceExt2( |
|
245 TRACE_BORDER, |
|
246 WLANWIZARDPRIVATE_SHOW, |
219 "WlanWizardPrivate::show;this=%x;mFirstPageId=%{PageIds}", |
247 "WlanWizardPrivate::show;this=%x;mFirstPageId=%{PageIds}", |
220 ( unsigned )this, mFirstPageId ); |
248 (unsigned)this, |
|
249 mFirstPageId); |
221 |
250 |
222 Q_ASSERT(mClosed == false); |
251 Q_ASSERT(mClosed == false); |
223 showPage(mFirstPageId, false); |
252 showPage(mFirstPageId, false); |
224 mDialog->show(); |
253 mDialog->show(); |
225 |
254 |
226 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_SHOW_DONE, |
255 OstTrace1( |
|
256 TRACE_BORDER, |
|
257 WLANWIZARDPRIVATE_SHOW_DONE, |
227 "WlanWizardPrivate::show - Done;this=%x;", |
258 "WlanWizardPrivate::show - Done;this=%x;", |
228 (unsigned)this ); |
259 (unsigned)this); |
229 OstTraceFunctionExit0( WLANWIZARDPRIVATE_SHOW_EXIT ); |
260 |
|
261 OstTraceFunctionExit0(WLANWIZARDPRIVATE_SHOW_EXIT); |
230 } |
262 } |
231 |
263 |
232 /*! |
264 /*! |
233 See WlanWizard::setParameters() for descriptions of parameters. |
265 See WlanWizard::setParameters() for descriptions of parameters. |
234 |
266 |
242 int securityMode, |
274 int securityMode, |
243 bool usePsk, |
275 bool usePsk, |
244 bool hidden, |
276 bool hidden, |
245 bool wps) |
277 bool wps) |
246 { |
278 { |
247 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_GETNEXTPAGEID_ENTRY ); |
279 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_GETNEXTPAGEID_ENTRY); |
|
280 |
248 setConfiguration(ConfProcessSettings, true); |
281 setConfiguration(ConfProcessSettings, true); |
249 setConfiguration(ConfSsid, ssid); |
282 setConfiguration(ConfSsid, ssid); |
250 setConfiguration(ConfNetworkMode, networkMode); |
283 setConfiguration(ConfNetworkMode, networkMode); |
251 setConfiguration(ConfSecurityMode, securityMode); |
284 setConfiguration(ConfSecurityMode, securityMode); |
252 setConfiguration(ConfUsePsk, usePsk); |
285 setConfiguration(ConfUsePsk, usePsk); |
253 setConfiguration(ConfHiddenWlan, hidden); |
286 setConfiguration(ConfWlanScanSSID, hidden); |
254 |
287 |
255 OstTrace1( TRACE_NORMAL, WLANWIZARDPRIVATE_GETNEXTPAGEID, |
288 OstTrace1( |
|
289 TRACE_NORMAL, |
|
290 WLANWIZARDPRIVATE_GETNEXTPAGEID, |
256 "WlanWizardPrivate::getNextPageId;wps=%u", |
291 "WlanWizardPrivate::getNextPageId;wps=%u", |
257 wps ); |
292 wps); |
258 OstTraceFunctionExit0( WLANWIZARDPRIVATE_GETNEXTPAGEID_EXIT ); |
293 |
|
294 OstTraceFunctionExit0(WLANWIZARDPRIVATE_GETNEXTPAGEID_EXIT); |
259 return nextPageId(wps); |
295 return nextPageId(wps); |
260 } |
296 } |
261 |
297 |
262 /*! |
298 /*! |
263 Utility method for WLAN Wizard pages to query the wlanqtutils class. |
299 Utility method for WLAN Wizard pages to query the wlanqtutils class. |
264 |
300 |
265 @return a valid pointer to WlanQtUtils class. |
301 @return a valid pointer to WlanQtUtils class. |
266 */ |
302 */ |
267 WlanQtUtils* WlanWizardPrivate::wlanQtUtils() const |
303 WlanQtUtils* WlanWizardPrivate::wlanQtUtils() const |
268 { |
304 { |
269 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_WLANQTUTILS_ENTRY ); |
305 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_WLANQTUTILS_ENTRY); |
|
306 |
270 Q_ASSERT(mWlanQtUtils.data()); |
307 Q_ASSERT(mWlanQtUtils.data()); |
271 OstTraceFunctionExit0( WLANWIZARDPRIVATE_WLANQTUTILS_EXIT ); |
308 |
|
309 OstTraceFunctionExit0(WLANWIZARDPRIVATE_WLANQTUTILS_EXIT); |
272 return mWlanQtUtils.data(); |
310 return mWlanQtUtils.data(); |
273 } |
311 } |
274 |
312 |
275 /*! |
313 /*! |
276 Utility method for WLAN Wizard pages to query active wizard plugin object |
314 Utility method for WLAN Wizard pages to query active wizard plugin object |
277 |
315 |
278 @return NULL in case plugin is not active. |
316 @return NULL in case plugin is not active. |
279 */ |
317 */ |
280 WlanWizardPlugin* WlanWizardPrivate::wlanWizardPlugin() const |
318 WlanWizardPlugin* WlanWizardPrivate::wlanWizardPlugin() const |
281 { |
319 { |
282 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_WLANWIZARDPLUGIN_ENTRY ); |
320 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_WLANWIZARDPLUGIN_ENTRY); |
|
321 |
283 WlanWizardPlugin* plugin = NULL; |
322 WlanWizardPlugin* plugin = NULL; |
284 |
323 |
285 if (isEapEnabled()) { |
324 if (isEapEnabled()) { |
286 plugin = mEapWizard.data(); |
325 plugin = mEapWizard.data(); |
287 Q_ASSERT(plugin); |
326 Q_ASSERT(plugin); |
288 } |
327 } |
289 |
328 |
290 OstTrace1( TRACE_NORMAL, WLANWIZARDPRIVATE_WLANWIZARDPLUGIN, |
329 OstTrace1( |
|
330 TRACE_NORMAL, |
|
331 WLANWIZARDPRIVATE_WLANWIZARDPLUGIN, |
291 "WlanWizardPrivate::wlanWizardPlugin;plugin=%x", |
332 "WlanWizardPrivate::wlanWizardPlugin;plugin=%x", |
292 plugin ); |
333 plugin); |
293 |
334 |
294 OstTraceFunctionExit0( WLANWIZARDPRIVATE_WLANWIZARDPLUGIN_EXIT ); |
335 OstTraceFunctionExit0(WLANWIZARDPRIVATE_WLANWIZARDPLUGIN_EXIT); |
295 return plugin; |
336 return plugin; |
296 } |
337 } |
297 |
338 |
298 /*! |
339 /*! |
299 Utility method for WLAN Wizard pages to query if EAP mode is active at the |
340 Utility method for WLAN Wizard pages to query if EAP mode is active at the |
382 } |
431 } |
383 |
432 |
384 // Create IAP if does not exists or update the existing IAP |
433 // Create IAP if does not exists or update the existing IAP |
385 int referenceId = configuration(ConfIapId).toInt(); |
434 int referenceId = configuration(ConfIapId).toInt(); |
386 if (referenceId == WlanQtUtils::IapIdNone) { |
435 if (referenceId == WlanQtUtils::IapIdNone) { |
387 OstTrace0( TRACE_FLOW, WLANWIZARDPRIVATE_HANDLEIAP_CREATE, |
436 OstTrace0( |
388 "WlanWizardPrivate::handleIap: Create IAP" ); |
437 TRACE_FLOW, |
|
438 WLANWIZARDPRIVATE_HANDLEIAP_CREATE, |
|
439 "WlanWizardPrivate::handleIap: Create IAP"); |
389 |
440 |
390 referenceId = mWlanQtUtils->createIap(&wlanAp); |
441 referenceId = mWlanQtUtils->createIap(&wlanAp); |
391 setConfiguration(ConfIapId, referenceId); |
442 setConfiguration(ConfIapId, referenceId); |
392 |
443 |
393 if (referenceId == WlanQtUtils::IapIdNone) { |
444 if (referenceId == WlanQtUtils::IapIdNone) { |
394 ret = false; |
445 ret = false; |
395 } |
446 } |
396 } else { |
447 } else { |
397 OstTrace0( TRACE_FLOW, WLANWIZARDPRIVATE_HANDLEIAP_UPDATE, |
448 OstTrace0( |
398 "WlanWizardPrivate::handleIap: Update IAP" ); |
449 TRACE_FLOW, |
|
450 WLANWIZARDPRIVATE_HANDLEIAP_UPDATE, |
|
451 "WlanWizardPrivate::handleIap: Update IAP"); |
399 |
452 |
400 ret = mWlanQtUtils->updateIap(referenceId, &wlanAp); |
453 ret = mWlanQtUtils->updateIap(referenceId, &wlanAp); |
401 } |
454 } |
402 |
455 |
403 if (ret) { |
456 if (ret) { |
404 // Store Wizard plugin specific settings here. |
457 // Store Wizard plugin specific settings here. |
405 WlanWizardPlugin* plugin = wlanWizardPlugin(); |
458 WlanWizardPlugin* plugin = wlanWizardPlugin(); |
406 if (plugin) { |
459 if (plugin) { |
407 OstTrace0( TRACE_FLOW, WLANWIZARDPRIVATE_HANDLEIAP_PLUGIN, |
460 OstTrace0( |
408 "WlanWizardPrivate::handleIap: Plugin" ); |
461 TRACE_FLOW, |
|
462 WLANWIZARDPRIVATE_HANDLEIAP_PLUGIN, |
|
463 "WlanWizardPrivate::handleIap: Plugin"); |
409 // Plugin gets the IAP ID from configuration |
464 // Plugin gets the IAP ID from configuration |
410 ret = plugin->storeSettings(); |
465 ret = plugin->storeSettings(); |
411 } |
466 } |
412 } |
467 } |
413 |
468 |
414 OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_HANDLEIAP_DONE, |
469 OstTrace1( |
|
470 TRACE_FLOW, |
|
471 WLANWIZARDPRIVATE_HANDLEIAP_DONE, |
415 "WlanWizardPrivate::handleIap: Done;ret=%d", |
472 "WlanWizardPrivate::handleIap: Done;ret=%d", |
416 ret ); |
473 ret); |
417 |
474 |
418 OstTraceFunctionExit0( WLANWIZARDPRIVATE_HANDLEIAP_EXIT ); |
475 OstTraceFunctionExit0(WLANWIZARDPRIVATE_HANDLEIAP_EXIT); |
419 return ret; |
476 return ret; |
420 } |
477 } |
421 |
478 |
422 /*! |
479 /*! |
423 See WlanWizardHelper::configuration(). |
480 See WlanWizardHelper::configuration(). |
424 */ |
481 */ |
425 QVariant WlanWizardPrivate::configuration(ConfigurationId confId) const |
482 QVariant WlanWizardPrivate::configuration(ConfigurationId confId) const |
426 { |
483 { |
427 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CONFIGURATION_ENTRY ); |
484 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_CONFIGURATION_ENTRY); |
|
485 |
428 Q_ASSERT(mConfigurations.contains(confId)); |
486 Q_ASSERT(mConfigurations.contains(confId)); |
429 |
487 |
430 #ifdef OST_TRACE_COMPILER_IN_USE |
488 #ifdef OST_TRACE_COMPILER_IN_USE |
431 QString tmp; |
489 QString tmp; |
432 QDebug tmpStream(&tmp); |
490 QDebug tmpStream(&tmp); |
433 tmpStream << mConfigurations[confId]; |
491 tmpStream << mConfigurations[confId]; |
434 TPtrC16 string( tmp.utf16(), tmp.length() ); |
492 TPtrC16 string( tmp.utf16(), tmp.length() ); |
435 |
493 |
436 OstTraceExt2( TRACE_NORMAL, WLANWIZARDPRIVATE_CONFIGURATIONS, |
494 OstTraceExt2( |
|
495 TRACE_NORMAL, |
|
496 WLANWIZARDPRIVATE_CONFIGURATIONS, |
437 "WlanWizardPrivate::configuration;confId=%{ConfigurationId};string=%S", |
497 "WlanWizardPrivate::configuration;confId=%{ConfigurationId};string=%S", |
438 (uint)confId, string ); |
498 (uint)confId, |
|
499 string); |
439 #endif |
500 #endif |
440 |
501 |
441 OstTraceFunctionExit0( WLANWIZARDPRIVATE_CONFIGURATION_EXIT ); |
502 OstTraceFunctionExit0(WLANWIZARDPRIVATE_CONFIGURATION_EXIT); |
442 return mConfigurations[confId]; |
503 return mConfigurations[confId]; |
443 } |
504 } |
444 |
505 |
445 /*! |
506 /*! |
446 See WlanWizardHelper::setConfiguration(). |
507 See WlanWizardHelper::setConfiguration(). |
447 */ |
508 */ |
448 void WlanWizardPrivate::setConfiguration( |
509 void WlanWizardPrivate::setConfiguration( |
449 ConfigurationId confId, |
510 ConfigurationId confId, |
450 const QVariant &value) |
511 const QVariant &value) |
451 { |
512 { |
452 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SETCONFIGURATION_ENTRY ); |
513 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_SETCONFIGURATION_ENTRY); |
|
514 |
453 #ifdef OST_TRACE_COMPILER_IN_USE |
515 #ifdef OST_TRACE_COMPILER_IN_USE |
454 QString tmp; |
516 QString tmp; |
455 QDebug tmpStream(&tmp); |
517 QDebug tmpStream(&tmp); |
456 tmpStream << value; |
518 tmpStream << value; |
457 TPtrC16 string( tmp.utf16(), tmp.length() ); |
519 TPtrC16 string( tmp.utf16(), tmp.length() ); |
458 |
520 |
459 OstTraceExt2( TRACE_NORMAL, WLANWIZARDPRIVATE_SETCONFIGURATION, |
521 OstTraceExt2( |
|
522 TRACE_NORMAL, |
|
523 WLANWIZARDPRIVATE_SETCONFIGURATION, |
460 "WlanWizardPrivate::setConfiguration;" |
524 "WlanWizardPrivate::setConfiguration;" |
461 "confId=%{ConfigurationId};string=%S", |
525 "confId=%{ConfigurationId};string=%S", |
462 (uint)confId, string ); |
526 (uint)confId, |
|
527 string); |
463 #endif |
528 #endif |
464 |
529 |
465 mConfigurations[confId] = value; |
530 mConfigurations[confId] = value; |
466 OstTraceFunctionExit0( WLANWIZARDPRIVATE_SETCONFIGURATION_EXIT ); |
531 |
|
532 OstTraceFunctionExit0(WLANWIZARDPRIVATE_SETCONFIGURATION_EXIT); |
467 } |
533 } |
468 |
534 |
469 /*! |
535 /*! |
470 * See WlanWizardHelper::clearConfiguration(). |
536 * See WlanWizardHelper::clearConfiguration(). |
471 */ |
537 */ |
472 void WlanWizardPrivate::clearConfiguration(ConfigurationId confId) |
538 void WlanWizardPrivate::clearConfiguration(ConfigurationId confId) |
473 { |
539 { |
474 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CLEARCONFIGURATION_ENTRY ); |
540 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_CLEARCONFIGURATION_ENTRY); |
475 OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_CLEARCONFIGURATION, |
541 |
|
542 OstTrace1( |
|
543 TRACE_FLOW, |
|
544 WLANWIZARDPRIVATE_CLEARCONFIGURATION, |
476 "WlanWizardPrivate::clearConfiguration;confId=%{ConfigurationId}", |
545 "WlanWizardPrivate::clearConfiguration;confId=%{ConfigurationId}", |
477 (uint)confId ); |
546 (uint)confId); |
478 |
547 |
479 mConfigurations.remove(confId); |
548 mConfigurations.remove(confId); |
480 OstTraceFunctionExit0( WLANWIZARDPRIVATE_CLEARCONFIGURATION_EXIT ); |
549 |
|
550 OstTraceFunctionExit0(WLANWIZARDPRIVATE_CLEARCONFIGURATION_EXIT); |
481 } |
551 } |
482 |
552 |
483 /*! |
553 /*! |
484 * See WlanWizardHelper::configurationExists(). |
554 * See WlanWizardHelper::configurationExists(). |
485 */ |
555 */ |
486 bool WlanWizardPrivate::configurationExists(ConfigurationId confId) |
556 bool WlanWizardPrivate::configurationExists(ConfigurationId confId) |
487 { |
557 { |
488 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CONFIGURATIONEXISTS_ENTRY ); |
558 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_CONFIGURATIONEXISTS_ENTRY); |
489 OstTrace1( TRACE_DUMP, WLANWIZARDPRIVATE_CONFIGURATIONEXISTS, |
559 |
|
560 OstTrace1( |
|
561 TRACE_DUMP, |
|
562 WLANWIZARDPRIVATE_CONFIGURATIONEXISTS, |
490 "WlanWizardPrivate::configurationExists;confId=%{ConfigurationId}", |
563 "WlanWizardPrivate::configurationExists;confId=%{ConfigurationId}", |
491 (uint)confId ); |
564 (uint)confId); |
492 OstTraceFunctionExit0( WLANWIZARDPRIVATE_CONFIGURATIONEXISTS_EXIT ); |
565 |
|
566 OstTraceFunctionExit0(WLANWIZARDPRIVATE_CONFIGURATIONEXISTS_EXIT); |
493 return mConfigurations[confId].isValid(); |
567 return mConfigurations[confId].isValid(); |
494 } |
568 } |
495 |
569 |
496 /*! |
570 /*! |
497 See WlanWizardHelper::enableNextButton(). |
571 See WlanWizardHelper::enableNextButton(). |
498 */ |
572 */ |
499 void WlanWizardPrivate::enableNextButton(bool enable) |
573 void WlanWizardPrivate::enableNextButton(bool enable) |
500 { |
574 { |
501 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ENABLENEXTBUTTON_ENTRY ); |
575 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_ENABLENEXTBUTTON_ENTRY); |
502 OstTraceExt2( TRACE_FLOW, WLANWIZARDPRIVATE_ENABLENEXTBUTTON, |
576 |
|
577 OstTraceExt2( |
|
578 TRACE_FLOW, |
|
579 WLANWIZARDPRIVATE_ENABLENEXTBUTTON, |
503 "WlanWizardPrivate::enableNextButton;this=%x;enable=%x", |
580 "WlanWizardPrivate::enableNextButton;this=%x;enable=%x", |
504 (unsigned)this, (uint)enable ); |
581 (unsigned)this, |
|
582 (uint)enable); |
505 mActionNext->setEnabled(enable); |
583 mActionNext->setEnabled(enable); |
506 OstTraceFunctionExit0( WLANWIZARDPRIVATE_ENABLENEXTBUTTON_EXIT ); |
584 |
|
585 OstTraceFunctionExit0(WLANWIZARDPRIVATE_ENABLENEXTBUTTON_EXIT); |
507 } |
586 } |
508 |
587 |
509 /*! |
588 /*! |
510 See WlanWizardHelper::addPage(). |
589 See WlanWizardHelper::addPage(). |
511 */ |
590 */ |
512 void WlanWizardPrivate::addPage(int pageId, WlanWizardPage *page) |
591 void WlanWizardPrivate::addPage(int pageId, WlanWizardPage *page) |
513 { |
592 { |
514 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ADDPAGE_ENTRY ); |
593 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_ADDPAGE_ENTRY); |
515 OstTraceExt3( TRACE_FLOW, WLANWIZARDPRIVATE_ADDPAGE, |
594 |
|
595 OstTraceExt3( |
|
596 TRACE_FLOW, |
|
597 WLANWIZARDPRIVATE_ADDPAGE, |
516 "WlanWizardPrivate::addPage;this=%x;pageId=%{PageIds};page=%x", |
598 "WlanWizardPrivate::addPage;this=%x;pageId=%{PageIds};page=%x", |
517 (unsigned)this, pageId, (uint)(page) ); |
599 (unsigned)this, |
|
600 pageId, |
|
601 (uint)(page)); |
518 |
602 |
519 Q_ASSERT(!mPages.contains(pageId)); |
603 Q_ASSERT(!mPages.contains(pageId)); |
520 mPages[pageId] = page; |
604 mPages[pageId] = page; |
521 OstTraceFunctionExit0( WLANWIZARDPRIVATE_ADDPAGE_EXIT ); |
605 |
|
606 OstTraceFunctionExit0(WLANWIZARDPRIVATE_ADDPAGE_EXIT); |
522 } |
607 } |
523 |
608 |
524 /*! |
609 /*! |
525 See WlanWizardHelper::nextPage(). |
610 See WlanWizardHelper::nextPage(). |
526 */ |
611 */ |
527 void WlanWizardPrivate::nextPage() |
612 void WlanWizardPrivate::nextPage() |
528 { |
613 { |
529 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_NEXTPAGE_ENTRY ); |
614 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_NEXTPAGE_ENTRY); |
530 OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_NEXTPAGE, |
615 |
|
616 OstTrace1( |
|
617 TRACE_FLOW, |
|
618 WLANWIZARDPRIVATE_NEXTPAGE, |
531 "WlanWizardPrivate::nextPage;this=%x", |
619 "WlanWizardPrivate::nextPage;this=%x", |
532 this ); |
620 this); |
533 |
621 |
534 mPageFinished = true; |
622 mPageFinished = true; |
535 toNextPage(); |
623 toNextPage(); |
536 OstTraceFunctionExit0( WLANWIZARDPRIVATE_NEXTPAGE_EXIT ); |
624 |
|
625 OstTraceFunctionExit0(WLANWIZARDPRIVATE_NEXTPAGE_EXIT); |
537 } |
626 } |
538 |
627 |
539 /*! |
628 /*! |
540 See WlanWizardHelper::mainWindow(). |
629 See WlanWizardHelper::mainWindow(). |
541 */ |
630 */ |
542 HbMainWindow* WlanWizardPrivate::mainWindow() const |
631 HbMainWindow* WlanWizardPrivate::mainWindow() const |
543 { |
632 { |
544 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_MAINWINDOW_ENTRY ); |
633 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_MAINWINDOW_ENTRY); |
545 OstTraceFunctionExit0( WLANWIZARDPRIVATE_MAINWINDOW_EXIT ); |
634 OstTraceFunctionExit0(WLANWIZARDPRIVATE_MAINWINDOW_EXIT); |
546 return mMainWindow; |
635 return mMainWindow; |
547 } |
636 } |
548 |
637 |
549 /*! |
638 /*! |
550 See WlanWizardHelper::isCurrentPage(). |
639 See WlanWizardHelper::isCurrentPage(). |
551 */ |
640 */ |
552 bool WlanWizardPrivate::isCurrentPage(const HbWidget *page) const |
641 bool WlanWizardPrivate::isCurrentPage(const HbWidget *page) const |
553 { |
642 { |
554 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ISCURRENTPAGE_ENTRY ); |
643 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_ISCURRENTPAGE_ENTRY); |
|
644 |
555 bool ret = false; |
645 bool ret = false; |
556 if (mStackedWidget->currentWidget() == page) { |
646 if (mStackedWidget->currentWidget() == page) { |
557 ret = true; |
647 ret = true; |
558 } |
648 } |
559 |
649 |
560 OstTraceExt2( TRACE_FLOW, WLANWIZARDPRIVATE_ISCURRENTPAGE, |
650 OstTraceExt2( |
|
651 TRACE_FLOW, |
|
652 WLANWIZARDPRIVATE_ISCURRENTPAGE, |
561 "WlanWizardPrivate::isCurrentPage;page=%x;ret=%d", |
653 "WlanWizardPrivate::isCurrentPage;page=%x;ret=%d", |
562 (uint)page, ret); |
654 (uint)page, |
563 |
655 ret); |
564 OstTraceFunctionExit0( WLANWIZARDPRIVATE_ISCURRENTPAGE_EXIT ); |
656 |
|
657 OstTraceFunctionExit0(WLANWIZARDPRIVATE_ISCURRENTPAGE_EXIT); |
565 return ret; |
658 return ret; |
566 } |
659 } |
567 |
660 |
568 /*! |
661 /*! |
569 See WlanWizardHelper::nextPageId() |
662 See WlanWizardHelper::nextPageId() |
570 */ |
663 */ |
571 int WlanWizardPrivate::nextPageId(bool useWps) |
664 int WlanWizardPrivate::nextPageId(bool useWps) |
572 { |
665 { |
573 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_NEXTPAGEID_ENTRY ); |
666 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_NEXTPAGEID_ENTRY); |
|
667 |
574 int ret; |
668 int ret; |
575 if (useWps) { |
669 if (useWps) { |
576 ret = WlanWizardPage::PageWpsStart; |
670 ret = WlanWizardPage::PageWpsStart; |
577 } else { |
671 } else { |
578 int secMode = configuration(WlanWizardHelper::ConfSecurityMode).toInt(); |
672 int secMode = configuration(WlanWizardHelper::ConfSecurityMode).toInt(); |
695 // In error case if page (value) is not found default contructed key is |
805 // In error case if page (value) is not found default contructed key is |
696 // returned, in this case default value for int is 0 which means PageNone. |
806 // returned, in this case default value for int is 0 which means PageNone. |
697 updateFrame(mPages.key(page)); |
807 updateFrame(mPages.key(page)); |
698 enableNextButton(page->showPage()); |
808 enableNextButton(page->showPage()); |
699 |
809 |
700 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_DONE, |
810 OstTrace1( |
|
811 TRACE_BORDER, |
|
812 WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_DONE, |
701 "WlanWizardPrivate::previousTriggered - Done;this=%x", |
813 "WlanWizardPrivate::previousTriggered - Done;this=%x", |
702 this ); |
814 this); |
703 OstTraceFunctionExit0( WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_EXIT ); |
815 |
|
816 OstTraceFunctionExit0(WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_EXIT); |
704 } |
817 } |
705 |
818 |
706 /*! |
819 /*! |
707 Next toolbar button has been pressed. Wizard framework asks from the current |
820 Next toolbar button has been pressed. Wizard framework asks from the current |
708 page what should be the next page id and shows it. |
821 page what should be the next page id and shows it. |
709 */ |
822 */ |
710 void WlanWizardPrivate::nextTriggered() |
823 void WlanWizardPrivate::nextTriggered() |
711 { |
824 { |
712 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_NEXTTRIGGERED_ENTRY ); |
825 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_NEXTTRIGGERED_ENTRY); |
713 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_NEXTTRIGGERED, |
826 |
|
827 OstTrace1( |
|
828 TRACE_BORDER, |
|
829 WLANWIZARDPRIVATE_NEXTTRIGGERED, |
714 "WlanWizardPrivate::nextTriggered;this=%x", |
830 "WlanWizardPrivate::nextTriggered;this=%x", |
715 this ); |
831 this); |
716 |
832 |
717 mPageTimer->stop(); |
833 mPageTimer->stop(); |
718 |
834 |
719 HbWidget *widget = qobject_cast<HbWidget*>(mStackedWidget->currentWidget()); |
835 HbWidget *widget = qobject_cast<HbWidget*>(mStackedWidget->currentWidget()); |
720 Q_ASSERT(widget); |
836 Q_ASSERT(widget); |
721 |
837 |
722 bool removeFromStack; |
838 bool removeFromStack; |
723 int pageId = mPageMapper[widget]->nextId(removeFromStack); |
839 int pageId = mPageMapper[widget]->nextId(removeFromStack); |
724 showPage(pageId, removeFromStack); |
840 showPage(pageId, removeFromStack); |
725 |
841 |
726 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_NEXTTRIGGERED_DONE, |
842 OstTrace1( |
|
843 TRACE_BORDER, |
|
844 WLANWIZARDPRIVATE_NEXTTRIGGERED_DONE, |
727 "WlanWizardPrivate::nextTriggered - Done;this=%x", |
845 "WlanWizardPrivate::nextTriggered - Done;this=%x", |
728 this ); |
846 this); |
729 OstTraceFunctionExit0( WLANWIZARDPRIVATE_NEXTTRIGGERED_EXIT ); |
847 |
|
848 OstTraceFunctionExit0(WLANWIZARDPRIVATE_NEXTTRIGGERED_EXIT); |
730 } |
849 } |
731 |
850 |
732 /*! |
851 /*! |
733 Finish button has been pressed. Closes the wizard and sends finished() |
852 Finish button has been pressed. Closes the wizard and sends finished() |
734 signal to the client. |
853 signal to the client. |
735 */ |
854 */ |
736 void WlanWizardPrivate::finishTriggered() |
855 void WlanWizardPrivate::finishTriggered() |
737 { |
856 { |
738 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_FINISHTRIGGERED_ENTRY ); |
857 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_FINISHTRIGGERED_ENTRY); |
739 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_FINISHTRIGGERED, |
858 |
|
859 OstTrace1( |
|
860 TRACE_BORDER, |
|
861 WLANWIZARDPRIVATE_FINISHTRIGGERED, |
740 "WlanWizardPrivate::finishTriggered;this=%x", |
862 "WlanWizardPrivate::finishTriggered;this=%x", |
741 this ); |
863 this); |
742 |
864 |
743 // Disconnect receiving more signals from any actions |
865 // Disconnect receiving more signals from any actions |
744 disconnectActions(); |
866 disconnectActions(); |
745 |
867 |
746 mPageTimer->stop(); |
868 mPageTimer->stop(); |
749 Q_ASSERT(q_ptr); |
871 Q_ASSERT(q_ptr); |
750 emit q_ptr->finished( |
872 emit q_ptr->finished( |
751 configuration(ConfIapId).toInt(), |
873 configuration(ConfIapId).toInt(), |
752 configuration(ConfConnected).toBool()); |
874 configuration(ConfConnected).toBool()); |
753 |
875 |
754 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_FINISHTRIGGERED_DONE, |
876 OstTrace1( |
|
877 TRACE_BORDER, |
|
878 WLANWIZARDPRIVATE_FINISHTRIGGERED_DONE, |
755 "WlanWizardPrivate::finishTriggered - Done;this=%x", |
879 "WlanWizardPrivate::finishTriggered - Done;this=%x", |
756 this ); |
880 this); |
757 OstTraceFunctionExit0( WLANWIZARDPRIVATE_FINISHTRIGGERED_EXIT ); |
881 |
|
882 OstTraceFunctionExit0(WLANWIZARDPRIVATE_FINISHTRIGGERED_EXIT); |
758 } |
883 } |
759 |
884 |
760 /*! |
885 /*! |
761 In case wizard page is using timer protection for the page, this is the |
886 In case wizard page is using timer protection for the page, this is the |
762 slot to handle the callback from the timer. |
887 slot to handle the callback from the timer. |
763 */ |
888 */ |
764 void WlanWizardPrivate::onTimeOut() |
889 void WlanWizardPrivate::onTimeOut() |
765 { |
890 { |
766 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ONTIMEOUT_ENTRY ); |
891 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_ONTIMEOUT_ENTRY); |
767 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_ONTIMEOUT, |
892 |
|
893 OstTrace1( |
|
894 TRACE_BORDER, |
|
895 WLANWIZARDPRIVATE_ONTIMEOUT, |
768 "WlanWizardPrivate::onTimeOut;this=%x", |
896 "WlanWizardPrivate::onTimeOut;this=%x", |
769 this ); |
897 this); |
770 |
898 |
771 toNextPage(); |
899 toNextPage(); |
772 |
900 |
773 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_ONTIMEOUT_DONE, |
901 OstTrace1( |
|
902 TRACE_BORDER, |
|
903 WLANWIZARDPRIVATE_ONTIMEOUT_DONE, |
774 "WlanWizardPrivate::onTimeOut - Done;this=%x", |
904 "WlanWizardPrivate::onTimeOut - Done;this=%x", |
775 this ); |
905 this); |
776 OstTraceFunctionExit0( WLANWIZARDPRIVATE_ONTIMEOUT_EXIT ); |
906 |
|
907 OstTraceFunctionExit0(WLANWIZARDPRIVATE_ONTIMEOUT_EXIT); |
777 } |
908 } |
778 |
909 |
779 /*! |
910 /*! |
780 Slot to start wizard page operation asynchronous. Starts also the timer |
911 Slot to start wizard page operation asynchronous. Starts also the timer |
781 to protect the wizard page. |
912 to protect the wizard page. |
782 */ |
913 */ |
783 void WlanWizardPrivate::startPageOperation() |
914 void WlanWizardPrivate::startPageOperation() |
784 { |
915 { |
785 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_STARTPAGEOPERATION_ENTRY ); |
916 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_STARTPAGEOPERATION_ENTRY); |
|
917 |
786 // Process this if wizard has not been closed |
918 // Process this if wizard has not been closed |
787 if (mClosed == false) { |
919 if (mClosed == false) { |
788 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_STARTPAGEOPERATION, |
920 OstTrace1( |
|
921 TRACE_BORDER, |
|
922 WLANWIZARDPRIVATE_STARTPAGEOPERATION, |
789 "WlanWizardPrivate::startPageOperation;this=%x", |
923 "WlanWizardPrivate::startPageOperation;this=%x", |
790 this ); |
924 this); |
791 |
925 |
792 HbWidget *widget = |
926 HbWidget *widget = |
793 qobject_cast<HbWidget*>(mStackedWidget->currentWidget()); |
927 qobject_cast<HbWidget*>(mStackedWidget->currentWidget()); |
794 Q_ASSERT(widget); |
928 Q_ASSERT(widget); |
795 mPageFinished = false; |
929 mPageFinished = false; |
796 mPageTimer->start(PageTimeout); |
930 mPageTimer->start(PageTimeout); |
797 mPageMapper[widget]->startOperation(); |
931 mPageMapper[widget]->startOperation(); |
798 |
932 |
799 OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_STARTPAGEOPERATION_DONE, |
933 OstTrace1( |
|
934 TRACE_BORDER, |
|
935 WLANWIZARDPRIVATE_STARTPAGEOPERATION_DONE, |
800 "WlanWizardPrivate::startPageOperation - DONE;this=%x", |
936 "WlanWizardPrivate::startPageOperation - DONE;this=%x", |
801 this ); |
937 this); |
802 } |
938 } |
803 OstTraceFunctionExit0( WLANWIZARDPRIVATE_STARTPAGEOPERATION_EXIT ); |
939 |
|
940 OstTraceFunctionExit0(WLANWIZARDPRIVATE_STARTPAGEOPERATION_EXIT); |
804 } |
941 } |
805 |
942 |
806 /*! |
943 /*! |
807 In case the wizard page uses timer protection this method determines when |
944 In case the wizard page uses timer protection this method determines when |
808 the next page is shown. |
945 the next page is shown. |
809 */ |
946 */ |
810 void WlanWizardPrivate::toNextPage() |
947 void WlanWizardPrivate::toNextPage() |
811 { |
948 { |
812 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_TONEXTPAGE_ENTRY ); |
949 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_TONEXTPAGE_ENTRY); |
|
950 |
813 if (mPageFinished && !(mPageTimer->isActive())) { |
951 if (mPageFinished && !(mPageTimer->isActive())) { |
814 OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_TONEXTPAGE, |
952 OstTrace1( |
|
953 TRACE_FLOW, |
|
954 WLANWIZARDPRIVATE_TONEXTPAGE, |
815 "WlanWizardPrivate::toNextPage;this=%x", |
955 "WlanWizardPrivate::toNextPage;this=%x", |
816 this ); |
956 this); |
817 |
957 |
818 // process this asynchronous. Main purpose is to release the current |
958 // process this asynchronous. Main purpose is to release the current |
819 // call stack and process the page change using new call stack |
959 // call stack and process the page change using new call stack |
820 QMetaObject::invokeMethod(this, "nextTriggered", Qt::QueuedConnection); |
960 QMetaObject::invokeMethod(this, "nextTriggered", Qt::QueuedConnection); |
821 } |
961 } |
822 OstTraceFunctionExit0( WLANWIZARDPRIVATE_TONEXTPAGE_EXIT ); |
962 |
|
963 OstTraceFunctionExit0(WLANWIZARDPRIVATE_TONEXTPAGE_EXIT); |
823 } |
964 } |
824 |
965 |
825 /*! |
966 /*! |
826 Show requested page and removes the current wizard page from the stack if |
967 Show requested page and removes the current wizard page from the stack if |
827 required. This method updates the title and toolbar accordingly. |
968 required. This method updates the title and toolbar accordingly. |
1064 ok = true; |
1227 ok = true; |
1065 ok = connect(mPageTimer, SIGNAL(timeout()), this, SLOT(onTimeOut())); |
1228 ok = connect(mPageTimer, SIGNAL(timeout()), this, SLOT(onTimeOut())); |
1066 Q_ASSERT(ok); |
1229 Q_ASSERT(ok); |
1067 |
1230 |
1068 ok = connect( |
1231 ok = connect( |
1069 mActionNext, SIGNAL(triggered()), |
1232 mActionNext, |
1070 this, SLOT(nextTriggered())); |
1233 SIGNAL(triggered()), |
|
1234 this, |
|
1235 SLOT(nextTriggered())); |
1071 Q_ASSERT(ok); |
1236 Q_ASSERT(ok); |
1072 |
1237 |
1073 ok = connect( |
1238 ok = connect( |
1074 mActionPrevious, SIGNAL(triggered()), |
1239 mActionPrevious, |
1075 this, SLOT(previousTriggered())); |
1240 SIGNAL(triggered()), |
|
1241 this, |
|
1242 SLOT(previousTriggered())); |
1076 Q_ASSERT(ok); |
1243 Q_ASSERT(ok); |
1077 |
1244 |
1078 ok = connect( |
1245 ok = connect( |
1079 mActionFinish, SIGNAL(triggered()), |
1246 mActionFinish, |
1080 this, SLOT(finishTriggered())); |
1247 SIGNAL(triggered()), |
|
1248 this, |
|
1249 SLOT(finishTriggered())); |
1081 Q_ASSERT(ok); |
1250 Q_ASSERT(ok); |
1082 |
1251 |
1083 ok = connect( |
1252 ok = connect( |
1084 mActionCancel, SIGNAL(triggered()), |
1253 mActionCancel, |
1085 this, SLOT(cancelTriggered())); |
1254 SIGNAL(triggered()), |
|
1255 this, |
|
1256 SLOT(cancelTriggered())); |
1086 Q_ASSERT(ok); |
1257 Q_ASSERT(ok); |
1087 |
1258 |
1088 // TODO: workaround for full screen dialog, with docml it is possible to |
1259 // TODO: workaround for full screen dialog, with docml it is possible to |
1089 // define fullscreen dialog, mut resize is not done correctly when orientation |
1260 // define fullscreen dialog, mut resize is not done correctly when orientation |
1090 // is changed. See TSW Error: MTAA-854DK8 |
1261 // is changed. See TSW Error: MTAA-854DK8 |
1091 ok = HbStyleLoader::registerFilePath(":/css/custom.css"); |
1262 ok = HbStyleLoader::registerFilePath(":/css/custom.css"); |
1092 Q_ASSERT(ok); |
1263 Q_ASSERT(ok); |
1093 OstTraceFunctionExit0( WLANWIZARDPRIVATE_LOADDOCML_EXIT ); |
1264 |
|
1265 OstTraceFunctionExit0(WLANWIZARDPRIVATE_LOADDOCML_EXIT); |
1094 } |
1266 } |
1095 |
1267 |
1096 /*! |
1268 /*! |
1097 Disconnect receiving triggered() signal from any toolbar action. |
1269 Disconnect receiving triggered() signal from any toolbar action. |
1098 */ |
1270 */ |
1099 void WlanWizardPrivate::disconnectActions() |
1271 void WlanWizardPrivate::disconnectActions() |
1100 { |
1272 { |
1101 OstTraceFunctionEntry0( WLANWIZARDPRIVATE_DISCONNECTACTIONS_ENTRY ); |
1273 OstTraceFunctionEntry0(WLANWIZARDPRIVATE_DISCONNECTACTIONS_ENTRY); |
|
1274 |
1102 disconnect( |
1275 disconnect( |
1103 mActionNext, SIGNAL(triggered()), |
1276 mActionNext, |
1104 this, SLOT(nextTriggered())); |
1277 SIGNAL(triggered()), |
|
1278 this, |
|
1279 SLOT(nextTriggered())); |
1105 |
1280 |
1106 disconnect( |
1281 disconnect( |
1107 mActionPrevious, SIGNAL(triggered()), |
1282 mActionPrevious, |
1108 this, SLOT(previousTriggered())); |
1283 SIGNAL(triggered()), |
|
1284 this, |
|
1285 SLOT(previousTriggered())); |
1109 |
1286 |
1110 disconnect( |
1287 disconnect( |
1111 mActionFinish, SIGNAL(triggered()), |
1288 mActionFinish, |
1112 this, SLOT(finishTriggered())); |
1289 SIGNAL(triggered()), |
|
1290 this, |
|
1291 SLOT(finishTriggered())); |
1113 |
1292 |
1114 disconnect( |
1293 disconnect( |
1115 mActionCancel, SIGNAL(triggered()), |
1294 mActionCancel, |
1116 this, SLOT(cancelTriggered())); |
1295 SIGNAL(triggered()), |
1117 OstTraceFunctionExit0( WLANWIZARDPRIVATE_DISCONNECTACTIONS_EXIT ); |
1296 this, |
1118 } |
1297 SLOT(cancelTriggered())); |
|
1298 |
|
1299 OstTraceFunctionExit0(WLANWIZARDPRIVATE_DISCONNECTACTIONS_EXIT); |
|
1300 } |