phonebookui/pbkcommonui/src/cntfavoritesview.cpp
changeset 31 2a11b5b00470
parent 27 de1630741fbe
child 37 fd64c38c277d
equal deleted inserted replaced
27:de1630741fbe 31:2a11b5b00470
    82 void CntFavoritesView::openSelectionPopup()
    82 void CntFavoritesView::openSelectionPopup()
    83 {
    83 {
    84    // call a dialog to display the contacts
    84    // call a dialog to display the contacts
    85    CntGroupSelectionPopup *groupSelectionPopup = new CntGroupSelectionPopup(mViewManager->contactManager(SYMBIAN_BACKEND), mContact);
    85    CntGroupSelectionPopup *groupSelectionPopup = new CntGroupSelectionPopup(mViewManager->contactManager(SYMBIAN_BACKEND), mContact);
    86    groupSelectionPopup->populateListOfContact();
    86    groupSelectionPopup->populateListOfContact();
    87    HbAction* action = groupSelectionPopup->exec();
    87    groupSelectionPopup->open(this, SLOT(handleMemberSelection(HbAction*)));
    88    
    88 }
    89    if (action == groupSelectionPopup->primaryAction())
    89 
    90    {
    90 void CntFavoritesView::handleMemberSelection(HbAction *action)
    91        groupSelectionPopup->saveOldGroup();
    91 {
    92        delete groupSelectionPopup;
    92     CntGroupSelectionPopup *groupSelectionPopup = static_cast<CntGroupSelectionPopup*>(sender());
    93        
    93     
    94        CntViewParameters viewParameters;
    94     if (groupSelectionPopup && action == groupSelectionPopup->actions().first())
    95        viewParameters.insert(EViewId, FavoritesMemberView);
    95     {
    96        QVariant var;
    96         bool membersSaved = groupSelectionPopup->saveOldGroup();
    97        var.setValue(*mContact);
    97         
    98        viewParameters.insert(ESelectedContact, var);
    98         if (membersSaved)
    99        mViewManager->changeView(viewParameters);
    99         {
   100    }
   100             CntViewParameters viewParameters;
   101    else if (action == groupSelectionPopup->secondaryAction())
   101             viewParameters.insert(EViewId, FavoritesMemberView);
   102    {
   102             QVariant var;
   103        delete groupSelectionPopup;
   103             var.setValue(*mContact);
   104        showPreviousView();
   104             viewParameters.insert(ESelectedContact, var);
   105    }
   105             mViewManager->changeView(viewParameters);
       
   106         }
       
   107         else
       
   108         {
       
   109             showPreviousView();
       
   110         }
       
   111     }
       
   112     else if (groupSelectionPopup && action == groupSelectionPopup->actions().at(1))
       
   113     {
       
   114         showPreviousView();
       
   115     }
   106 }
   116 }
   107 
   117 
   108 void CntFavoritesView::setOrientation(Qt::Orientation orientation)
   118 void CntFavoritesView::setOrientation(Qt::Orientation orientation)
   109 {
   119 {
   110     if (orientation == Qt::Vertical) 
   120     if (orientation == Qt::Vertical)