summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2014-02-03 15:56:29 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2014-02-03 15:56:29 +0000
commit367b3c257c57a2665116da5a5f12c7dfa9d23067 (patch)
tree4d014a1e9a2621a5397c74a229a959e66bde599b
parentafb1fa29ae33467c62d4927fa0b58d339cbdd6e7 (diff)
downloadmocca-367b3c257c57a2665116da5a5f12c7dfa9d23067.tar.gz
mocca-367b3c257c57a2665116da5a5f12c7dfa9d23067.tar.bz2
mocca-367b3c257c57a2665116da5a5f12c7dfa9d23067.zip
Show error message when document opening fails
Happens e.g. when no viewer is installed under Windows PDFOVER-3 #Done Fixed git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@507 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java11
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties3
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties3
3 files changed, 13 insertions, 4 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
index 76efb41f..f4a78eb0 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
@@ -31,6 +31,7 @@ import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
@@ -386,10 +387,16 @@ public class OutputComposite extends StateComposite {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().open(f);
} else {
- log.error("SWT Desktop is not supported on this platform!"); //$NON-NLS-1$
+ log.info("SWT Desktop is not supported on this platform"); //$NON-NLS-1$
+ Program.launch(f.getAbsolutePath());
}
- } catch (Exception ex) {
+ } catch (IOException ex) {
log.error("OpenSelectionListener: ", ex); //$NON-NLS-1$
+ ErrorDialog error = new ErrorDialog(getShell(),
+ String.format(Messages.getString("error.FailedToOpenDocument"), //$NON-NLS-1$
+ ex.getLocalizedMessage()), BUTTONS.RETRY_CANCEL);
+ if (error.open() == SWT.RETRY)
+ widgetSelected(e);
}
}
}
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
index 740fe99b..1dec3ab3 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
@@ -88,6 +88,7 @@ error.Details=Details
error.EnteredReferenceValue=You entered the reference value!
error.FailedToGetSignedDocument=Failed to get signed document.
error.FailedToLoadEmblem=Failed to load the signature logo
+error.FailedToOpenDocument=Failed to open signed document: %s.
error.FailedToSaveSettings=Failed to save configuration file!
error.FileNotExist=File %s does not exist!
error.Initialization=Initialization failed. Please check your configuration.
@@ -131,7 +132,7 @@ mobileBKU.show=<a>Show signature data</a>
mobileBKU.show_tooltip=Shows the data to be signed
mobileBKU.tan_tries_exceeded=TAN tries exceeded, request a new TAN?
output.file_ask_overwrite=File %s already exists, do you want to overwrite it?
-output.link_open_message=You can open the signed file <a>here</a>
+output.link_open_message=You can open the signed file <a>here</a>.
output.link_save_message=You can save the signed file
output.save_failed=Saving file %s failed: %s
output.success_message=Signature was successful
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
index 38c053cc..66ab0ee1 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
@@ -88,6 +88,7 @@ error.Details=Details
error.EnteredReferenceValue=Sie haben den Vergleichswert eingegeben!
error.FailedToGetSignedDocument=Konnte signiertes Dokument nicht erhalten.
error.FailedToLoadEmblem=Konnte Bildmarke nicht speichern
+error.FailedToOpenDocument=Konnte signiertes Dokument nicht öffnen: %s.
error.FailedToSaveSettings=Konnte Konfigurationsdatei nicht speichern!
error.FileNotExist=Datei %s existiert nicht!
error.Initialization=Initialisierung fehlgeschlagen. Bitte überprüfen Sie Ihre Konfiguration.
@@ -131,7 +132,7 @@ mobileBKU.show=<a>Signaturdaten anzeigen</a>
mobileBKU.show_tooltip=Zeigt die zu signierenden Daten an
mobileBKU.tan_tries_exceeded=Zu viele TAN-Versuche, neue TAN anfordern?
output.file_ask_overwrite=Datei %s existiert bereits, wollen Sie sie überschreiben?
-output.link_open_message=Sie können das signierte Dokument <a>hier</a> öffnen
+output.link_open_message=Sie können das signierte Dokument <a>hier</a> öffnen.
output.link_save_message=Sie können das signierte Dokument speichern
output.save_failed=Datei %s konnte nicht gespeichert werden: %s
output.success_message=Signatur war erfolgreich