103 mCheckUsername = qobject_cast<HbCheckBox*> (mDocumentLoader->findWidget("setlabel_53_val")); |
113 mCheckUsername = qobject_cast<HbCheckBox*> (mDocumentLoader->findWidget("setlabel_53_val")); |
104 Q_ASSERT(mCheckUsername); |
114 Q_ASSERT(mCheckUsername); |
105 |
115 |
106 mCheckRealm = qobject_cast<HbCheckBox*> (mDocumentLoader->findWidget("setlabel_54_val")); |
116 mCheckRealm = qobject_cast<HbCheckBox*> (mDocumentLoader->findWidget("setlabel_54_val")); |
107 Q_ASSERT(mCheckRealm); |
117 Q_ASSERT(mCheckRealm); |
108 |
118 |
109 mLabelUsername = qobject_cast<HbLabel*> (mDocumentLoader->findWidget("setlabel_53")); |
119 mLabelUsername = qobject_cast<HbLabel*> (mDocumentLoader->findWidget("setlabel_53")); |
110 Q_ASSERT(mLabelUsername); |
120 Q_ASSERT(mLabelUsername); |
111 |
121 |
112 mLabelRealm = qobject_cast<HbLabel*> (mDocumentLoader->findWidget("setlabel_54")); |
122 mLabelRealm = qobject_cast<HbLabel*> (mDocumentLoader->findWidget("setlabel_54")); |
113 Q_ASSERT(mLabelRealm); |
123 Q_ASSERT(mLabelRealm); |
114 |
124 |
115 ok = connect( |
125 ok = connect( |
116 mWizard->wizardHelper()->mainWindow(), |
126 mWizard->wizardHelper()->mainWindow(), |
117 SIGNAL(orientationChanged(Qt::Orientation)), |
127 SIGNAL(orientationChanged(Qt::Orientation)), |
118 this, |
128 this, |
119 SLOT(loadDocmlSection(Qt::Orientation))); |
129 SLOT(loadDocmlSection(Qt::Orientation))); |
120 Q_ASSERT(ok); |
130 Q_ASSERT(ok); |
121 |
131 |
122 ok = connect( |
132 ok = connect( |
123 mEditUsername, SIGNAL(textChanged(const QString &)), |
133 mEditUsername, SIGNAL(textChanged(const QString &)), |
124 this, SLOT(textChanged(const QString &))); |
134 this, SLOT(textChanged(const QString &))); |
125 Q_ASSERT(ok); |
135 Q_ASSERT(ok); |
126 |
136 |
127 ok = connect( |
137 ok = connect( |
128 mEditRealm, SIGNAL(textChanged(const QString &)), |
138 mEditRealm, SIGNAL(textChanged(const QString &)), |
129 this, SLOT(textChanged(const QString &))); |
139 this, SLOT(textChanged(const QString &))); |
130 Q_ASSERT(ok); |
140 Q_ASSERT(ok); |
131 |
141 |
132 ok = connect( |
142 ok = connect( |
133 mCheckUsername, SIGNAL(stateChanged(int)), |
143 mCheckUsername, SIGNAL(stateChanged(int)), |
134 this, SLOT(stateChanged(int))); |
144 this, SLOT(stateChanged(int))); |
135 Q_ASSERT(ok); |
145 Q_ASSERT(ok); |
136 |
146 |
137 ok = connect( |
147 ok = connect( |
138 mCheckRealm, SIGNAL(stateChanged(int)), |
148 mCheckRealm, SIGNAL(stateChanged(int)), |
139 this, SLOT(stateChanged(int))); |
149 this, SLOT(stateChanged(int))); |
140 Q_ASSERT(ok); |
150 Q_ASSERT(ok); |
141 // by default both checkboxes are checked |
151 // by default both checkboxes are checked |
142 } |
152 } |
143 EapQtPluginHandle plugin((EapQtPluginHandle::Plugin) |
153 EapQtPluginHandle plugin((EapQtPluginHandle::Plugin) |
144 mWizard->configurations(EapWizardPrivate::OuterType).toInt() ); |
154 mWizard->configurations(EapWizardPrivate::OuterType).toInt() ); |
145 |
155 |
146 mLabelUsername->setPlainText( |
156 mLabelUsername->setPlainText( |
147 HbParameterLengthLimiter( |
157 HbParameterLengthLimiter("txt_occ_setlabel_user_name_for_1").arg( |
148 hbTrId("txt_occ_setlabel_user_name_for_1")).arg( |
158 mWizard->eapTypeToString(plugin.pluginId()))); |
149 mWizard->eapTypeToString(plugin.pluginId()))); |
159 |
150 |
|
151 // Configure editors properties |
160 // Configure editors properties |
152 mValidatorUsername.reset( |
161 mValidatorUsername.reset( |
153 mWizard->eapConfigurationInterface()->validatorEap( |
162 mWizard->eapConfigurationInterface()->validatorEap( |
154 plugin.type(), |
163 plugin.type(), |
155 EapQtConfig::Username) ); |
164 EapQtConfig::Username) ); |
161 plugin.type(), |
170 plugin.type(), |
162 EapQtConfig::Realm) ); |
171 EapQtConfig::Realm) ); |
163 Q_ASSERT(mValidatorRealm.data()); |
172 Q_ASSERT(mValidatorRealm.data()); |
164 mValidatorRealm->updateEditor(mEditRealm); |
173 mValidatorRealm->updateEditor(mEditRealm); |
165 |
174 |
|
175 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_INITIALIZEPAGE_EXIT ); |
166 return mWidget; |
176 return mWidget; |
167 } |
177 } |
168 |
178 |
169 /*! |
179 /*! |
170 Loads the required orientation of docml. |
180 Loads the required orientation of docml. |
171 |
181 |
172 @param [in] orientation Orientation to be loaded. |
182 @param [in] orientation Orientation to be loaded. |
173 */ |
183 */ |
174 void EapWizardPageIdentity::loadDocmlSection(Qt::Orientation orientation) |
184 void EapWizardPageIdentity::loadDocmlSection(Qt::Orientation orientation) |
175 { |
185 { |
|
186 OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_LOADDOCMLSECTION_ENTRY ); |
176 EapWizardPage::loadDocmlSection( |
187 EapWizardPage::loadDocmlSection( |
177 mDocumentLoader.data(), |
188 mDocumentLoader.data(), |
178 orientation, |
189 orientation, |
179 ":/docml/occ_eap_wizard_03.docml", |
190 ":/docml/occ_eap_wizard_03.docml", |
180 "portrait_section", |
191 "portrait_section", |
181 "landscape_section"); |
192 "landscape_section"); |
|
193 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_LOADDOCMLSECTION_EXIT ); |
182 } |
194 } |
183 |
195 |
184 /*! |
196 /*! |
185 See WlanWizardPage. |
197 See WlanWizardPage. |
186 |
198 |
187 @return next wizard page: |
199 @return next wizard page: |
188 - WlanWizardPage::PageProcessSettings: For EAP-TLS |
200 - WlanWizardPage::PageProcessSettings: For EAP-TLS |
189 - EapWizardPage::PageInnerTypeEapTtls: For EAP-TTLS |
201 - EapWizardPage::PageInnerTypeEapTtls: For EAP-TTLS |
190 - EapWizardPage::PageInnerTypePeap: For PEAP |
202 - EapWizardPage::PageInnerTypePeap: For PEAP |
191 */ |
203 */ |
192 int EapWizardPageIdentity::nextId() const |
204 int EapWizardPageIdentity::nextId() const |
193 { |
205 { |
|
206 OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_NEXTID_ENTRY ); |
194 int id = WlanWizardPage::PageNone; |
207 int id = WlanWizardPage::PageNone; |
195 bool ok; |
208 bool ok; |
196 int type = mWizard->configurations(EapWizardPrivate::OuterType).toInt(&ok); |
209 int type = mWizard->configurations(EapWizardPrivate::OuterType).toInt(&ok); |
197 Q_ASSERT(ok); |
210 Q_ASSERT(ok); |
198 |
211 |
199 switch (type) { |
212 switch (type) { |
200 case EapQtPluginHandle::PluginEapTls: |
213 case EapQtPluginHandle::PluginEapTls: |
201 id = WlanWizardPage::PageProcessSettings; |
214 id = WlanWizardPage::PageProcessSettings; |
202 break; |
215 break; |
203 |
216 |
204 case EapQtPluginHandle::PluginEapTtls: |
217 case EapQtPluginHandle::PluginEapTtls: |
205 id = EapWizardPage::PageInnerTypeEapTtls; |
218 id = EapWizardPage::PageInnerTypeEapTtls; |
206 break; |
219 break; |
207 |
220 |
208 case EapQtPluginHandle::PluginPeap: |
221 case EapQtPluginHandle::PluginPeap: |
209 id = EapWizardPage::PageInnerTypePeap; |
222 id = EapWizardPage::PageInnerTypePeap; |
210 break; |
223 break; |
211 } |
224 } |
212 |
225 |
213 mWizard->setConfigurations(EapWizardPrivate::TunnelUsernameAutomatic, |
226 mWizard->setConfigurations(EapWizardPrivate::TunnelUsernameAutomatic, |
214 mCheckUsername->isChecked()); |
227 mCheckUsername->isChecked()); |
215 |
228 |
216 mWizard->setConfigurations( |
229 mWizard->setConfigurations( |
217 EapWizardPrivate::TunnelUsername, mEditUsername->text()); |
230 EapWizardPrivate::TunnelUsername, mEditUsername->text()); |
218 |
231 |
219 mWizard->setConfigurations( |
232 mWizard->setConfigurations( |
220 EapWizardPrivate::TunnelRealmAutomatic, mCheckRealm->isChecked()); |
233 EapWizardPrivate::TunnelRealmAutomatic, mCheckRealm->isChecked()); |
221 |
234 |
222 mWizard->setConfigurations(EapWizardPrivate::TunnelRealm, mEditRealm->text()); |
235 mWizard->setConfigurations(EapWizardPrivate::TunnelRealm, mEditRealm->text()); |
223 |
236 |
|
237 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_NEXTID_EXIT ); |
224 return id; |
238 return id; |
225 } |
239 } |
226 |
240 |
227 /*! |
241 /*! |
228 See WlanWizardPage. |
242 See WlanWizardPage. |
229 |
243 |
230 Validates the content of the page. |
244 Validates the content of the page. |
231 |
245 |
232 @return true if content is valid. |
246 @return true if content is valid. |
233 */ |
247 */ |
234 bool EapWizardPageIdentity::showPage() |
248 bool EapWizardPageIdentity::showPage() |
235 { |
249 { |
|
250 OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_SHOWPAGE_ENTRY ); |
236 bool valid = false; |
251 bool valid = false; |
237 |
252 |
238 if (validateGroup(mEditUsername, mCheckUsername, mValidatorUsername.data()) && |
253 if (validateGroup(mEditUsername, mCheckUsername, mValidatorUsername.data()) && |
239 validateGroup(mEditRealm, mCheckRealm, mValidatorRealm.data())) { |
254 validateGroup(mEditRealm, mCheckRealm, mValidatorRealm.data())) { |
240 valid = true; |
255 valid = true; |
241 } |
256 } |
242 |
257 |
|
258 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_SHOWPAGE_EXIT ); |
243 return valid; |
259 return valid; |
244 } |
260 } |
245 |
261 |
246 /*! |
262 /*! |
247 Slot for textChanged() signal from HbLineEdit. |
263 Slot for textChanged() signal from HbLineEdit. |
248 |
264 |
249 @param [in] text NOT USED. |
265 @param [in] text NOT USED. |
250 */ |
266 */ |
251 void EapWizardPageIdentity::textChanged(const QString & text) |
267 void EapWizardPageIdentity::textChanged(const QString & text) |
252 { |
268 { |
|
269 OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_TEXTCHANGED_ENTRY ); |
253 Q_UNUSED(text); |
270 Q_UNUSED(text); |
254 mWizard->wizardHelper()->enableNextButton(showPage()); |
271 mWizard->wizardHelper()->enableNextButton(showPage()); |
|
272 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_TEXTCHANGED_EXIT ); |
255 } |
273 } |
256 |
274 |
257 /*! |
275 /*! |
258 Slot for stateChanged() signal from HbCheckBox. |
276 Slot for stateChanged() signal from HbCheckBox. |
259 |
277 |
260 @param [in] state NOT USED. |
278 @param [in] state NOT USED. |
261 */ |
279 */ |
262 void EapWizardPageIdentity::stateChanged(int state ) |
280 void EapWizardPageIdentity::stateChanged(int state ) |
263 { |
281 { |
|
282 OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_STATECHANGED_ENTRY ); |
264 Q_UNUSED(state); |
283 Q_UNUSED(state); |
265 mEditUsername->setEnabled(!mCheckUsername->isChecked()); |
284 mEditUsername->setEnabled(!mCheckUsername->isChecked()); |
266 mEditRealm->setEnabled(!mCheckRealm->isChecked()); |
285 mEditRealm->setEnabled(!mCheckRealm->isChecked()); |
267 mWizard->wizardHelper()->enableNextButton(showPage()); |
286 mWizard->wizardHelper()->enableNextButton(showPage()); |
|
287 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_STATECHANGED_EXIT ); |
268 } |
288 } |
269 |
289 |
270 /*! |
290 /*! |
271 Validates the settings group, that is line edit and checkbox using |
291 Validates the settings group, that is line edit and checkbox using |
272 given validator. |
292 given validator. |
273 |
293 |
274 @param [in] edit pointer to line edit to which content must be validated |
294 @param [in] edit pointer to line edit to which content must be validated |
275 @param [in] checkBox pointer to checkbox |
295 @param [in] checkBox pointer to checkbox |
276 @param [in] validator pointer to validator which is used to validate the content |
296 @param [in] validator pointer to validator which is used to validate the content |
277 of the line editor. |
297 of the line editor. |
278 |
298 |
279 @return true if validation is ok, false otherwise. |
299 @return true if validation is ok, false otherwise. |
280 */ |
300 */ |
281 bool EapWizardPageIdentity::validateGroup( |
301 bool EapWizardPageIdentity::validateGroup( |
282 HbLineEdit *edit, |
302 HbLineEdit *edit, |
283 HbCheckBox *checkBox, |
303 HbCheckBox *checkBox, |
284 EapQtValidator *validator) const |
304 EapQtValidator *validator) const |
285 { |
305 { |
|
306 OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_VALIDATEGROUP_ENTRY ); |
286 bool status = false; |
307 bool status = false; |
287 if (checkBox->isChecked() || |
308 if (checkBox->isChecked() || |
288 checkBox->isChecked() == false && |
309 checkBox->isChecked() == false && |
289 EapQtValidator::StatusOk == validator->validate(edit->text())) { |
310 EapQtValidator::StatusOk == validator->validate(edit->text())) { |
290 status = true; |
311 status = true; |
291 } |
312 } |
|
313 OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_VALIDATEGROUP_EXIT ); |
292 return status; |
314 return status; |
293 } |
315 } |