diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-01-07 22:23:41 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-01-07 22:23:41 +0100 |
| commit | 7d3bc4a36c32b073f07772afff2dcabf8e0ed266 (patch) | |
| tree | 77a9e37f00b71167be4b088e302ca746cddd2550 /main | |
| parent | 60ef814599dfac0959eb1fea758916089c54845c (diff) | |
| download | cgeo-7d3bc4a36c32b073f07772afff2dcabf8e0ed266.zip cgeo-7d3bc4a36c32b073f07772afff2dcabf8e0ed266.tar.gz cgeo-7d3bc4a36c32b073f07772afff2dcabf8e0ed266.tar.bz2 | |
new: suppress current list in "move to list"
Diffstat (limited to 'main')
| -rw-r--r-- | main/src/cgeo/geocaching/StoredList.java | 34 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/cgeocaches.java | 4 |
2 files changed, 34 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/StoredList.java b/main/src/cgeo/geocaching/StoredList.java index bb00506..d6f0993 100644 --- a/main/src/cgeo/geocaching/StoredList.java +++ b/main/src/cgeo/geocaching/StoredList.java @@ -34,6 +34,29 @@ public class StoredList { return title + " [" + count + "]"; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof StoredList)) { + return false; + } + StoredList other = (StoredList) obj; + if (id != other.id) { + return false; + } + return true; + } + public static class UserInterface { private final IAbstractActivity activity; private final cgeoapplication app; @@ -46,16 +69,23 @@ public class StoredList { } public void promptForListSelection(final int titleId, final RunnableWithArgument<Integer> runAfterwards) { - promptForListSelection(titleId, runAfterwards, false); + promptForListSelection(titleId, runAfterwards, false, -1); } - public void promptForListSelection(final int titleId, final RunnableWithArgument<Integer> runAfterwards, final boolean onlyMoveTargets) { + public void promptForListSelection(final int titleId, final RunnableWithArgument<Integer> runAfterwards, final boolean onlyMoveTargets, final int exceptListId) { final List<StoredList> lists = cgData.getLists(); if (lists == null) { return; } + if (exceptListId > StoredList.TEMPORARY_LIST_ID) { + StoredList exceptList = cgData.getList(exceptListId); + if (exceptList != null) { + lists.remove(exceptList); + } + } + final List<CharSequence> listsTitle = new ArrayList<CharSequence>(); for (StoredList list : lists) { listsTitle.add(list.getTitleAndCount()); diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java index aa4c89e..628c012 100644 --- a/main/src/cgeo/geocaching/cgeocaches.java +++ b/main/src/cgeo/geocaching/cgeocaches.java @@ -985,7 +985,7 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity refreshCurrentList(); } - }, true); + }, true, listId); } @Override @@ -1045,7 +1045,7 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity adapter.setSelectMode(false); refreshCurrentList(); } - }, true); + }, true, listId); break; case MENU_STORE_CACHE: //FIXME: this must use the same handler like in the CacheDetailActivity. Will be done by moving the handler into the store method. |
