diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2012-11-14 12:07:00 +0100 |
---|---|---|
committer | vkrnjic <vkrnjic@klio.iaik.tugraz.at> | 2012-11-14 12:22:07 +0100 |
commit | 58cb0e8622197cd8a7fcbd057ea79225226c8ccf (patch) | |
tree | 122ddccef3f9264317090ac741fb69c772624afc /trunk/pdf-over-gui/src/main/java | |
parent | ec659adff5aff99b8de66c7b815db4898d8db90e (diff) | |
download | pdf-over-58cb0e8622197cd8a7fcbd057ea79225226c8ccf.tar.gz pdf-over-58cb0e8622197cd8a7fcbd057ea79225226c8ccf.tar.bz2 pdf-over-58cb0e8622197cd8a7fcbd057ea79225226c8ccf.zip |
Only save document once
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java')
-rw-r--r-- | trunk/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/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java index 01c1fa6b..c06d04de 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java +++ b/trunk/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); |