diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:25:22 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:25:22 +0000 |
commit | 59e3e4d43db93c9ec06e182fbf36cf08d3ff7cbc (patch) | |
tree | c471175dd04aa4ae3d8ee3e0f8166350737688f9 /pdf-over-gui/src/main | |
parent | ba957ec5614008cc3e7c058049e62621fb84f0db (diff) | |
download | pdf-over-59e3e4d43db93c9ec06e182fbf36cf08d3ff7cbc.tar.gz pdf-over-59e3e4d43db93c9ec06e182fbf36cf08d3ff7cbc.tar.bz2 pdf-over-59e3e4d43db93c9ec06e182fbf36cf08d3ff7cbc.zip |
Only save document once
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@310 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java index 01c1fa6b..c06d04de 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java @@ -26,6 +26,7 @@ import at.asit.pdfover.gui.composites.OutputComposite; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.utils.Messages; +import at.asit.pdfover.gui.workflow.ConfigProvider; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; @@ -48,15 +49,24 @@ public class OutputState extends State { this.outputComposite = this.stateMachine.getGUIProvider() .createComposite(OutputComposite.class, SWT.RESIZE, this); - File tmpDir = new File(this.stateMachine.getConfigProvider().getConfigurationDirectory() + "/tmp"); //$NON-NLS-1$ + ConfigProvider config = this.stateMachine.getConfigProvider(); + Status status = this.stateMachine.getStatus(); + + File tmpDir = new File(config.getConfigurationDirectory() + "/tmp"); //$NON-NLS-1$ if(!tmpDir.exists()) { tmpDir.mkdir(); } - this.outputComposite.setOutputDir(this.stateMachine.getConfigProvider().getDefaultOutputFolder()); + this.outputComposite.setOutputDir(config.getDefaultOutputFolder()); this.outputComposite.setTempDir(tmpDir.getAbsolutePath()); - this.outputComposite.setInputFile(this.stateMachine.getStatus().getDocument()); + this.outputComposite.setInputFile(status.getDocument()); + + this.outputComposite.setSignedDocument(status.getSignResult() + .getSignedDocument()); + + // Save signed document + this.outputComposite.saveDocument(); } return this.outputComposite; @@ -78,11 +88,6 @@ public class OutputState extends State { } OutputComposite outputComposite = this.getOutputComposite(); - outputComposite.setSignedDocument(status.getSignResult() - .getSignedDocument()); - - // Save signed document - outputComposite.saveDocument(); // Display dialog this.stateMachine.getGUIProvider().display(outputComposite); |