36 #include "clocksettingsdocloader.h" |
36 #include "clocksettingsdocloader.h" |
37 #include "settingsutility.h" |
37 #include "settingsutility.h" |
38 #include "timezoneclient.h" |
38 #include "timezoneclient.h" |
39 #include "settingsdatatypes.h" |
39 #include "settingsdatatypes.h" |
40 #include "settingscustomitem.h" |
40 #include "settingscustomitem.h" |
|
41 #include "OstTraceDefinitions.h" |
|
42 #ifdef OST_TRACE_COMPILER_IN_USE |
|
43 #include "clocksettingsviewTraces.h" |
|
44 #endif |
|
45 |
41 |
46 |
42 /*! |
47 /*! |
43 \class ClockSettingsView |
48 \class ClockSettingsView |
44 |
49 |
45 This implements the clock settings which allows user to set the |
50 This implements the clock settings which allows user to set the |
52 \param parent The parent of type QGraphicsWidget. |
57 \param parent The parent of type QGraphicsWidget. |
53 */ |
58 */ |
54 ClockSettingsView::ClockSettingsView(QObject *parent) |
59 ClockSettingsView::ClockSettingsView(QObject *parent) |
55 :QObject(parent) |
60 :QObject(parent) |
56 { |
61 { |
|
62 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_ENTRY ); |
57 |
63 |
58 // Load the translation file and install the editor specific translator |
64 // Load the translation file and install the editor specific translator |
59 mTranslator = new HbTranslator("clocksettingsview"); |
65 mTranslator = new HbTranslator("clocksettingsview"); |
60 mTranslator->loadCommon(); |
66 mTranslator->loadCommon(); |
61 |
67 |
100 |
106 |
101 // Listen to the key value changes. |
107 // Listen to the key value changes. |
102 connect( |
108 connect( |
103 mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), |
109 mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), |
104 this, SLOT(eventMonitor(XQSettingsKey, QVariant))); |
110 this, SLOT(eventMonitor(XQSettingsKey, QVariant))); |
|
111 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_EXIT ); |
105 } |
112 } |
106 |
113 |
107 /*! |
114 /*! |
108 Destructor. |
115 Destructor. |
109 */ |
116 */ |
110 ClockSettingsView::~ClockSettingsView() |
117 ClockSettingsView::~ClockSettingsView() |
111 { |
118 { |
|
119 OstTraceFunctionEntry0( DUP1_CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_ENTRY ); |
112 if (mDocLoader) { |
120 if (mDocLoader) { |
113 delete mDocLoader; |
121 delete mDocLoader; |
114 } |
122 } |
115 |
123 |
116 // Remove the translator |
124 // Remove the translator |
125 if(mSettingsModel){ |
133 if(mSettingsModel){ |
126 delete mSettingsModel; |
134 delete mSettingsModel; |
127 } |
135 } |
128 |
136 |
129 |
137 |
|
138 OstTraceFunctionExit0( DUP1_CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_EXIT ); |
130 } |
139 } |
131 |
140 |
132 /*! |
141 /*! |
133 Loads the settings view from the docml. |
142 Loads the settings view from the docml. |
134 */ |
143 */ |
135 void ClockSettingsView::loadSettingsView() |
144 void ClockSettingsView::loadSettingsView() |
136 { |
145 { |
|
146 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_LOADSETTINGSVIEW_ENTRY ); |
137 bool loadSuccess; |
147 bool loadSuccess; |
138 |
148 |
139 // Construct the document loader instance |
149 // Construct the document loader instance |
140 mDocLoader = new ClockSettingsDocLoader(); |
150 mDocLoader = new ClockSettingsDocLoader(); |
141 |
151 |
170 mDocLoader->findWidget(CLOCK_SETTINGS_VIEW)); |
180 mDocLoader->findWidget(CLOCK_SETTINGS_VIEW)); |
171 |
181 |
172 // Setup the view. |
182 // Setup the view. |
173 setupView(); |
183 setupView(); |
174 |
184 |
|
185 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_LOADSETTINGSVIEW_EXIT ); |
175 } |
186 } |
176 |
187 |
177 /*! |
188 /*! |
178 Slot to handle the back action of the view. |
189 Slot to handle the back action of the view. |
179 */ |
190 */ |
180 void ClockSettingsView::handleBackAction() |
191 void ClockSettingsView::handleBackAction() |
181 { |
192 { |
|
193 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLEBACKACTION_ENTRY ); |
182 HbMainWindow *window = hbInstance->allMainWindows().first(); |
194 HbMainWindow *window = hbInstance->allMainWindows().first(); |
183 window->removeView(mSettingsView); |
195 window->removeView(mSettingsView); |
184 deleteLater(); |
196 deleteLater(); |
|
197 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLEBACKACTION_EXIT ); |
185 } |
198 } |
186 |
199 |
187 /*! |
200 /*! |
188 Updates the zone info in the place item field. |
201 Updates the zone info in the place item field. |
189 */ |
202 */ |
190 void ClockSettingsView::updatePlaceItem() |
203 void ClockSettingsView::updatePlaceItem() |
191 { |
204 { |
|
205 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_UPDATEPLACEITEM_ENTRY ); |
192 // Get the current zone info. |
206 // Get the current zone info. |
193 LocationInfo currentZoneInfo = mTimezoneClient->getCurrentZoneInfoL(); |
207 LocationInfo currentZoneInfo = mTimezoneClient->getCurrentZoneInfoL(); |
194 |
208 |
195 if (mTimezoneClient->timeUpdateOn()) { |
209 if (mTimezoneClient->timeUpdateOn()) { |
196 mPlaceDataFormItem->setContentWidgetData( |
210 mPlaceDataFormItem->setContentWidgetData( |
198 } else { |
212 } else { |
199 QString placeInfo = currentZoneInfo.cityName |
213 QString placeInfo = currentZoneInfo.cityName |
200 + tr(", ") + currentZoneInfo.countryName; |
214 + tr(", ") + currentZoneInfo.countryName; |
201 mPlaceDataFormItem->setContentWidgetData("text", placeInfo); |
215 mPlaceDataFormItem->setContentWidgetData("text", placeInfo); |
202 } |
216 } |
|
217 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_UPDATEPLACEITEM_EXIT ); |
203 } |
218 } |
204 |
219 |
205 /*! |
220 /*! |
206 Slot to update the display of the date settings item field. |
221 Slot to update the display of the date settings item field. |
207 */ |
222 */ |
208 void ClockSettingsView::updateDateItem() |
223 void ClockSettingsView::updateDateItem() |
209 { |
224 { |
|
225 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_UPDATEDATEITEM_ENTRY ); |
210 mDateDataFormItem->setContentWidgetData("text", mSettingsUtility->date()); |
226 mDateDataFormItem->setContentWidgetData("text", mSettingsUtility->date()); |
|
227 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_UPDATEDATEITEM_EXIT ); |
211 } |
228 } |
212 |
229 |
213 /*! |
230 /*! |
214 Slot to update the display of the time settings item field. |
231 Slot to update the display of the time settings item field. |
215 */ |
232 */ |
216 void ClockSettingsView::updateTimeItem() |
233 void ClockSettingsView::updateTimeItem() |
217 { |
234 { |
|
235 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_UPDATETIMEITEM_ENTRY ); |
218 if (!mTickTimer->isActive()) { |
236 if (!mTickTimer->isActive()) { |
219 mTickTimer->stop(); |
237 mTickTimer->stop(); |
220 } |
238 } |
221 mTimeDataFormItem->setContentWidgetData("text", mSettingsUtility->time()); |
239 mTimeDataFormItem->setContentWidgetData("text", mSettingsUtility->time()); |
222 |
240 |
223 // Start the timer again. |
241 // Start the timer again. |
224 mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); |
242 mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); |
|
243 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_UPDATETIMEITEM_EXIT ); |
225 } |
244 } |
226 |
245 |
227 /*! |
246 /*! |
228 This slot is called whenever orientattion of the view changes. |
247 This slot is called whenever orientattion of the view changes. |
229 */ |
248 */ |
230 void ClockSettingsView::handleOrientationChanged(Qt::Orientation orientation) |
249 void ClockSettingsView::handleOrientationChanged(Qt::Orientation orientation) |
231 { |
250 { |
|
251 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLEORIENTATIONCHANGED_ENTRY ); |
232 bool success; |
252 bool success; |
233 // If horizontal, load the landscape section. |
253 // If horizontal, load the landscape section. |
234 if (Qt::Horizontal == orientation) { |
254 if (Qt::Horizontal == orientation) { |
235 mDocLoader->load( |
255 mDocLoader->load( |
236 CLOCK_SETTINGS_VIEW_DOCML, |
256 CLOCK_SETTINGS_VIEW_DOCML, |
240 mDocLoader->load( |
260 mDocLoader->load( |
241 CLOCK_SETTINGS_VIEW_DOCML, |
261 CLOCK_SETTINGS_VIEW_DOCML, |
242 CLOCK_SETTINGS_VIEW_PORTRAIT_SECTION, |
262 CLOCK_SETTINGS_VIEW_PORTRAIT_SECTION, |
243 &success); |
263 &success); |
244 } |
264 } |
|
265 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLEORIENTATIONCHANGED_EXIT ); |
245 } |
266 } |
246 |
267 |
247 void ClockSettingsView::handleNetworkTimeStateChange(int state) |
268 void ClockSettingsView::handleNetworkTimeStateChange(int state) |
248 { |
269 { |
|
270 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLENETWORKTIMESTATECHANGE_ENTRY ); |
249 bool cenrepValue = mTimezoneClient->timeUpdateOn(); |
271 bool cenrepValue = mTimezoneClient->timeUpdateOn(); |
250 if ((Qt::Checked == state && !cenrepValue) |
272 if ((Qt::Checked == state && !cenrepValue) |
251 || (Qt::Unchecked == state && cenrepValue)) { |
273 || (Qt::Unchecked == state && cenrepValue)) { |
252 if (Qt::Checked == state) { |
274 if (Qt::Checked == state) { |
253 // Update the cenrep value. |
275 // Update the cenrep value. |
256 } else if (Qt::Unchecked == state) { |
278 } else if (Qt::Unchecked == state) { |
257 // Update the cenrep value. |
279 // Update the cenrep value. |
258 mTimezoneClient->setTimeUpdateOn(false); |
280 mTimezoneClient->setTimeUpdateOn(false); |
259 } |
281 } |
260 } |
282 } |
|
283 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLENETWORKTIMESTATECHANGE_EXIT ); |
261 } |
284 } |
262 |
285 |
263 /*! |
286 /*! |
264 Called after loading the view from the docml. |
287 Called after loading the view from the docml. |
265 The initializaion/setup of the view is done here. |
288 The initializaion/setup of the view is done here. |
266 |
289 |
267 \param docLoader Pointer to ClockSettingsDocLoader object. |
290 \param docLoader Pointer to ClockSettingsDocLoader object. |
268 */ |
291 */ |
269 void ClockSettingsView::setupView() |
292 void ClockSettingsView::setupView() |
270 { |
293 { |
|
294 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_SETUPVIEW_ENTRY ); |
271 HbMainWindow *window = hbInstance->allMainWindows().first(); |
295 HbMainWindow *window = hbInstance->allMainWindows().first(); |
272 window->addView(mSettingsView); |
296 window->addView(mSettingsView); |
273 window->setCurrentView(mSettingsView); |
297 window->setCurrentView(mSettingsView); |
274 |
298 |
275 // Add the back softkey. |
299 // Add the back softkey. |
292 // Create the model. |
316 // Create the model. |
293 createModel(); |
317 createModel(); |
294 updatePlaceItem(); |
318 updatePlaceItem(); |
295 |
319 |
296 mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); |
320 mTickTimer->start(60000 - 1000 * QTime::currentTime().second()); |
|
321 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_SETUPVIEW_EXIT ); |
297 } |
322 } |
298 |
323 |
299 /*! |
324 /*! |
300 Creates the model for the settings form. |
325 Creates the model for the settings form. |
301 */ |
326 */ |
302 void ClockSettingsView::createModel() |
327 void ClockSettingsView::createModel() |
303 { |
328 { |
|
329 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_CREATEMODEL_ENTRY ); |
304 // Remove the model. |
330 // Remove the model. |
305 if (mSettingsForm->model()) { |
331 if (mSettingsForm->model()) { |
306 delete mSettingsForm->model(); |
332 delete mSettingsForm->model(); |
307 mSettingsForm->setModel(0); |
333 mSettingsForm->setModel(0); |
308 } |
334 } |
310 // Create a model and set it. |
336 // Create a model and set it. |
311 mSettingsModel = new HbDataFormModel(); |
337 mSettingsModel = new HbDataFormModel(); |
312 // Add the items to the view. |
338 // Add the items to the view. |
313 populateModel(); |
339 populateModel(); |
314 mSettingsForm->setModel(mSettingsModel); |
340 mSettingsForm->setModel(mSettingsModel); |
|
341 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_CREATEMODEL_EXIT ); |
315 } |
342 } |
316 |
343 |
317 /*! |
344 /*! |
318 Poplulates the item in the model. |
345 Poplulates the item in the model. |
319 */ |
346 */ |
320 void ClockSettingsView::populateModel() |
347 void ClockSettingsView::populateModel() |
321 { |
348 { |
|
349 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_POPULATEMODEL_ENTRY ); |
322 if (!mSettingsModel) { |
350 if (!mSettingsModel) { |
323 createModel(); |
351 createModel(); |
324 } |
352 } |
325 |
353 |
326 // Add the network time update item. |
354 // Add the network time update item. |
333 } |
361 } |
334 mNetworkTimeItem->setContentWidgetData( |
362 mNetworkTimeItem->setContentWidgetData( |
335 "checkState", state); |
363 "checkState", state); |
336 mNetworkTimeItem->setContentWidgetData( |
364 mNetworkTimeItem->setContentWidgetData( |
337 "text", QString(hbTrId("txt_clk_setlabel_use_network_date_time"))); |
365 "text", QString(hbTrId("txt_clk_setlabel_use_network_date_time"))); |
|
366 mNetworkTimeItem->setContentWidgetData("objectName", "networkTime"); |
338 mSettingsForm->addConnection( |
367 mSettingsForm->addConnection( |
339 mNetworkTimeItem, SIGNAL(stateChanged(int)), |
368 mNetworkTimeItem, SIGNAL(stateChanged(int)), |
340 this, SLOT(handleNetworkTimeStateChange(int))); |
369 this, SLOT(handleNetworkTimeStateChange(int))); |
341 |
370 |
342 // Add the time item. |
371 // Add the time item. |
345 static_cast<HbDataFormModelItem::DataItemType> |
374 static_cast<HbDataFormModelItem::DataItemType> |
346 (HbDataFormModelItem::CustomItemBase + TimeItem); |
375 (HbDataFormModelItem::CustomItemBase + TimeItem); |
347 mTimeDataFormItem = mSettingsModel->appendDataFormItem( |
376 mTimeDataFormItem = mSettingsModel->appendDataFormItem( |
348 timeItemType, QString(hbTrId("txt_clock_setlabel_time"))); |
377 timeItemType, QString(hbTrId("txt_clock_setlabel_time"))); |
349 mTimeDataFormItem->setContentWidgetData("text", mSettingsUtility->time()); |
378 mTimeDataFormItem->setContentWidgetData("text", mSettingsUtility->time()); |
|
379 mTimeDataFormItem->setContentWidgetData("objectName", "timeItem"); |
350 |
380 |
351 // Add the date item. |
381 // Add the date item. |
352 // Custom data type for adding a time button to the data form. |
382 // Custom data type for adding a time button to the data form. |
353 HbDataFormModelItem::DataItemType dateItemType = |
383 HbDataFormModelItem::DataItemType dateItemType = |
354 static_cast<HbDataFormModelItem::DataItemType> |
384 static_cast<HbDataFormModelItem::DataItemType> |
355 (HbDataFormModelItem::CustomItemBase + DateItem); |
385 (HbDataFormModelItem::CustomItemBase + DateItem); |
356 mDateDataFormItem = mSettingsModel->appendDataFormItem( |
386 mDateDataFormItem = mSettingsModel->appendDataFormItem( |
357 dateItemType, QString(hbTrId("txt_clock_setlabel_date"))); |
387 dateItemType, QString(hbTrId("txt_clock_setlabel_date"))); |
358 mDateDataFormItem->setContentWidgetData("text", mSettingsUtility->date()); |
388 mDateDataFormItem->setContentWidgetData("text", mSettingsUtility->date()); |
|
389 mDateDataFormItem->setContentWidgetData("objectName", "dateItem"); |
359 |
390 |
360 // Add the place item. |
391 // Add the place item. |
361 HbDataFormModelItem::DataItemType placeItemType = |
392 HbDataFormModelItem::DataItemType placeItemType = |
362 static_cast<HbDataFormModelItem::DataItemType> |
393 static_cast<HbDataFormModelItem::DataItemType> |
363 (HbDataFormModelItem::CustomItemBase + PlaceItem); |
394 (HbDataFormModelItem::CustomItemBase + PlaceItem); |
370 placeItemText.append(currentZoneInfo.cityName); |
401 placeItemText.append(currentZoneInfo.cityName); |
371 placeItemText+= tr(", "); |
402 placeItemText+= tr(", "); |
372 } |
403 } |
373 placeItemText.append(currentZoneInfo.countryName); |
404 placeItemText.append(currentZoneInfo.countryName); |
374 mPlaceDataFormItem->setContentWidgetData("text", placeItemText); |
405 mPlaceDataFormItem->setContentWidgetData("text", placeItemText); |
|
406 mPlaceDataFormItem->setContentWidgetData("objectName", "placeItem"); |
375 |
407 |
376 if (networkTime) { |
408 if (networkTime) { |
377 mTimeDataFormItem->setEnabled(false); |
409 mTimeDataFormItem->setEnabled(false); |
378 mDateDataFormItem->setEnabled(false); |
410 mDateDataFormItem->setEnabled(false); |
379 mPlaceDataFormItem->setEnabled(false); |
411 mPlaceDataFormItem->setEnabled(false); |
385 |
417 |
386 // Add the regional settings item. |
418 // Add the regional settings item. |
387 HbDataFormModelItem::DataItemType regionalSettingsItem = |
419 HbDataFormModelItem::DataItemType regionalSettingsItem = |
388 static_cast<HbDataFormModelItem::DataItemType> |
420 static_cast<HbDataFormModelItem::DataItemType> |
389 (HbDataFormModelItem::CustomItemBase + RegionalSettingsItem); |
421 (HbDataFormModelItem::CustomItemBase + RegionalSettingsItem); |
390 mSettingsModel->appendDataFormItem(regionalSettingsItem); |
422 mRegionalDataFormItem = mSettingsModel->appendDataFormItem( |
|
423 regionalSettingsItem); |
|
424 mRegionalDataFormItem->setContentWidgetData( |
|
425 "text", hbTrId("txt_clock_button_regional_date_time_settings")); |
|
426 mRegionalDataFormItem->setContentWidgetData( |
|
427 "objectName", "regionalSettings"); |
391 |
428 |
392 // Add the clock type item. |
429 // Add the clock type item. |
393 HbDataFormModelItem::DataItemType clockTypeSettingsItem = |
430 HbDataFormModelItem::DataItemType clockTypeSettingsItem = |
394 static_cast<HbDataFormModelItem::DataItemType> |
431 static_cast<HbDataFormModelItem::DataItemType> |
395 (HbDataFormModelItem::ToggleValueItem); |
432 (HbDataFormModelItem::ToggleValueItem); |
403 mClockTypeItem->setContentWidgetData("additionalText", clockTypeList[1]); |
440 mClockTypeItem->setContentWidgetData("additionalText", clockTypeList[1]); |
404 } else { |
441 } else { |
405 mClockTypeItem->setContentWidgetData("text", clockTypeList[1]); |
442 mClockTypeItem->setContentWidgetData("text", clockTypeList[1]); |
406 mClockTypeItem->setContentWidgetData("additionalText", clockTypeList[0]); |
443 mClockTypeItem->setContentWidgetData("additionalText", clockTypeList[0]); |
407 } |
444 } |
|
445 mClockTypeItem->setContentWidgetData("objectName", "clockType"); |
408 mSettingsForm->addConnection( |
446 mSettingsForm->addConnection( |
409 mClockTypeItem, SIGNAL(clicked()), |
447 mClockTypeItem, SIGNAL(clicked()), |
410 this, SLOT(handleClockTypeChanged())); |
448 this, SLOT(handleClockTypeChanged())); |
411 |
449 |
412 // Add the alarm snooze time item. |
450 // Add the alarm snooze time item. |
413 mAlarmSnoozeItem = mSettingsModel->appendDataFormItem( |
451 mAlarmSnoozeItem = mSettingsModel->appendDataFormItem( |
414 HbDataFormModelItem::ComboBoxItem, |
452 HbDataFormModelItem::ComboBoxItem, |
415 hbTrId("txt_clock_setlabel_alarm_snooze_time")); |
453 hbTrId("txt_clock_setlabel_alarm_snooze_time")); |
416 QStringList alramSnoozeTimes; |
454 QStringList alramSnoozeTimes; |
417 alramSnoozeTimes << hbTrId("txt_clock_set_ln_mins", 5) |
455 alramSnoozeTimes << hbTrId("txt_clock_setlabel_ln_mins", 5) |
418 << hbTrId("txt_clock_set_ln_mins", 10) |
456 << hbTrId("txt_clock_setlabel_ln_mins", 10) |
419 << hbTrId("txt_clock_set_ln_mins", 15) |
457 << hbTrId("txt_clock_setlabel_ln_mins", 15) |
420 << hbTrId("txt_clock_set_ln_mins", 30); |
458 << hbTrId("txt_clock_setlabel_ln_mins", 30); |
421 |
459 |
422 // Build the hash map for the reminder. |
460 // Build the hash map for the reminder. |
423 mAlarmSnoozeTimeHash[0] = 5; |
461 mAlarmSnoozeTimeHash[0] = 5; |
424 mAlarmSnoozeTimeHash[1] = 10; |
462 mAlarmSnoozeTimeHash[1] = 10; |
425 mAlarmSnoozeTimeHash[2] = 15; |
463 mAlarmSnoozeTimeHash[2] = 15; |
434 index = mAlarmSnoozeTimeHash.key(alarmSnoozeTime); |
472 index = mAlarmSnoozeTimeHash.key(alarmSnoozeTime); |
435 } else { |
473 } else { |
436 index = mAlarmSnoozeTimeHash.key(15); |
474 index = mAlarmSnoozeTimeHash.key(15); |
437 } |
475 } |
438 mAlarmSnoozeItem->setContentWidgetData("currentIndex", index); |
476 mAlarmSnoozeItem->setContentWidgetData("currentIndex", index); |
|
477 mAlarmSnoozeItem->setContentWidgetData("objectName", "alarmSnooze"); |
439 mSettingsForm->addConnection( |
478 mSettingsForm->addConnection( |
440 mAlarmSnoozeItem, SIGNAL(currentIndexChanged(int)), |
479 mAlarmSnoozeItem, SIGNAL(currentIndexChanged(int)), |
441 this, SLOT(handleAlarmSnoozeTimeChanged(int))); |
480 this, SLOT(handleAlarmSnoozeTimeChanged(int))); |
442 |
481 |
|
482 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_POPULATEMODEL_EXIT ); |
443 } |
483 } |
444 |
484 |
445 /*! |
485 /*! |
446 Slot which handles the auto time update value changes in cenrep. |
486 Slot which handles the auto time update value changes in cenrep. |
447 |
487 |
448 /param value New value of the auto time update. |
488 /param value New value of the auto time update. |
449 */ |
489 */ |
450 void ClockSettingsView::handleAutoTimeUpdateChange(int value) |
490 void ClockSettingsView::handleAutoTimeUpdateChange(int value) |
451 { |
491 { |
|
492 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLEAUTOTIMEUPDATECHANGE_ENTRY ); |
452 int state = (mNetworkTimeItem->contentWidgetData("checkState")).toInt(); |
493 int state = (mNetworkTimeItem->contentWidgetData("checkState")).toInt(); |
453 |
494 |
454 if (value) { |
495 if (value) { |
455 // Disable the time, date and place item. |
496 // Disable the time, date and place item. |
456 if (mTimeDataFormItem) { |
497 if (mTimeDataFormItem) { |
481 mNetworkTimeItem->setContentWidgetData( |
522 mNetworkTimeItem->setContentWidgetData( |
482 "checkState", Qt::Unchecked); |
523 "checkState", Qt::Unchecked); |
483 } |
524 } |
484 } |
525 } |
485 updatePlaceItem(); |
526 updatePlaceItem(); |
|
527 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLEAUTOTIMEUPDATECHANGE_EXIT ); |
486 } |
528 } |
487 |
529 |
488 /*! |
530 /*! |
489 Slot which handles the alarm snooze time changes. |
531 Slot which handles the alarm snooze time changes. |
490 |
532 |
491 /param value New index of the alarm snooze time. |
533 /param value New index of the alarm snooze time. |
492 */ |
534 */ |
493 void ClockSettingsView::handleAlarmSnoozeTimeChanged(int index) |
535 void ClockSettingsView::handleAlarmSnoozeTimeChanged(int index) |
494 { |
536 { |
|
537 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLEALARMSNOOZETIMECHANGED_ENTRY ); |
495 if (mAlarmSnoozeTimeHash.value(index)) { |
538 if (mAlarmSnoozeTimeHash.value(index)) { |
496 mSettingsManager->writeItemValue( |
539 mSettingsManager->writeItemValue( |
497 *mAlarmSnoozeTimeKey, mAlarmSnoozeTimeHash.value(index)); |
540 *mAlarmSnoozeTimeKey, mAlarmSnoozeTimeHash.value(index)); |
498 } |
541 } |
|
542 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLEALARMSNOOZETIMECHANGED_EXIT ); |
499 } |
543 } |
500 |
544 |
501 /*! |
545 /*! |
502 Slot which handles the clock type change.. |
546 Slot which handles the clock type change.. |
503 */ |
547 */ |
504 void ClockSettingsView::handleClockTypeChanged() |
548 void ClockSettingsView::handleClockTypeChanged() |
505 { |
549 { |
506 mSettingsUtility->setClockType( |
550 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLECLOCKTYPECHANGED_ENTRY ); |
507 mClockTypeItem->contentWidgetData("text").toString()); |
551 mSettingsUtility->setClockType( |
|
552 mClockTypeItem->contentWidgetData("text").toString()); |
|
553 OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLECLOCKTYPECHANGED_EXIT ); |
508 } |
554 } |
509 |
555 |
510 /*! |
556 /*! |
511 Slot which is called when the value changes in cenrep. |
557 Slot which is called when the value changes in cenrep. |
512 |
558 |
514 \param value The new value of that key. |
560 \param value The new value of that key. |
515 */ |
561 */ |
516 void ClockSettingsView::eventMonitor( |
562 void ClockSettingsView::eventMonitor( |
517 const XQSettingsKey& key, const QVariant& value) |
563 const XQSettingsKey& key, const QVariant& value) |
518 { |
564 { |
|
565 OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_EVENTMONITOR_ENTRY ); |
519 if (key.uid() == KCRUidClockApp && key.key() == KClockAppSnoozeTime) { |
566 if (key.uid() == KCRUidClockApp && key.key() == KClockAppSnoozeTime) { |
520 if (mSettingsManager->error() == XQSettingsManager::NoError) { |
567 if (mSettingsManager->error() == XQSettingsManager::NoError) { |
521 |
568 |
522 bool success; |
569 bool success; |
523 int alarmSnoozeTime = value.toInt(&success); |
570 int alarmSnoozeTime = value.toInt(&success); |