aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-04-14 15:45:39 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-04-14 15:49:05 +0200
commit78b467a81e7f5dcfc8683958f78fd64a58e39c6f (patch)
tree464843227686da9f251727773a908d26575efe15 /main/src
parenta34e939c0a7835721ec85701e5ac1ebdd4fb00a9 (diff)
downloadcgeo-78b467a81e7f5dcfc8683958f78fd64a58e39c6f.zip
cgeo-78b467a81e7f5dcfc8683958f78fd64a58e39c6f.tar.gz
cgeo-78b467a81e7f5dcfc8683958f78fd64a58e39c6f.tar.bz2
fix #601: Store cache from context-menu in list-view
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/cgeocaches.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java
index 4d4a715..77c4f96 100644
--- a/main/src/cgeo/geocaching/cgeocaches.java
+++ b/main/src/cgeo/geocaching/cgeocaches.java
@@ -132,6 +132,7 @@ public class cgeocaches extends AbstractListActivity {
private static final int MENU_FILTER_MODIFIED = 70;
private static final int SUBMENU_FILTER_TERRAIN = 71;
private static final int SUBMENU_FILTER_DIFFICULTY = 72;
+ private static final int MENU_STORE_CACHE = 73;
private static final int MSG_DONE = -1;
private static final int MSG_CANCEL = -99;
@@ -1091,6 +1092,9 @@ public class cgeocaches extends AbstractListActivity {
menu.add(0, MENU_MOVE_TO_LIST, 0, res.getString(R.string.cache_menu_move_list));
}
}
+ else {
+ menu.add(0, MENU_STORE_CACHE, 0, res.getString(R.string.cache_offline_store));
+ }
}
private void moveCachesToOtherList() {
@@ -1168,6 +1172,11 @@ public class cgeocaches extends AbstractListActivity {
}
});
return true;
+ } else if (id == MENU_STORE_CACHE) {
+ final cgCache cache = getCacheFromAdapter(adapterInfo);
+ //FIXME: this must use the same handler like in the CacheDetailActivity. Will be done by moving the handler into the store method.
+ cache.store(this, null);
+ return true;
}
// we must remember the menu info for the sub menu, there is a bug
@@ -1381,8 +1390,7 @@ public class cgeocaches extends AbstractListActivity {
threadDetails.start();
}
- public void removeFromHistoryCheck()
- {
+ public void removeFromHistoryCheck() {
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setCancelable(true);
dialog.setTitle(res.getString(R.string.caches_removing_from_history));
@@ -1404,8 +1412,7 @@ public class cgeocaches extends AbstractListActivity {
alert.show();
}
- public void removeFromHistory()
- {
+ public void removeFromHistory() {
if (adapter != null && adapter.getChecked() > 0)
{
// there are some checked caches
@@ -1427,7 +1434,6 @@ public class cgeocaches extends AbstractListActivity {
}
public void exportCaches() {
-
List<cgCache> caches;
if (adapter != null && adapter.getChecked() > 0) {
// there are some caches checked