aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPortree-Kid <keith.paterson@gmx.de>2012-05-24 18:57:58 +0200
committerPortree-Kid <keith.paterson@gmx.de>2012-05-24 19:28:23 +0200
commit67d52287742a14f22eef470335a3753b4d158ac5 (patch)
tree8a2bba8e5f0ca4aec0d76172ee4bf7d538ac2491
parent49aefb0cb8f398f525159477c9a8354ad763ce34 (diff)
downloadcgeo-67d52287742a14f22eef470335a3753b4d158ac5.zip
cgeo-67d52287742a14f22eef470335a3753b4d158ac5.tar.gz
cgeo-67d52287742a14f22eef470335a3753b4d158ac5.tar.bz2
Toast for missing mapfile
-rw-r--r--main/res/values/strings.xml2
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java8
2 files changed, 10 insertions, 0 deletions
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index 8da8beb..f51f400 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -221,6 +221,8 @@
<string name="warn_load_images">c:geo failed to load images.</string>
<string name="warn_invalid_mapfile">The selected map file is not a valid mapsforge version 0.3.0 map file.\nOffline maps are not available.</string>
<string name="warn_deprecated_mapfile">You are using a deprecated version 0.2.4 map file.\nConsider switching to a version 0.3.0 map.\nWe will drop support for version 0.2.4 in the next release.</string>
+ <string name="warn_nonexistant_mapfile">The selected map file does not exist.\nOffline maps are not available.</string>
+
<string name="info_log_posted">c:geo successfully submitted the log.</string>
<string name="info_log_saved">c:geo successfully saved the log.</string>
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
index 08b9c0f..c24a798 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
@@ -212,6 +212,14 @@ public class MapsforgeMapView extends MapView implements MapViewImpl {
setMapGenerator(mapGenerator);
if (!mapGenerator.requiresInternetConnection()) {
+ if (!new File(Settings.getMapFile()).exists()) {
+ Toast.makeText(
+ getContext(),
+ getContext().getResources().getString(R.string.warn_nonexistant_mapfile),
+ Toast.LENGTH_LONG)
+ .show();
+ return;
+ }
setMapFile(new File(Settings.getMapFile()));
if (!Settings.isValidMapFile(Settings.getMapFile())) {
Toast.makeText(