diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-05-09 09:17:00 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-05-09 09:17:00 +0200 |
| commit | 4b95081918b795575808a5be62655b82e7ca9750 (patch) | |
| tree | d732c2481e1bafb46053b744782ed4c092b049d9 /main | |
| parent | 7b1c980547211e9bc26f3f12e934d128b7da254f (diff) | |
| download | cgeo-4b95081918b795575808a5be62655b82e7ca9750.zip cgeo-4b95081918b795575808a5be62655b82e7ca9750.tar.gz cgeo-4b95081918b795575808a5be62655b82e7ca9750.tar.bz2 | |
fix #2695: Different log types and order before/after log page loading
for owned caches
Diffstat (limited to 'main')
| -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(); } }); |
