diff options
| -rw-r--r-- | main/src/cgeo/geocaching/Geocache.java | 24 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/VisitCacheActivity.java | 11 |
2 files changed, 21 insertions, 14 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index fe5de91..2c9ba32 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -486,31 +486,35 @@ public class Geocache implements ICache, IWaypoint { final List<LogType> logTypes = new ArrayList<LogType>(); if (isEventCache()) { logTypes.add(LogType.WILL_ATTEND); - logTypes.add(LogType.NOTE); logTypes.add(LogType.ATTENDED); - logTypes.add(LogType.NEEDS_ARCHIVE); if (isOwner()) { logTypes.add(LogType.ANNOUNCEMENT); } } else if (CacheType.WEBCAM == cacheType) { logTypes.add(LogType.WEBCAM_PHOTO_TAKEN); - logTypes.add(LogType.DIDNT_FIND_IT); - logTypes.add(LogType.NOTE); - logTypes.add(LogType.NEEDS_ARCHIVE); - logTypes.add(LogType.NEEDS_MAINTENANCE); } else { logTypes.add(LogType.FOUND_IT); + } + if (!isEventCache()) { logTypes.add(LogType.DIDNT_FIND_IT); - logTypes.add(LogType.NOTE); - logTypes.add(LogType.NEEDS_ARCHIVE); + } + logTypes.add(LogType.NOTE); + if (!isEventCache()) { logTypes.add(LogType.NEEDS_MAINTENANCE); } if (isOwner()) { logTypes.add(LogType.OWNER_MAINTENANCE); - logTypes.add(LogType.TEMP_DISABLE_LISTING); - logTypes.add(LogType.ENABLE_LISTING); + if (isDisabled()) { + logTypes.add(LogType.ENABLE_LISTING); + } + else { + logTypes.add(LogType.TEMP_DISABLE_LISTING); + } logTypes.add(LogType.ARCHIVE); } + if (!isArchived() && !isOwner()) { + logTypes.add(LogType.NEEDS_ARCHIVE); + } return logTypes; } diff --git a/main/src/cgeo/geocaching/VisitCacheActivity.java b/main/src/cgeo/geocaching/VisitCacheActivity.java index 7c2d1ce..cac0f89 100644 --- a/main/src/cgeo/geocaching/VisitCacheActivity.java +++ b/main/src/cgeo/geocaching/VisitCacheActivity.java @@ -636,16 +636,19 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD } private void selectLogType() { + // use a local copy of the possible types, as that one might be modified in the background by the loader + final ArrayList<LogType> possible = new ArrayList<LogType>(possibleLogTypes); + Builder alert = new AlertDialog.Builder(this); - String[] choices = new String[possibleLogTypes.size()]; + String[] choices = new String[possible.size()]; for (int i = 0; i < choices.length; i++) { - choices[i] = possibleLogTypes.get(i).getL10n(); + choices[i] = possible.get(i).getL10n(); } - alert.setSingleChoiceItems(choices, possibleLogTypes.indexOf(typeSelected), new OnClickListener() { + alert.setSingleChoiceItems(choices, possible.indexOf(typeSelected), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int position) { - setType(possibleLogTypes.get(position)); + setType(possible.get(position)); dialog.dismiss(); } }); |
