Skip to content

Commit

Permalink
FX: Prevent exiting while saving photo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisfeld committed Jun 23, 2015
1 parent a10abd3 commit 70f2d92
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion AugendiagnoseFX/resources/bundles/Strings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ menu_store_position=Store zoom/position
menu_uninstall=Uninstall Application
menu_view=View
menu_window=Window
message_confirm_exit_unsaved=There are unsaved comments. Do you really want to close?
message_confirm_exit_unsaved=There are unsaved comments.\nDo you really want to close?
message_confirm_new_version=There is a new version %1$s of the application.\nDo you want to download it now?
message_error_could_not_open_log_file=Could not open log file %1$s.\nError\: %2$s
message_error_failed_to_store_metadata=Failed to store metadata in file %1$s
message_error_unknown_error=Unknown Error\: %1$s
message_info_app_about=Eye Diagnosis version %1$s\n©Jörg Eisfeld 2015
message_info_no_new_version=You have the latest version of the application.
message_info_saving_photo=Currently saving photo.\nPlease wait until everything is saved before closing.
message_progress_loading_photo=Loading eye photo %1$s...
message_progress_loading_photos=Loading eye photos for %1$s...
message_progress_loading_update=Loading update %1$s...
Expand Down
3 changes: 2 additions & 1 deletion AugendiagnoseFX/resources/bundles/Strings_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ menu_store_position=Zoom/Position speichern
menu_uninstall=Anwendung deinstallieren
menu_view=Ansicht
menu_window=Fenster
message_confirm_exit_unsaved=Sie haben den Kommentar noch nicht gespeichert. Wollen Sie wirklich schließen?
message_confirm_exit_unsaved=Sie haben den Kommentar noch nicht gespeichert.\nWollen Sie wirklich schließen?
message_confirm_new_version=Es gibt eine neue Version %1$s der Anwendung.\nWollen Sie diese jetzt herunterladen?
message_error_could_not_open_log_file=Konnte Logfile %1$s nicht öffnen.\nFehler\: %2$s
message_error_failed_to_store_metadata=Konnte Bildinformationen nicht in Datei %1$s speichern
message_error_unknown_error=Unbekannter Fehler\: %1$s
message_info_app_about=Augendiagnose Version %1$s\n©Jörg Eisfeld 2015
message_info_no_new_version=Sie haben die aktuellste Version der Anwendung.
message_info_saving_photo=Es wird gerade ein Foto gespeichert.\nBitte warten Sie bis der Speichervorgang abgeschlossen ist,\nbevor Sie die Anwendung schließen.
message_progress_loading_photo=Lade Augenfoto %1$s...
message_progress_loading_photos=Lade Augenfotos von %1$s...
message_progress_loading_update=Lade Aktualisierung %1$s...
Expand Down
3 changes: 2 additions & 1 deletion AugendiagnoseFX/resources/bundles/Strings_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ menu_store_position=Guardar zoom y posici
menu_uninstall=Desinstalar aplicación
menu_view=Ver
menu_window=Ventana
message_confirm_exit_unsaved=Hay comentarios que no haya guardado. ¿Realmente desea cerrar?
message_confirm_exit_unsaved=Hay comentarios que no haya guardado.\n¿Realmente desea cerrar?
message_confirm_new_version=Hay una nueva versión %1$s de la aplicación.\n¿Quiere descargarla ahora?
message_error_could_not_open_log_file=No podría abrir Logfile %1$s.\nError\: %2$s
message_error_failed_to_store_metadata=No se ha podido almacenar los metadatos en el archivo %1$s
message_error_unknown_error=Error desconocido\: %1$s
message_info_app_about=Diagnóstico ocular versión %1$s\n©Jörg Eisfeld 2015
message_info_no_new_version=Usted tiene la última versión de la aplicación.
message_info_saving_photo=Actualmente guardando foto.\nPor favor, espere hasta que todo sea guardado antes de cerrar.
message_progress_loading_photo=Cargando foto ocular %1$s...
message_progress_loading_photos=Cargando fotos ocular de %1$s...
message_progress_loading_update=Cargando actualización %1$s...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import de.eisfeldj.augendiagnosefx.util.ResourceConstants;
import de.eisfeldj.augendiagnosefx.util.ResourceUtil;
import de.eisfeldj.augendiagnosefx.util.VersioningUtil;
import de.eisfeldj.augendiagnosefx.util.imagefile.JpegSynchronizationUtil;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
Expand Down Expand Up @@ -100,6 +101,11 @@ public void handle(final WindowEvent event) {
* Exit the application after asking for confirmation if there are unsaved data.
*/
public static void exitAfterConfirmation() {
if (JpegSynchronizationUtil.hasRunningSaveRequests()) {
DialogUtil.displayInfo(ResourceConstants.MESSAGE_INFO_SAVING_PHOTO);
return;
}

if (BaseController.hasDirtyInstance()) {
ConfirmDialogListener listener = new ConfirmDialogListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private ResourceConstants() {
public static final String MESSAGE_ERROR_UNKNOWN_ERROR = "message_error_unknown_error";
public static final String MESSAGE_INFO_APP_ABOUT = "message_info_app_about";
public static final String MESSAGE_INFO_NO_NEW_VERSION = "message_info_no_new_version";
public static final String MESSAGE_INFO_SAVING_PHOTO = "message_info_saving_photo";
public static final String MESSAGE_PROGRESS_LOADING_PHOTO = "message_progress_loading_photo";
public static final String MESSAGE_PROGRESS_LOADING_PHOTOS = "message_progress_loading_photos";
public static final String MESSAGE_PROGRESS_LOADING_UPDATE = "message_progress_loading_update";
Expand Down

0 comments on commit 70f2d92

Please sign in to comment.