43 WlanWizardPrivate* parent) : |
43 WlanWizardPrivate* parent) : |
44 WlanWizardPageInternal(parent), |
44 WlanWizardPageInternal(parent), |
45 mWidget(NULL), |
45 mWidget(NULL), |
46 mList(NULL), |
46 mList(NULL), |
47 mLabel(NULL), |
47 mLabel(NULL), |
48 mLoader(NULL), |
48 mLoader(NULL) |
49 mValid(false) |
|
50 { |
49 { |
51 OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY ); |
50 OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY ); |
52 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT ); |
51 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT ); |
53 } |
52 } |
54 |
53 |
92 |
91 |
93 mLabel = qobject_cast<HbLabel*> (mLoader->findWidget("dialog_6")); |
92 mLabel = qobject_cast<HbLabel*> (mLoader->findWidget("dialog_6")); |
94 Q_ASSERT(mLabel != NULL); |
93 Q_ASSERT(mLabel != NULL); |
95 |
94 |
96 // Connect document loading to main window orientation changes. |
95 // Connect document loading to main window orientation changes. |
97 ok = connect(mWizard->mainWindow(), |
96 ok = connect( |
98 SIGNAL(orientationChanged(Qt::Orientation)), this, |
97 mWizard->mainWindow(), |
|
98 SIGNAL(orientationChanged(Qt::Orientation)), |
|
99 this, |
99 SLOT(loadDocmlSection(Qt::Orientation))); |
100 SLOT(loadDocmlSection(Qt::Orientation))); |
100 Q_ASSERT(ok); |
101 Q_ASSERT(ok); |
101 |
102 |
102 // Connect a function to a radio button selection. |
103 // Connect a function to a radio button selection. |
103 ok = connect(mList, SIGNAL(itemSelected(int)), this, |
104 ok = connect( |
|
105 mList, |
|
106 SIGNAL(itemSelected(int)), |
|
107 this, |
104 SLOT(itemSelected())); |
108 SLOT(itemSelected())); |
105 Q_ASSERT(ok); |
109 Q_ASSERT(ok); |
106 |
110 |
107 mLabel->setPlainText(hbTrId( |
111 mLabel->setPlainText(hbTrId( |
108 "txt_occ_dialog_select_network_mode_and_status")); |
112 "txt_occ_dialog_select_network_mode_and_status")); |
109 } |
113 } |
110 |
114 |
111 QStringList items; |
115 QStringList items; |
112 |
|
113 populateRadioButtonList(items); |
116 populateRadioButtonList(items); |
114 |
117 |
115 mList->setItems(items); |
118 // Do not override the list, if it didn't change, because setItems() |
|
119 // clears the possible selected item. |
|
120 if (items != mList->items()) { |
|
121 mList->setItems(items); |
|
122 } |
116 |
123 |
117 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_EXIT ); |
124 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_EXIT ); |
118 return mWidget; |
125 return mWidget; |
119 } |
126 } |
120 |
127 |
132 int index = mList->selected(); |
139 int index = mList->selected(); |
133 int nextPage = WlanWizardPageInternal::PageNetworkSecurity; |
140 int nextPage = WlanWizardPageInternal::PageNetworkSecurity; |
134 |
141 |
135 if (mWpsSupported.at(index)) { |
142 if (mWpsSupported.at(index)) { |
136 nextPage = WlanWizardPageInternal::PageWpsStart; |
143 nextPage = WlanWizardPageInternal::PageWpsStart; |
137 } |
144 } else { |
138 else { |
|
139 setting.mode = mNetworkModes.at(index); |
145 setting.mode = mNetworkModes.at(index); |
140 setting.hidden = mIsHidden.at(index); |
146 setting.hidden = mIsHidden.at(index); |
141 setting.wpsSupported = mWpsSupported.at(index); |
147 setting.wpsSupported = mWpsSupported.at(index); |
142 |
148 |
143 mWizard->setConfiguration( |
149 mWizard->setConfiguration( |
160 return nextPage; |
166 return nextPage; |
161 } |
167 } |
162 |
168 |
163 /*! |
169 /*! |
164 * This method is overrides the default implementation from WlanWizardPage. |
170 * This method is overrides the default implementation from WlanWizardPage. |
165 * It indicates whether the Next-button should be enabled or not. |
171 * @return Should the Next-button be enabled or not. |
166 * @return mValid, which is true if a radio button has been selected. |
|
167 */ |
172 */ |
168 bool WlanWizardPageNetworkMode::showPage() |
173 bool WlanWizardPageNetworkMode::showPage() |
169 { |
174 { |
170 OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_ENTRY ); |
175 OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_ENTRY ); |
171 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_EXIT ); |
176 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_EXIT ); |
172 return mValid; |
177 // Next-button is enabled whenever the radio button list has some value |
|
178 // selected. |
|
179 return mList->selected() != -1; |
173 } |
180 } |
174 |
181 |
175 /*! |
182 /*! |
176 * This function is invoked when user selects a mode from the radio button list. |
183 * This function is invoked when user selects a mode from the radio button list. |
177 * (HbRadioButtonList's itemSelected-signal) |
184 * (HbRadioButtonList's itemSelected-signal) |
180 { |
187 { |
181 OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_ENTRY ); |
188 OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_ENTRY ); |
182 OstTrace0( TRACE_BORDER, WLANWIZARDPAGENETWORKMODE_ITEMSELECTED, |
189 OstTrace0( TRACE_BORDER, WLANWIZARDPAGENETWORKMODE_ITEMSELECTED, |
183 "WlanWizardPageNetworkMode::itemSelected" ); |
190 "WlanWizardPageNetworkMode::itemSelected" ); |
184 |
191 |
185 mValid = true; |
192 mWizard->enableNextButton(true); |
186 mWizard->enableNextButton(mValid); |
|
187 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_EXIT ); |
193 OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_EXIT ); |
188 } |
194 } |
189 |
195 |
190 /*! |
196 /*! |
191 * Loads the document orientation information from occ_add_wlan_02_03.docml. |
197 * Loads the document orientation information from occ_add_wlan_02_03.docml. |
245 mNetworkModes.append(mode); |
251 mNetworkModes.append(mode); |
246 mIsHidden.append(isHidden); |
252 mIsHidden.append(isHidden); |
247 mWpsSupported.append(wpsSupported); |
253 mWpsSupported.append(wpsSupported); |
248 } |
254 } |
249 } |
255 } |
250 } |
256 } else { |
251 else { |
|
252 list << item; |
257 list << item; |
253 mNetworkModes.append(mode); |
258 mNetworkModes.append(mode); |
254 mIsHidden.append(isHidden); |
259 mIsHidden.append(isHidden); |
255 // If there are no known network options, WPS is not allowed to be |
260 // If there are no known network options, WPS is not allowed to be |
256 // selected. |
261 // selected. |
269 list.clear(); |
274 list.clear(); |
270 mNetworkModes.clear(); |
275 mNetworkModes.clear(); |
271 mIsHidden.clear(); |
276 mIsHidden.clear(); |
272 mWpsSupported.clear(); |
277 mWpsSupported.clear(); |
273 |
278 |
274 // A list is created. Since there is no practical way of knowing whether |
279 addToList( |
275 // the new contents are different from the previous contents (if there |
280 list, |
276 // even were any in the first place) the validity is always reset. |
281 hbTrId("txt_occ_dblist_val_infrastructure_public"), |
277 mValid = false; |
282 CMManagerShim::Infra, |
278 |
283 false, |
279 addToList(list, hbTrId("txt_occ_dblist_val_infrastructure_public"), |
284 false); |
280 CMManagerShim::Infra, false, false); |
285 |
281 |
286 addToList( |
282 addToList(list, hbTrId("txt_occ_list_infrastructure_hidden"), |
287 list, |
283 CMManagerShim::Infra, true, false); |
288 hbTrId("txt_occ_list_infrastructure_hidden"), |
284 |
289 CMManagerShim::Infra, |
285 addToList(list, hbTrId("txt_occ_list_adhoc_1"), CMManagerShim::Adhoc, |
290 true, |
286 false, false); |
291 false); |
|
292 |
|
293 addToList( |
|
294 list, |
|
295 hbTrId("txt_occ_list_adhoc_1"), |
|
296 CMManagerShim::Adhoc, |
|
297 false, |
|
298 false); |
287 |
299 |
288 if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) { |
300 if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) { |
289 // addToList with wpsSupported=true is only called, when there are available |
301 // addToList with wpsSupported=true is only called, when there are available |
290 // scan result options. If no network options exist, the user can not get to |
302 // scan result options. If no network options exist, the user can not get to |
291 // wps wizard from this view. Also, mode and isHidden are "don't care". |
303 // wps wizard from this view. Also, mode and isHidden are "don't care". |