diff -r 7cbcb2896f0e -r a642906a277a phonebookui/pbkcommonui/src/cntmycardview.cpp --- a/phonebookui/pbkcommonui/src/cntmycardview.cpp Tue Jul 06 14:05:47 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntmycardview.cpp Wed Aug 18 09:39:00 2010 +0300 @@ -16,7 +16,7 @@ */ #include "cntmycardview.h" -#include "cntfetchcontactsview.h" +#include "cntfetchcontactpopup.h" #include "cntglobal.h" #include #include @@ -28,8 +28,7 @@ CntMyCardView::CntMyCardView() : mContact(NULL), - mViewManager(NULL), - mFetchView(NULL) + mViewManager(NULL) { bool ok = false; mDocumentLoader.load(CNT_MYCARD_UI_XML, &ok); @@ -53,10 +52,7 @@ mView->deleteLater(); delete mContact; - mContact = 0; - - delete mFetchView; - mFetchView = NULL; + mContact = NULL; } /*! @@ -98,11 +94,6 @@ { chooseButton->setEnabled(false); } - - if (!mFetchView) { - mFetchView = new CntFetchContacts(*mViewManager->contactManager( SYMBIAN_BACKEND )); - connect(mFetchView, SIGNAL(clicked()), this, SLOT(handleMultiCardSelection())); - } } void CntMyCardView::deactivate() @@ -135,6 +126,7 @@ QVariant var; var.setValue(*mContact); viewParameters.insert(ESelectedContact, var); + viewParameters.insert(EExtraAction, CNT_ROOT_ACTION); mViewManager->changeView(viewParameters); } @@ -143,20 +135,19 @@ */ void CntMyCardView::openMyCardSelectionView() { - // Display a list of contacts to choose a mycard from. - mFetchView->setDetails(hbTrId("txt_phob_title_select_contact"), ""); - QSet emptyContactsSet; - mFetchView->displayContacts(HbAbstractItemView::SingleSelection, emptyContactsSet); + CntFetchContactPopup* popup = CntFetchContactPopup::createSingleSelectionPopup( + hbTrId("txt_phob_title_select_contact"), + *mViewManager->contactManager(SYMBIAN_BACKEND)); + connect( popup, SIGNAL(fetchReady(QSet)), this, SLOT(handleMultiCardSelection(QSet))); + popup->showPopup(); } -void CntMyCardView::handleMultiCardSelection() +void CntMyCardView::handleMultiCardSelection( QSet aIds ) { QContactManager* manager = mViewManager->contactManager( SYMBIAN_BACKEND ); - QSet selectedContacts = mFetchView->getSelectedContacts(); - - if ( !mFetchView->wasCanceled() && !selectedContacts.isEmpty() ) { - QList selectedContactsList = selectedContacts.values(); + if ( !aIds.isEmpty() ) { + QList selectedContactsList = aIds.values(); QContact contact = manager->contact(selectedContactsList.front()); removeFromGroup(&contact);