phonebookui/phonebookservices/tsrc/qtpbkservicestestapp/testpbkservices.cpp
changeset 53 e6aff7b69165
parent 50 77bc263e1626
child 54 47627ab5d7a4
equal deleted inserted replaced
51:81c360d47083 53:e6aff7b69165
    26 #include <hbmainwindow.h>
    26 #include <hbmainwindow.h>
    27 #include <qtcontacts.h>
    27 #include <qtcontacts.h>
    28 #include <hbview.h>
    28 #include <hbview.h>
    29 #include <QGraphicsLinearLayout>
    29 #include <QGraphicsLinearLayout>
    30 #include <QDebug>
    30 #include <QDebug>
       
    31 #include <HbAction>
    31 
    32 
    32 #include "cntdebug.h"
    33 #include "cntdebug.h"
    33 
    34 
    34 
    35 
    35 testPbkServices::testPbkServices(HbMainWindow *aParent)
    36 testPbkServices::testPbkServices(HbMainWindow *aParent) :
    36 {
    37 mRequest(NULL),
    37     mRequest=NULL;
    38 mMainWindow(aParent),
    38     mMainWindow=aParent;
    39 mPopup(NULL)
       
    40 {
    39     setParent(aParent);
    41     setParent(aParent);
    40 
       
    41 }
    42 }
    42 
    43 
    43 testPbkServices::~testPbkServices()
    44 testPbkServices::~testPbkServices()
    44 {
    45 {
    45     delete mRequest;
    46     delete mRequest;
   482 
   483 
   483             QString contactId = QString("id: %1").arg(retValue[i].mContactId);
   484             QString contactId = QString("id: %1").arg(retValue[i].mContactId);
   484             listWidget->addItem( contactId );
   485             listWidget->addItem( contactId );
   485 
   486 
   486             }
   487             }
   487             HbDialog *popup = new HbDialog();
   488             mPopup = new HbDialog();
   488             popup->setAttribute(Qt::WA_DeleteOnClose, true);
   489             mPopup->setAttribute(Qt::WA_DeleteOnClose, true);
   489 
   490 
   490             // Set dismiss policy that determines what tap events will cause the popup
   491             // Set dismiss policy that determines what tap events will cause the popup
   491             // to be dismissed
   492             // to be dismissed
   492             popup->setDismissPolicy(HbDialog::NoDismiss);
   493             mPopup->setDismissPolicy(HbDialog::NoDismiss);
       
   494             mPopup->setModal(true);
   493 
   495 
   494             // Set the label as heading widget
   496             // Set the label as heading widget
   495             popup->setHeadingWidget(new HbLabel(tr("Contact")));
   497             mPopup->setHeadingWidget(new HbLabel(tr("Contact")));
   496 
   498 
   497             // Set a list widget as content widget in the popup
   499             // Set a list widget as content widget in the popup
   498             popup->setContentWidget(listWidget);
   500             mPopup->setContentWidget(listWidget);
   499 
   501             
   500             // Sets the primary action and secondary action
   502             // Add an OK action to dismiss the popup
   501             //popup.setPrimaryAction(new HbAction(tr("Ok"),&popup));
   503             HbAction *okAction = new HbAction(tr("Ok"), mPopup);
   502             //popup.setSecondaryAction(new HbAction(tr("Cancel"),&popup));
   504             mPopup->addAction(okAction);
   503 
   505 
   504             // Launch popup asyncronously
   506             // Launch popup asyncronously
   505             popup->setTimeout(15000);
   507             mPopup->open();
   506             popup->open();
       
   507     }
   508     }
   508     CNT_EXIT
   509     CNT_EXIT
   509 }
   510 }
   510 
   511 
   511 void testPbkServices::launchMultiFetch( bool aNewInterface, QString aAction )
   512 void testPbkServices::launchMultiFetch( bool aNewInterface, QString aAction )