locationpickerservice/src/locationpickersearchview.cpp
changeset 41 b3dd5ec3089d
parent 35 59575560d1e6
equal deleted inserted replaced
38:793f76d9ab0c 41:b3dd5ec3089d
    41     mSearchPanel(NULL),
    41     mSearchPanel(NULL),
    42     mEmptyLabel(NULL),
    42     mEmptyLabel(NULL),
    43     mVerticalLayout(NULL),
    43     mVerticalLayout(NULL),
    44     mDocumentLoader(aLoader),
    44     mDocumentLoader(aLoader),
    45 	mLongPressMenu(NULL),
    45 	mLongPressMenu(NULL),
    46 	mSelectAction(NULL)
    46 	mSelectAction(NULL),
    47 {
    47 	mBackAction(NULL)
       
    48 {
       
    49     
       
    50     // create back action
       
    51     mBackAction = new HbAction(Hb::BackNaviAction);
       
    52     // add back key action
       
    53     setNavigationAction(mBackAction);
       
    54     //connect to slots
       
    55     connect(mBackAction, SIGNAL(triggered()), this,SLOT(backTriggered())); 
    48 
    56 
    49 }
    57 }
    50 // ----------------------------------------------------
    58 // ----------------------------------------------------
    51 // LocationPickerSearchView::~LocationPickerSearchView()
    59 // LocationPickerSearchView::~LocationPickerSearchView()
    52 // ----------------------------------------------------
    60 // ----------------------------------------------------
    53 LocationPickerSearchView::~LocationPickerSearchView()
    61 LocationPickerSearchView::~LocationPickerSearchView()
    54 {
    62 {
    55     delete mProxyModel;
    63     delete mProxyModel;
    56     delete mEmptyLabel;
    64     delete mEmptyLabel;
       
    65     delete mBackAction;
    57 }
    66 }
    58 
    67 
    59 // ----------------------------------------------------
    68 // ----------------------------------------------------
    60 // LocationPickerSearchView::init()
    69 // LocationPickerSearchView::init()
    61 // ----------------------------------------------------
    70 // ----------------------------------------------------
   177 // -----------------------------------------------------------------------------
   186 // -----------------------------------------------------------------------------
   178 void LocationPickerSearchView::launchPopUpMenu(HbAbstractViewItem *aItem, const QPointF &aPoint)
   187 void LocationPickerSearchView::launchPopUpMenu(HbAbstractViewItem *aItem, const QPointF &aPoint)
   179 {
   188 {
   180     mLongPressMenu = new HbMenu();
   189     mLongPressMenu = new HbMenu();
   181     mLongPressMenu->setTimeout(HbMenu::NoTimeout);
   190     mLongPressMenu->setTimeout(HbMenu::NoTimeout);
   182     mSelectAction  = mLongPressMenu->addAction(hbTrId("txt_lint_list_select"));
   191     mSelectAction  = mLongPressMenu->addAction(hbTrId("txt_lint_menu_select"));
   183     mIndex = aItem->modelIndex();
   192     mIndex = aItem->modelIndex();
   184     connect(mSelectAction, SIGNAL(triggered()),this, SLOT(handleLongPress()));
   193     connect(mSelectAction, SIGNAL(triggered()),this, SLOT(handleLongPress()));
   185     mLongPressMenu->setPreferredPos(aPoint);
   194     mLongPressMenu->setPreferredPos(aPoint);
   186     connect(mLongPressMenu,SIGNAL(aboutToClose ()),this,SLOT(deleteMenu()));
   195     connect(mLongPressMenu,SIGNAL(aboutToClose ()),this,SLOT(deleteMenu()));
   187     mLongPressMenu->open();
   196     mLongPressMenu->open();
   203     mLongPressMenu->deleteLater();
   212     mLongPressMenu->deleteLater();
   204     mLongPressMenu = NULL;
   213     mLongPressMenu = NULL;
   205     mSelectAction->deleteLater();
   214     mSelectAction->deleteLater();
   206     mSelectAction = NULL;
   215     mSelectAction = NULL;
   207 }
   216 }
       
   217 
       
   218 // ----------------------------------------------------------------------------
       
   219 // LocationPickerSearchView::backButtonTriggered()
       
   220 // ----------------------------------------------------------------------------
       
   221 void LocationPickerSearchView::backTriggered()
       
   222 {
       
   223     
       
   224    //complete the service
       
   225     emit completeService();
       
   226     
       
   227     
       
   228 }