From 98d161e71ba38b44c57a4c0dbf78a9759e057935 Mon Sep 17 00:00:00 2001 From: SammysHP Date: Sun, 22 Apr 2012 13:19:45 +0200 Subject: Refactoring: Move import entries to manage submenu There is only one entry in the overflow submenu. If send2cgeo is configured, there will be two entries. They should be moved to a sub-submenu (e.g. AlertDialog), the string for the title is already present in R.string.gpx_import_title --- main/src/cgeo/geocaching/cgeocaches.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java index af156d6..197c452 100644 --- a/main/src/cgeo/geocaching/cgeocaches.java +++ b/main/src/cgeo/geocaching/cgeocaches.java @@ -746,14 +746,14 @@ public class cgeocaches extends AbstractListActivity { subMenu.add(0, MENU_DROP_CACHES_AND_LIST, 0, res.getString(R.string.caches_drop_all_and_list)); subMenu.add(0, MENU_REFRESH_STORED, 0, res.getString(R.string.cache_offline_refresh)); // download details for all caches subMenu.add(0, MENU_MOVE_TO_LIST, 0, res.getString(R.string.cache_menu_move_list)); - subMenu.add(0, MENU_EXPORT, 0, res.getString(R.string.export)); // export caches - if (Settings.getWebDeviceCode() == null) { - menu.add(0, MENU_IMPORT_GPX, 0, res.getString(R.string.gpx_import_title)).setIcon(android.R.drawable.ic_menu_upload); // import gpx file - } else { - SubMenu subMenuImport = menu.addSubMenu(0, SUBMENU_IMPORT, 0, res.getString(R.string.import_title)).setIcon(android.R.drawable.ic_menu_upload); // import - subMenuImport.add(1, MENU_IMPORT_GPX, 0, res.getString(R.string.gpx_import_title)).setCheckable(false).setChecked(false); - subMenuImport.add(1, MENU_IMPORT_WEB, 0, res.getString(R.string.web_import_title)).setCheckable(false).setChecked(false); + + //TODO: add submenu/AlertDialog and use R.string.gpx_import_title + subMenu.add(0, MENU_IMPORT_GPX, 0, res.getString(R.string.gpx_import_title)); + if (Settings.getWebDeviceCode() != null) { + subMenu.add(0, MENU_IMPORT_WEB, 0, res.getString(R.string.web_import_title)); } + + subMenu.add(0, MENU_EXPORT, 0, res.getString(R.string.export)); // export caches } else { if (type == CacheListType.HISTORY) { SubMenu subMenu = menu.addSubMenu(0, SUBMENU_MANAGE_HISTORY, 0, res.getString(R.string.caches_manage)).setIcon(android.R.drawable.ic_menu_save); -- cgit v1.1