aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/LogCacheActivity.java26
-rw-r--r--main/src/cgeo/geocaching/enumerations/LogType.java4
2 files changed, 24 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/LogCacheActivity.java b/main/src/cgeo/geocaching/LogCacheActivity.java
index 53fb5a2..6ee115b 100644
--- a/main/src/cgeo/geocaching/LogCacheActivity.java
+++ b/main/src/cgeo/geocaching/LogCacheActivity.java
@@ -599,7 +599,7 @@ public class LogCacheActivity extends AbstractLoggingActivity implements DateDia
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_send:
- sendLog();
+ sendLogAndConfirm();
return true;
case R.id.menu_image:
selectImage();
@@ -618,18 +618,32 @@ public class LogCacheActivity extends AbstractLoggingActivity implements DateDia
return super.onOptionsItemSelected(item);
}
- private void sendLog() {
+ private void sendLogAndConfirm() {
if (!sendButtonEnabled) {
Dialogs.message(this, R.string.log_post_not_possible);
+ return;
+ }
+ if (typeSelected.mustConfirmLog()) {
+ Dialogs.confirm(this, R.string.confirm_log_title, res.getString(R.string.confirm_log_message, typeSelected.getL10n()), new OnClickListener() {
+
+ @Override
+ public void onClick(final DialogInterface dialog, final int which) {
+ sendLogInternal();
+ }
+ });
}
else {
- final String message = res.getString(StringUtils.isBlank(imageUri.getPath()) ?
- R.string.log_saving :
- R.string.log_saving_and_uploading);
- new Poster(this, message).execute(currentLogText(), currentLogPassword());
+ sendLogInternal();
}
}
+ private void sendLogInternal() {
+ final String message = res.getString(StringUtils.isBlank(imageUri.getPath()) ?
+ R.string.log_saving :
+ R.string.log_saving_and_uploading);
+ new Poster(this, message).execute(currentLogText(), currentLogPassword());
+ }
+
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
super.onCreateOptionsMenu(menu);
diff --git a/main/src/cgeo/geocaching/enumerations/LogType.java b/main/src/cgeo/geocaching/enumerations/LogType.java
index 36f063f..5345611 100644
--- a/main/src/cgeo/geocaching/enumerations/LogType.java
+++ b/main/src/cgeo/geocaching/enumerations/LogType.java
@@ -117,4 +117,8 @@ public enum LogType {
public final boolean isFoundLog() {
return this == LogType.FOUND_IT || this == LogType.ATTENDED || this == LogType.WEBCAM_PHOTO_TAKEN;
}
+
+ public boolean mustConfirmLog() {
+ return this == ARCHIVE || this == NEEDS_ARCHIVE;
+ }
}