aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-05-04 12:30:47 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-05-04 12:30:47 +0200
commit31632416b2ff724488b0c9eeb09a92d2b37f0e17 (patch)
tree969441e910f951999ed7a984d03fca80f0e7c0bb /main
parent79439277f0f1f62dcd39d40a3a457232cbaafb41 (diff)
downloadcgeo-31632416b2ff724488b0c9eeb09a92d2b37f0e17.zip
cgeo-31632416b2ff724488b0c9eeb09a92d2b37f0e17.tar.gz
cgeo-31632416b2ff724488b0c9eeb09a92d2b37f0e17.tar.bz2
fix #2683: Enable GPX import in all lists
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/GpxFileListActivity.java2
-rw-r--r--main/src/cgeo/geocaching/StoredList.java10
-rw-r--r--main/src/cgeo/geocaching/cgeocaches.java4
3 files changed, 12 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/GpxFileListActivity.java b/main/src/cgeo/geocaching/GpxFileListActivity.java
index 201565e..de0be21 100644
--- a/main/src/cgeo/geocaching/GpxFileListActivity.java
+++ b/main/src/cgeo/geocaching/GpxFileListActivity.java
@@ -33,7 +33,7 @@ public class GpxFileListActivity extends AbstractFileListActivity<GPXListAdapter
public static void startSubActivity(Activity fromActivity, int listId) {
final Intent intent = new Intent(fromActivity, GpxFileListActivity.class);
- intent.putExtra(Intents.EXTRA_LIST_ID, listId);
+ intent.putExtra(Intents.EXTRA_LIST_ID, StoredList.getConcreteList(listId));
fromActivity.startActivityForResult(intent, 0);
}
diff --git a/main/src/cgeo/geocaching/StoredList.java b/main/src/cgeo/geocaching/StoredList.java
index 778c112..c505e3c 100644
--- a/main/src/cgeo/geocaching/StoredList.java
+++ b/main/src/cgeo/geocaching/StoredList.java
@@ -201,4 +201,14 @@ public class StoredList {
protected String getTitle() {
return title;
}
+
+ /**
+ * Return the given list, if it is a concrete list. Return the default list otherwise.
+ */
+ public static int getConcreteList(int listId) {
+ if (listId == ALL_LIST_ID || listId == TEMPORARY_LIST_ID) {
+ return STANDARD_LIST_ID;
+ }
+ return listId;
+ }
}
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java
index 7888b14..097aef3 100644
--- a/main/src/cgeo/geocaching/cgeocaches.java
+++ b/main/src/cgeo/geocaching/cgeocaches.java
@@ -612,8 +612,6 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
setVisible(menu, MENU_EXPORT, !isEmpty);
setVisible(menu, MENU_REMOVE_FROM_HISTORY, !isEmpty);
setVisible(menu, MENU_CLEAR_OFFLINE_LOGS, !isEmpty && containsOfflineLogs());
- setVisible(menu, MENU_IMPORT_GPX, isConcrete);
- setVisible(menu, MENU_IMPORT_WEB, isConcrete);
if (navigationMenu != null) {
navigationMenu.setVisible(!isEmpty);
@@ -1297,7 +1295,7 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
public LoadFromWebThread(Handler handlerIn, int listId) {
handler = handlerIn;
- listIdLFW = listId;
+ listIdLFW = StoredList.getConcreteList(listId);
}
public void kill() {