36 HbAction* cancel = static_cast<HbAction*>( mDocument->findObject( "cnt:cancel" ) ); |
36 HbAction* cancel = static_cast<HbAction*>( mDocument->findObject( "cnt:cancel" ) ); |
37 mView->menu()->addAction( cancel ); |
37 mView->menu()->addAction( cancel ); |
38 |
38 |
39 connect(cancel, SIGNAL(triggered()), this, SLOT(cancelFetch()) ); |
39 connect(cancel, SIGNAL(triggered()), this, SLOT(cancelFetch()) ); |
40 connect( this, SIGNAL(viewClosed()), this, SLOT(aboutToCloseView()) ); |
40 connect( this, SIGNAL(viewClosed()), this, SLOT(aboutToCloseView()) ); |
41 connect( this, SIGNAL(viewOpened(const CntViewParameters)), this, SLOT(aboutToOpenView(const CntViewParameters)) ); |
41 connect( this, SIGNAL(viewOpened(CntAbstractViewManager*, const CntViewParameters)), this, SLOT(aboutToOpenView(CntAbstractViewManager*, const CntViewParameters)) ); |
42 } |
42 } |
43 |
43 |
44 CntServiceContactFetchView::~CntServiceContactFetchView() |
44 CntServiceContactFetchView::~CntServiceContactFetchView() |
45 { |
45 { |
46 } |
46 } |
92 |
92 |
93 connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); |
93 connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); |
94 mServiceHandler->completeFetch(serviceList); |
94 mServiceHandler->completeFetch(serviceList); |
95 } |
95 } |
96 |
96 |
97 void CntServiceContactFetchView::aboutToOpenView(const CntViewParameters aArgs) |
97 void CntServiceContactFetchView::aboutToOpenView(CntAbstractViewManager* aMgr, const CntViewParameters aArgs) |
98 { |
98 { |
|
99 mMgr = aMgr; |
|
100 |
99 // Set title of the view. |
101 // Set title of the view. |
100 QString title = aArgs.value(CntServiceHandler::ETitle).toString(); |
102 QString title = aArgs.value(CntServiceHandler::ETitle).toString(); |
101 mView->setTitle(title); |
103 mView->setTitle(title); |
102 |
104 |
103 // Set action filter |
105 // Set action filter |
105 QString action = aArgs.value(CntServiceHandler::EAction).toString(); |
107 QString action = aArgs.value(CntServiceHandler::EAction).toString(); |
106 if (action == KCntActionSms) |
108 if (action == KCntActionSms) |
107 { |
109 { |
108 QContactActionFilter actionFilter; |
110 QContactActionFilter actionFilter; |
109 actionFilter.setActionName("message"); |
111 actionFilter.setActionName("message"); |
110 mListModel->setFilterAndSortOrder(actionFilter); |
112 mListModel->setFilter(actionFilter); |
111 } |
113 } |
112 else if (action == KCntActionCall) |
114 else if (action == KCntActionCall) |
113 { |
115 { |
114 QContactActionFilter actionFilter; |
116 QContactActionFilter actionFilter; |
115 actionFilter.setActionName("call"); |
117 actionFilter.setActionName("call"); |
116 mListModel->setFilterAndSortOrder(actionFilter); |
118 mListModel->setFilter(actionFilter); |
117 } |
119 } |
118 else if (action == KCntActionEmail) |
120 else if (action == KCntActionEmail) |
119 { |
121 { |
120 QContactActionFilter actionFilter; |
122 QContactActionFilter actionFilter; |
121 actionFilter.setActionName("email"); |
123 actionFilter.setActionName("email"); |
122 mListModel->setFilterAndSortOrder(actionFilter); |
124 mListModel->setFilter(actionFilter); |
123 } |
125 } |
124 else |
126 else |
125 { |
127 { |
126 QContactDetailFilter filter; |
128 QContactDetailFilter filter; |
127 filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); |
129 filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); |
128 QString typeContact = QContactType::TypeContact; |
130 QString typeContact = QContactType::TypeContact; |
129 filter.setValue(typeContact); |
131 filter.setValue(typeContact); |
130 mListModel->setFilterAndSortOrder(filter); |
132 mListModel->setFilter(filter); |
131 } |
133 } |
132 |
134 |
133 // hide my card if it's not set |
135 // hide my card if it's not set |
134 if ( mListModel->myCardId() == 0 ) |
136 if ( mListModel->myCardId() == 0 ) |
135 { |
137 { |