7 #include <qglobal.h> |
7 #include <qglobal.h> |
8 #include <QtGui> |
8 #include <QtGui> |
9 #include <hbaction.h> |
9 #include <hbaction.h> |
10 #include <qdir.h> |
10 #include <qdir.h> |
11 #include <hbmainwindow.h> |
11 #include <hbmainwindow.h> |
|
12 #include <hbaction.h> |
12 // --------------------------------------------------------------------------- |
13 // --------------------------------------------------------------------------- |
13 // --------------------------------------------------------------------------- |
14 // --------------------------------------------------------------------------- |
14 // |
15 // |
15 void SearchStateProviderTest::testsettingswizardConstruction() |
16 void SearchStateProviderTest::testsettingswizardConstruction() |
16 { |
17 { |
29 { |
30 { |
30 SettingsWidget* settingswizard = new SettingsWidget(); |
31 SettingsWidget* settingswizard = new SettingsWidget(); |
31 |
32 |
32 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
33 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
33 settingswizard->mCategoryDbMapping.insert("Messages", true); |
34 settingswizard->mCategoryDbMapping.insert("Messages", true); |
|
35 HbAction * action = new HbAction(); |
|
36 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
37 settingswizard->mActions.append(action); |
|
38 |
|
39 action = new HbAction(); |
|
40 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
41 settingswizard->mActions.append(action); |
34 |
42 |
35 settingswizard->q_currentIndexChanged(0); |
43 settingswizard->q_currentIndexChanged(0); |
36 |
44 |
37 for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++) |
45 for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++) |
38 (settingswizard->mDeviceCheckBoxList.at(i))->setCheckState( |
46 (settingswizard->mDeviceCheckBoxList.at(i))->setCheckState( |
86 void SearchStateProviderTest::testlaunchSettingWidget() |
94 void SearchStateProviderTest::testlaunchSettingWidget() |
87 { |
95 { |
88 SettingsWidget* settingswizard = new SettingsWidget(); |
96 SettingsWidget* settingswizard = new SettingsWidget(); |
89 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
97 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
90 settingswizard->mCategoryDbMapping.insert("Messages", true); |
98 settingswizard->mCategoryDbMapping.insert("Messages", true); |
|
99 HbAction * action = new HbAction(); |
|
100 // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
101 settingswizard->mActions.append(action); |
|
102 |
|
103 action = new HbAction(); |
|
104 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
105 settingswizard->mActions.append(action); |
91 |
106 |
92 settingswizard->q_currentIndexChanged(0); |
107 settingswizard->q_currentIndexChanged(0); |
93 settingswizard->launchSettingWidget(); |
108 settingswizard->launchSettingWidget(); |
94 |
109 |
95 delete settingswizard; |
110 delete settingswizard; |
159 { |
174 { |
160 SettingsWidget* settingswizard = new SettingsWidget(); |
175 SettingsWidget* settingswizard = new SettingsWidget(); |
161 |
176 |
162 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
177 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
163 settingswizard->mCategoryDbMapping.insert("Messages", true); |
178 settingswizard->mCategoryDbMapping.insert("Messages", true); |
|
179 HbAction * action = new HbAction(); |
|
180 // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
181 settingswizard->mActions.append(action); |
|
182 |
|
183 action = new HbAction(); |
|
184 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
185 settingswizard->mActions.append(action); |
164 |
186 |
165 settingswizard->q_currentIndexChanged(0); |
187 settingswizard->q_currentIndexChanged(0); |
166 |
188 |
167 QSignalSpy spy(settingswizard, SIGNAL(settingsEvent(bool))); |
189 QSignalSpy spy(settingswizard, SIGNAL(settingsEvent(bool))); |
168 settingswizard->checkBoxOkEvent(); |
190 settingswizard->checkBoxOkEvent(); |
174 { |
196 { |
175 SettingsWidget* settingswizard = new SettingsWidget(); |
197 SettingsWidget* settingswizard = new SettingsWidget(); |
176 |
198 |
177 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
199 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
178 settingswizard->mCategoryDbMapping.insert("Messages", true); |
200 settingswizard->mCategoryDbMapping.insert("Messages", true); |
|
201 |
|
202 HbAction * action = new HbAction(); |
|
203 // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
204 settingswizard->mActions.append(action); |
|
205 |
|
206 action = new HbAction(); |
|
207 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
208 settingswizard->mActions.append(action); |
179 |
209 |
180 settingswizard->q_currentIndexChanged(0); |
210 settingswizard->q_currentIndexChanged(0); |
181 QSignalSpy spy(settingswizard, SIGNAL(settingsEvent(bool))); |
211 QSignalSpy spy(settingswizard, SIGNAL(settingsEvent(bool))); |
182 settingswizard->checkBoxCancelEvent(); |
212 settingswizard->checkBoxCancelEvent(); |
183 QCOMPARE(spy.count(), 1); |
213 QCOMPARE(spy.count(), 1); |
188 { |
218 { |
189 SettingsWidget* settingswizard = new SettingsWidget(); |
219 SettingsWidget* settingswizard = new SettingsWidget(); |
190 settingswizard->initialize(); |
220 settingswizard->initialize(); |
191 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
221 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
192 settingswizard->mCategoryDbMapping.insert("Messages", true); |
222 settingswizard->mCategoryDbMapping.insert("Messages", true); |
|
223 HbAction * action = new HbAction(); |
|
224 // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
225 settingswizard->mActions.append(action); |
|
226 |
|
227 action = new HbAction(); |
|
228 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
229 settingswizard->mActions.append(action); |
193 |
230 |
194 settingswizard->q_currentIndexChanged(0); |
231 settingswizard->q_currentIndexChanged(0); |
195 |
232 |
196 settingswizard->mDeviceCheckBoxList.at(0)->setCheckState(Qt::Unchecked); |
233 settingswizard->mDeviceCheckBoxList.at(0)->setCheckState(Qt::Unchecked); |
197 |
234 |
218 SettingsWidget* settingswizard = new SettingsWidget(); |
255 SettingsWidget* settingswizard = new SettingsWidget(); |
219 |
256 |
220 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
257 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
221 settingswizard->mCategoryDbMapping.insert("Messages", true); |
258 settingswizard->mCategoryDbMapping.insert("Messages", true); |
222 settingswizard->initialize(); |
259 settingswizard->initialize(); |
|
260 HbAction * action = new HbAction(); |
|
261 // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
262 settingswizard->mActions.append(action); |
|
263 |
|
264 action = new HbAction(); |
|
265 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
266 settingswizard->mActions.append(action); |
223 |
267 |
224 settingswizard->q_currentIndexChanged(0); |
268 settingswizard->q_currentIndexChanged(0); |
225 settingswizard->q_currentIndexChanged(1); |
269 settingswizard->q_currentIndexChanged(1); |
226 delete settingswizard; |
270 delete settingswizard; |
227 } |
271 } |
229 { |
273 { |
230 SettingsWidget* settingswizard = new SettingsWidget(); |
274 SettingsWidget* settingswizard = new SettingsWidget(); |
231 |
275 |
232 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
276 settingswizard->mCategoryDbMapping.insert("Contacts", true); |
233 settingswizard->mCategoryDbMapping.insert("Messages", true); |
277 settingswizard->mCategoryDbMapping.insert("Messages", true); |
|
278 HbAction * action = new HbAction(); |
|
279 // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent())); |
|
280 settingswizard->mActions.append(action); |
|
281 |
|
282 action = new HbAction(); |
|
283 //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent())); |
|
284 settingswizard->mActions.append(action); |
234 settingswizard->q_currentIndexChanged(0); |
285 settingswizard->q_currentIndexChanged(0); |
235 QSignalSpy spy(settingswizard, SIGNAL(selectedItemCategory(int,bool))); |
286 QSignalSpy spy(settingswizard, SIGNAL(selectedItemCategory(int,bool))); |
236 settingswizard->loadDeviceSettings(); |
287 settingswizard->loadDeviceSettings(); |
237 QVERIFY(spy.count()); |
288 QVERIFY(spy.count()); |
238 delete settingswizard; |
289 delete settingswizard; |