phonebookui/phonebookservices/src/cntservicecontactcardview.cpp
changeset 27 de1630741fbe
parent 25 76a2435edfd4
child 50 77bc263e1626
child 59 a642906a277a
equal deleted inserted replaced
25:76a2435edfd4 27:de1630741fbe
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "cntservicecontactcardview.h"
    18 #include "cntservicecontactcardview.h"
    19 
       
    20 #include "cntservicehandler.h"
    19 #include "cntservicehandler.h"
       
    20 #include <QCoreApplication>
    21 
    21 
    22 /*!
    22 /*!
    23 Constructor, initialize member variables.
    23 Constructor, initialize member variables.
    24 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
    24 \a viewManager is the parent that creates this view. \a parent is a pointer to parent QGraphicsItem (by default this is 0)
    25 */
    25 */
    26 CntServiceContactCardView::CntServiceContactCardView(CntServiceHandler *aServiceHandler, CntViewManager *viewManager, QGraphicsItem *parent) : 
    26 CntServiceContactCardView::CntServiceContactCardView(CntServiceHandler *aServiceHandler) : 
    27     CntContactCardView(viewManager, parent),
    27     CntContactCardView(),
    28     mServiceHandler(aServiceHandler)
    28     mServiceHandler(aServiceHandler)
    29 {
    29 {
    30 
    30     connect(this, SIGNAL(backPressed()), this, SLOT(doShowPreviousView()));
    31 }
    31 }
    32 
    32 
    33 /*!
    33 /*!
    34 Destructor
    34 Destructor
    35 */
    35 */
    37 {
    37 {
    38 
    38 
    39 }
    39 }
    40 
    40 
    41 /*!
    41 /*!
    42 Launch contact editor
       
    43 */
       
    44 void CntServiceContactCardView::editContact()
       
    45 {
       
    46     CntViewParameters viewParameters(CntViewParameters::serviceSubEditView);
       
    47     viewParameters.setSelectedContact(*mContact);   
       
    48     viewManager()->changeView(viewParameters);
       
    49 }
       
    50 
       
    51 /*!
       
    52 Close the view (quits the service as well)
    42 Close the view (quits the service as well)
    53 */
    43 */
    54 void CntServiceContactCardView::aboutToCloseView()
    44 void CntServiceContactCardView::doShowPreviousView()
    55 {
    45 {
    56     int result = -2;
    46     int result = -2;
    57     connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
    47     connect(mServiceHandler, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
    58     mServiceHandler->completeEdit(result);
    48     mServiceHandler->completeEdit(result);
    59 }
    49 }