diff options
author | Bananeweizen <Bananeweizen@gmx.de> | 2012-05-07 23:39:22 +0200 |
---|---|---|
committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-05-07 23:39:22 +0200 |
commit | 323ebe30c12e8f6f6c22ba132832befbb81e24c0 (patch) | |
tree | 0d39a4127a3d5deac62613a26536a6028d415720 /main/src/cgeo | |
parent | a63b830a85f2d0ef3c0184e95218560874a36fe5 (diff) | |
download | cgeo-323ebe30c12e8f6f6c22ba132832befbb81e24c0.zip cgeo-323ebe30c12e8f6f6c22ba132832befbb81e24c0.tar.gz cgeo-323ebe30c12e8f6f6c22ba132832befbb81e24c0.tar.bz2 |
fix #1516: Navigate from "Any destination" not working
Diffstat (limited to 'main/src/cgeo')
-rw-r--r-- | main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java | 2 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/cgeopoint.java | 17 |
2 files changed, 6 insertions, 13 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java index 50520ac..666c443 100644 --- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java +++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java @@ -119,7 +119,7 @@ public final class NavigationAppFactory extends AbstractAppFactory { for (NavigationAppsEnum navApp : getInstalledNavigationApps()) { if ((showInternalMap || !(navApp.app instanceof InternalMap)) && (showDefaultNavigation || defaultNavigationTool != navApp.id)) { - if ((cache != null && navApp.app.isEnabled(cache)) || (waypoint != null && navApp.app.isEnabled(waypoint))) { + if ((cache != null && navApp.app.isEnabled(cache)) || (waypoint != null && navApp.app.isEnabled(waypoint)) || destination != null) { items.add(navApp); } } diff --git a/main/src/cgeo/geocaching/cgeopoint.java b/main/src/cgeo/geocaching/cgeopoint.java index 0c3c991..bd2ec6f 100644 --- a/main/src/cgeo/geocaching/cgeopoint.java +++ b/main/src/cgeo/geocaching/cgeopoint.java @@ -326,7 +326,7 @@ public class cgeopoint extends AbstractActivity implements IObserver<IGeoData> { public boolean onCreateOptionsMenu(Menu menu) { menu.add(0, MENU_DEFAULT_NAVIGATION, 0, NavigationAppFactory.getDefaultNavigationApplication().getName()).setIcon(R.drawable.ic_menu_compass); // default navigation tool - menu.add(0, MENU_NAVIGATE, 0, res.getString(R.string.cache_menu_navigate)).setIcon(R.drawable.ic_menu_more); + menu.add(0, MENU_NAVIGATE, 0, res.getString(R.string.cache_menu_navigate)).setIcon(R.drawable.ic_menu_mapmode); menu.add(0, MENU_CACHES_AROUND, 0, res.getString(R.string.cache_menu_around)).setIcon(R.drawable.ic_menu_rotate); // caches around @@ -340,17 +340,10 @@ public class cgeopoint extends AbstractActivity implements IObserver<IGeoData> { super.onPrepareOptionsMenu(menu); try { - final Geopoint coords = getDestination(); - - if (coords != null) { - menu.findItem(MENU_NAVIGATE).setVisible(true); - menu.findItem(MENU_DEFAULT_NAVIGATION).setVisible(true); - menu.findItem(MENU_CACHES_AROUND).setVisible(true); - } else { - menu.findItem(MENU_NAVIGATE).setVisible(false); - menu.findItem(MENU_DEFAULT_NAVIGATION).setVisible(false); - menu.findItem(MENU_CACHES_AROUND).setVisible(false); - } + boolean visible = getDestination() != null; + menu.findItem(MENU_NAVIGATE).setVisible(visible); + menu.findItem(MENU_DEFAULT_NAVIGATION).setVisible(visible); + menu.findItem(MENU_CACHES_AROUND).setVisible(visible); menu.findItem(MENU_CLEAR_HISTORY).setEnabled(!getHistoryOfSearchedLocations().isEmpty()); } catch (Exception e) { |