diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-11-07 10:02:36 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-11-07 10:02:55 +0100 |
commit | ca6544acdadbc42dbbc9be68718782eeb815b0ad (patch) | |
tree | 0671736d0385e87df362c446ecc39ca7e10528b5 /trunk/pdf-over-gui/src/main | |
parent | fd2a1aacd3841b84dcad14346aa7ce1715607ad0 (diff) | |
download | pdf-over-ca6544acdadbc42dbbc9be68718782eeb815b0ad.tar.gz pdf-over-ca6544acdadbc42dbbc9be68718782eeb815b0ad.tar.bz2 pdf-over-ca6544acdadbc42dbbc9be68718782eeb815b0ad.zip |
+ localized error "This may not be a PDF File"
Diffstat (limited to 'trunk/pdf-over-gui/src/main')
4 files changed, 10 insertions, 3 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index d612f3c9..c7e1b7b7 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -173,8 +173,13 @@ public class PositioningComposite extends StateComposite { .map(FileChannel.MapMode.READ_ONLY, 0, chan.size()); chan.close(); rafile.close(); - - this.pdf = new PDFFile(buf); + try + { + this.pdf = new PDFFile(buf); + } + catch (IOException e) { + throw new IOException(Messages.getString("error.MayNotBeAPDF"), e); //$NON-NLS-1$ + } if (this.viewer == null) { this.viewer = new SignaturePanel(this.pdf); this.frame.add(this.viewer); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java index 44513806..d877cdcf 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java @@ -101,7 +101,7 @@ public class PositioningState extends State { log.error("Failed to display PDF document", e); //$NON-NLS-1$ ErrorDialog dialog = new ErrorDialog( this.stateMachine.getGUIProvider().getMainShell(), - e.getMessage(), ERROR_BUTTONS.RETRY_CANCEL); + e.getLocalizedMessage(), ERROR_BUTTONS.RETRY_CANCEL); if(dialog.open() == SWT.RETRY) { this.stateMachine.update(); } else { diff --git a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index a60175fa..413e9db5 100644 --- a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -77,6 +77,7 @@ error.SignaturePanel.NoRender="Could not render page" error.TanTooLong=Entered TAN too long error.Unexpected=Unexpected Error error.title=Error +error.MayNotBeAPDF=This may not be a PDF File exception.InvalidEmblemFile=%s is an invalid signature logo file! exception.InvalidPort=%s is invalid: has to be a number between %d and %d exception.PasswordTooLong=Given password is too long! diff --git a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties index 789880f9..c3a1d302 100644 --- a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties +++ b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties @@ -77,6 +77,7 @@ error.SignaturePanel.NoRender="Konnte Seite nicht darstellen" error.TanTooLong=Eingegebener TAN zu lange error.Unexpected=Unerwarteter Fehler error.title=Fehler +error.MayNotBeAPDF=Dies ist möglicherweise keine PDF Datei exception.InvalidEmblemFile=%s ist eine ungültige Bildmarken-Datei! exception.InvalidPort=%s ist ungültig: muss eine Nummer zwischen %d und %d sein. exception.PasswordTooLong=Eingegebenes Passwort ist zu lange! |