134 |
134 |
135 void WlanSnifferMainWindow::startWlanWizard(const WlanQtUtilsAp *ap) |
135 void WlanSnifferMainWindow::startWlanWizard(const WlanQtUtilsAp *ap) |
136 { |
136 { |
137 OstTraceFunctionEntry0(WLANSNIFFERMAINWINDOW_STARTWLANWIZARD_ENTRY); |
137 OstTraceFunctionEntry0(WLANSNIFFERMAINWINDOW_STARTWLANWIZARD_ENTRY); |
138 |
138 |
139 Q_ASSERT(mWizard == NULL); |
139 if (mWizard == NULL) { |
140 |
140 // Stop WLAN scanning for the duration of WLAN Wizard |
141 // Stop WLAN scanning for the duration of WLAN Wizard |
141 mEngine->stopWlanScanning(); |
142 mEngine->stopWlanScanning(); |
142 |
143 |
143 mWizard = QSharedPointer<WlanWizard>(new WlanWizard(this)); |
144 mWizard = QSharedPointer<WlanWizard>(new WlanWizard(this)); |
144 bool connectStatus = connect( |
145 bool connectStatus = connect( |
145 mWizard.data(), |
146 mWizard.data(), |
146 SIGNAL(finished(int,bool)), |
147 SIGNAL(finished(int,bool)), |
147 this, |
148 this, |
148 SLOT(handleWlanWizardComplete(int,bool)), |
149 SLOT(handleWlanWizardComplete(int,bool)), |
149 Qt::QueuedConnection); |
150 Qt::QueuedConnection); |
150 Q_ASSERT(connectStatus == true); |
151 Q_ASSERT(connectStatus == true); |
151 |
152 |
152 connectStatus = connect( |
153 connectStatus = connect( |
153 mWizard.data(), |
154 mWizard.data(), |
154 SIGNAL(cancelled()), |
155 SIGNAL(cancelled()), |
155 this, |
156 this, |
156 SLOT(handleWlanWizardCancelled()), |
157 SLOT(handleWlanWizardCancelled()), |
157 Qt::QueuedConnection); |
158 Qt::QueuedConnection); |
158 Q_ASSERT(connectStatus == true); |
159 Q_ASSERT(connectStatus == true); |
159 |
160 |
160 // Create an IAP for a specific AP |
161 // Create an IAP for a specific AP |
161 if (ap) { |
162 if (ap) { |
162 mWizard->setParameters( |
163 mWizard->setParameters( |
163 ap->value(WlanQtUtilsAp::ConfIdName).toString(), |
164 ap->value(WlanQtUtilsAp::ConfIdName).toString(), |
164 ap->value(WlanQtUtilsAp::ConfIdSsid).toByteArray(), |
165 ap->value(WlanQtUtilsAp::ConfIdSsid).toByteArray(), |
165 ap->value(WlanQtUtilsAp::ConfIdConnectionMode).toInt(), |
166 ap->value(WlanQtUtilsAp::ConfIdConnectionMode).toInt(), |
166 ap->value(WlanQtUtilsAp::ConfIdSecurityMode).toInt(), |
167 ap->value(WlanQtUtilsAp::ConfIdSecurityMode).toInt(), |
167 ap->value(WlanQtUtilsAp::ConfIdWpaPskUse).toInt(), |
168 ap->value(WlanQtUtilsAp::ConfIdWpaPskUse).toInt(), |
168 ap->value(WlanQtUtilsAp::ConfIdWpsSupported).toBool()); |
169 ap->value(WlanQtUtilsAp::ConfIdWpsSupported).toBool()); |
169 } |
|
170 // else: Add WLAN IAP manually |
|
171 |
|
172 mWizard->show(); |
170 } |
173 } |
171 // else: Add WLAN IAP manually |
174 // else: already running Wizard, ignore this call |
172 |
175 |
173 mWizard->show(); |
|
174 |
|
175 OstTraceFunctionExit0(WLANSNIFFERMAINWINDOW_STARTWLANWIZARD_EXIT); |
176 OstTraceFunctionExit0(WLANSNIFFERMAINWINDOW_STARTWLANWIZARD_EXIT); |
176 } |
177 } |
177 |
178 |
178 /*! |
179 /*! |
179 WLAN Wizard successful completion handler. |
180 WLAN Wizard successful completion handler. |