diff --git a/data/S60Maps.l01 b/data/S60Maps.l01 index c154a89..e94b0ee 100644 --- a/data/S60Maps.l01 +++ b/data/S60Maps.l01 @@ -42,3 +42,7 @@ #define qtn_rename "Rename" #define qtn_delete "Delete" #define qtn_confirm_landmark_deletion "Delete \"%S\" landmark?" + +// Added in develop + +#define qtn_goto "Go to..." diff --git a/data/S60Maps.l04 b/data/S60Maps.l04 index 708131c..5a8cc8f 100644 --- a/data/S60Maps.l04 +++ b/data/S60Maps.l04 @@ -43,3 +43,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Renombrar" #define qtn_delete "Borrar" #define qtn_confirm_landmark_deletion "Borrar \"%S\" marcador?" + +// Added in develop + +#define qtn_goto "Go to..." diff --git a/data/S60Maps.l103 b/data/S60Maps.l103 index 4d3e540..7be2662 100644 --- a/data/S60Maps.l103 +++ b/data/S60Maps.l103 @@ -43,3 +43,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Renomear" #define qtn_delete "Apagar" #define qtn_confirm_landmark_deletion "Apagar \"%S\" marcador?" + +// Added in develop + +#define qtn_goto "Go to..." diff --git a/data/S60Maps.l13 b/data/S60Maps.l13 index bc5484c..df7dc00 100644 --- a/data/S60Maps.l13 +++ b/data/S60Maps.l13 @@ -43,3 +43,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Renomear" #define qtn_delete "Apagar" #define qtn_confirm_landmark_deletion "Apagar \"%S\" marcador?" + +// Added in develop + +#define qtn_goto "Go to..." diff --git a/data/S60Maps.l16 b/data/S60Maps.l16 index c9e6e60..b3b650e 100644 --- a/data/S60Maps.l16 +++ b/data/S60Maps.l16 @@ -43,3 +43,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Переименовать" #define qtn_delete "Удалить" #define qtn_confirm_landmark_deletion "Удалить ориентир \"%S\"?" + +// Added in develop + +#define qtn_goto "Перейти к..." diff --git a/data/S60Maps.l57 b/data/S60Maps.l57 index 4603731..e867808 100644 --- a/data/S60Maps.l57 +++ b/data/S60Maps.l57 @@ -46,3 +46,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Rename" #define qtn_delete "Delete" #define qtn_confirm_landmark_deletion "Delete \"%S\" landmark?" + +// Added in develop + +#define qtn_goto "Go to..." diff --git a/data/S60Maps.l83 b/data/S60Maps.l83 index b978acf..9025431 100644 --- a/data/S60Maps.l83 +++ b/data/S60Maps.l83 @@ -44,3 +44,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Rename" #define qtn_delete "Delete" #define qtn_confirm_landmark_deletion "Delete \"%S\" landmark?" + +// Added in develop + +#define qtn_goto "Go to..." diff --git a/data/S60Maps.l93 b/data/S60Maps.l93 index ec1da15..77137ae 100644 --- a/data/S60Maps.l93 +++ b/data/S60Maps.l93 @@ -43,3 +43,7 @@ CHARACTER_SET UTF8 #define qtn_rename "Перейменувати" #define qtn_delete "Видалити" #define qtn_confirm_landmark_deletion "Видалити орієнтир \"%S\"?" + +// Added in develop + +#define qtn_goto "Перейти до..." diff --git a/data/S60Maps.rss b/data/S60Maps.rss index 7cc3542..aa16911 100644 --- a/data/S60Maps.rss +++ b/data/S60Maps.rss @@ -158,6 +158,11 @@ RESOURCE MENU_PANE r_submenu_landmarks { command = EDeleteLandmark; txt = qtn_delete; + }, + MENU_ITEM + { + command = EGotoLandmark; + txt = qtn_goto; } }; } @@ -320,6 +325,27 @@ RESOURCE DIALOG r_landmark_name_input_query }; } +// List query dualog for landmarks +RESOURCE DIALOG r_landmarks_query_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + listbox = AVKON_LIST_QUERY_LIST + { + }; + heading = qtn_landmarks; + }; + } + }; + } + // ----------------------------------------------------------------------------- diff --git a/inc/S60Maps.hrh b/inc/S60Maps.hrh index a85546e..83f6775 100644 --- a/inc/S60Maps.hrh +++ b/inc/S60Maps.hrh @@ -26,6 +26,7 @@ enum TS60MapsIds ECreateLandmark, ERenameLandmark, EDeleteLandmark, + EGotoLandmark, ESetTileProviderBase = 0x6500, // Start id for tile providers ESetOsmStandardTileProvider = /*ESetTileProviderBase + 0*/ 0x6500 + 0, diff --git a/inc/S60MapsAppUi.h b/inc/S60MapsAppUi.h index 0a263fe..b65bc5e 100644 --- a/inc/S60MapsAppUi.h +++ b/inc/S60MapsAppUi.h @@ -166,6 +166,7 @@ class CS60MapsAppUi : public CAknAppUi, public MAsyncFileManObserver, void HandleCreateLandmarkL(); void HandleRenameLandmarkL(); void HandleDeleteLandmarkL(); + void HandleGotoLandmarkL(); public: inline const CSettings* Settings() diff --git a/src/S60MapsAppUi.cpp b/src/S60MapsAppUi.cpp index f9dbfc1..4c342c6 100644 --- a/src/S60MapsAppUi.cpp +++ b/src/S60MapsAppUi.cpp @@ -270,6 +270,10 @@ void CS60MapsAppUi::HandleCommandL(TInt aCommand) HandleDeleteLandmarkL(); break; + case EGotoLandmark: + HandleGotoLandmarkL(); + break; + default: Panic(ES60MapsUi); break; @@ -357,6 +361,10 @@ void CS60MapsAppUi::DynInitMenuPaneL(TInt aMenuID, CEikMenuPane* aMenuPane) delete nearestLandmark; aMenuPane->SetItemDimmed(ERenameLandmark, !isDisplayEditOrDeleteLandmark); aMenuPane->SetItemDimmed(EDeleteLandmark, !isDisplayEditOrDeleteLandmark); + CPosLmItemIterator* landmarkIterator = iLandmarksDb->LandmarkIteratorL(); + if (!(landmarkIterator && landmarkIterator->NumOfItemsL() > 0)) + aMenuPane->SetItemDimmed(EGotoLandmark, ETrue); + delete landmarkIterator; } /*else { @@ -852,6 +860,46 @@ void CS60MapsAppUi::HandleDeleteLandmarkL() CleanupStack::PopAndDestroy(landmark); } +void CS60MapsAppUi::HandleGotoLandmarkL() + { + CDesCArraySeg* lmNameArray = new (ELeave) CDesCArraySeg(4); + CleanupStack::PushL(lmNameArray); + CArrayFixFlat* lmIdArray = new (ELeave) CArrayFixFlat(4); + CleanupStack::PushL(lmIdArray); + CPosLmItemIterator* lmIterator = iLandmarksDb->LandmarkIteratorL(); + CleanupStack::PushL(lmIterator); + + TPosLmItemId lmId; + lmId = lmIterator->NextL(); + while (lmId != KPosLmNullItemId) + { + CPosLandmark* lm = iLandmarksDb->ReadLandmarkLC(lmId); + TPtrC lmName; + lm->GetLandmarkName(lmName); + lmNameArray->AppendL(lmName); + CleanupStack::PopAndDestroy(lm); + lmIdArray->AppendL(lmId); + lmId = lmIterator->NextL(); + } + + TInt chosenItem; + CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&chosenItem); + dlg->PrepareLC(R_LANDMARKS_QUERY_DIALOG); + dlg->SetItemTextArray(lmNameArray); + dlg->SetOwnershipType(ELbmDoesNotOwnItemArray); + TInt answer = dlg->RunLD(); + if (EAknSoftkeyOk == answer) + { + CPosLandmark* lm = iLandmarksDb->ReadLandmarkLC(lmIdArray->At(chosenItem)); + TLocality pos; + lm->GetPosition(pos); + iAppView->Move(pos); + CleanupStack::PopAndDestroy(lm); + } + + CleanupStack::PopAndDestroy(3, lmNameArray); + } + void CS60MapsAppUi::SendAppToBackground() { TApaTask task(iEikonEnv->WsSession());