26 #include <HbMessageBox> |
26 #include <HbMessageBox> |
27 #include <HbPopup> |
27 #include <HbPopup> |
28 #include <HbListWidget> |
28 #include <HbListWidget> |
29 #include <HbListWidgetItem> |
29 #include <HbListWidgetItem> |
30 #include <HbMainWindow> |
30 #include <HbMainWindow> |
|
31 #include <HbInstance> |
31 #include <cppluginutility.h> |
32 #include <cppluginutility.h> |
32 #include <cpitemdatahelper.h> |
33 #include <cpitemdatahelper.h> |
33 #include <cpbasesettingview.h> |
34 #include <cpbasesettingview.h> |
34 #include <cmdestination_shim.h> |
35 #include <cmdestination_shim.h> |
35 #include <cmconnectionmethod_shim.h> |
36 #include <cmconnectionmethod_shim.h> |
61 Constructor. |
62 Constructor. |
62 |
63 |
63 @param[in] itemDataHelper Helper for connecting signals and slots. |
64 @param[in] itemDataHelper Helper for connecting signals and slots. |
64 */ |
65 */ |
65 CpDestinationEntryItemData::CpDestinationEntryItemData(CpItemDataHelper &itemDataHelper) |
66 CpDestinationEntryItemData::CpDestinationEntryItemData(CpItemDataHelper &itemDataHelper) |
66 : CpSettingFormEntryItemData(itemDataHelper), |
67 : CpSettingFormEntryItemData(CpSettingFormEntryItemData::ButtonEntryItem, itemDataHelper), |
67 mList(0), |
68 mList(0), |
68 mDialog(0), |
69 mDialog(0), |
69 mOkAction(0) |
70 mOkAction(0) |
70 { |
71 { |
71 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA_ENTRY); |
72 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA_ENTRY); |
233 = connect(iapDataItem, SIGNAL(iapChanged()), this, SLOT(updateDestinationView())); |
234 = connect(iapDataItem, SIGNAL(iapChanged()), this, SLOT(updateDestinationView())); |
234 Q_ASSERT(connected); |
235 Q_ASSERT(connected); |
235 } |
236 } |
236 |
237 |
237 itemDataHelper->bindToForm(form); |
238 itemDataHelper->bindToForm(form); |
238 delete itemDataHelper; |
|
239 OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CONSTRUCTSETTINGVIEW_EXIT); |
239 OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CONSTRUCTSETTINGVIEW_EXIT); |
240 } |
240 } |
241 |
241 |
242 /*! |
242 /*! |
243 Rebuilds view with access points after access points have changed. |
243 Rebuilds view with access points after access points have changed. |
244 */ |
244 */ |
245 void CpDestinationEntryItemData::updateDestinationView() |
245 void CpDestinationEntryItemData::updateDestinationView() |
246 { |
246 { |
247 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_UPDATEDESTINATIONVIEW_ENTRY); |
247 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_UPDATEDESTINATIONVIEW_ENTRY); |
248 HbDataForm *form = static_cast<HbDataForm*>(QObject::parent()->parent()); |
248 QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); |
249 HbMainWindow *mainWnd = form->mainWindow(); |
249 HbMainWindow *mainWnd = mainWindows.front(); |
250 |
250 |
251 if (mainWnd) { |
251 if (mainWnd) { |
252 HbView *view = mainWnd->currentView(); |
252 HbView *view = mainWnd->currentView(); |
253 CpBaseSettingView *cpView = static_cast<CpBaseSettingView *>(view); |
253 CpBaseSettingView *cpView = static_cast<CpBaseSettingView *>(view); |
254 constructSettingView(cpView); |
254 constructSettingView(cpView); |
391 be changed by dragging and dropping and shows it to user. |
391 be changed by dragging and dropping and shows it to user. |
392 */ |
392 */ |
393 void CpDestinationEntryItemData::activateArrangeMode() |
393 void CpDestinationEntryItemData::activateArrangeMode() |
394 { |
394 { |
395 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_ACTIVATEARRANGEMODE_ENTRY); |
395 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_ACTIVATEARRANGEMODE_ENTRY); |
396 HbDataForm *form = static_cast<HbDataForm*>(QObject::parent()->parent()); |
396 QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); |
397 HbMainWindow *mainWnd = form->mainWindow(); |
397 HbMainWindow *mainWnd = mainWindows.front(); |
398 HbView *view = new HbView(); |
398 HbView *view = new HbView(); |
399 createArrangeModeView(view); |
399 createArrangeModeView(view); |
400 |
400 |
401 bool connectionSuccessful = connect( |
401 bool connectionSuccessful = connect( |
402 mList, |
402 mList, |
446 showErrorNote(QString("txt_occ_info_unable_to_save_setting")); |
446 showErrorNote(QString("txt_occ_info_unable_to_save_setting")); |
447 OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_VIEWDONE_EXIT); |
447 OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_VIEWDONE_EXIT); |
448 return; |
448 return; |
449 } |
449 } |
450 |
450 |
451 HbDataForm *form = static_cast<HbDataForm*>(QObject::parent()->parent()); |
451 QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); |
452 HbMainWindow *mainWnd = form->mainWindow(); |
452 HbMainWindow *mainWnd = mainWindows.front(); |
453 HbView* view = mainWnd->currentView(); |
453 HbView* view = mainWnd->currentView(); |
454 |
454 |
455 if (mainWnd && view) { |
455 if (mainWnd && view) { |
456 //restore previous status |
456 //restore previous status |
457 mainWnd->removeView(view); |
457 mainWnd->removeView(view); |
466 User returns from view without accepting the changes to priorities. |
466 User returns from view without accepting the changes to priorities. |
467 */ |
467 */ |
468 void CpDestinationEntryItemData::viewCancel() |
468 void CpDestinationEntryItemData::viewCancel() |
469 { |
469 { |
470 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_VIEWCANCEL_ENTRY); |
470 OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_VIEWCANCEL_ENTRY); |
471 HbDataForm *form = static_cast<HbDataForm*>(QObject::parent()->parent()); |
471 QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows(); |
472 HbMainWindow *mainWnd = form->mainWindow(); |
472 HbMainWindow *mainWnd = mainWindows.front(); |
473 HbView* view = mainWnd->currentView(); |
473 HbView* view = mainWnd->currentView(); |
474 |
474 |
475 if (mainWnd && view) { |
475 if (mainWnd && view) { |
476 //restore previous status |
476 //restore previous status |
477 mainWnd->removeView(view); |
477 mainWnd->removeView(view); |