diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java index 10bdab30..00890ad2 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java @@ -64,8 +64,8 @@ public class ImageCreationWizard extends Wizard implements UiFeedback { public void performFinish() { // TODO check status of each step and stop if something goes wrong // push image base to satellite - ThriftActions.updateImageBase(JOptionPane.getFrameForComponent(this), - uploadWizardState.uuid, imageBaseWriteFromState()); + ThriftActions.updateImageBase(JOptionPane.getFrameForComponent(this), uploadWizardState.uuid, + imageBaseWriteFromState()); // push permissions to satellite if we have custom permissions if (uploadWizardState.permissionMap != null) { @@ -74,14 +74,15 @@ public class ImageCreationWizard extends Wizard implements UiFeedback { } // push version metadata to satellite ThriftActions.updateImageVersion(JOptionPane.getFrameForComponent(this), - uploadWizardState.transferInformation.getToken(), - new ImageVersionWrite(uploadWizardState.isRestricted)); + uploadWizardState.transferInformation.getToken(), new ImageVersionWrite( + uploadWizardState.isRestricted)); } /** * Checks the validity of the state * - * @return true if we have all the needed information in the state, false otherwise + * @return true if we have all the needed information in the state, false + * otherwise */ private boolean isStateValid() { // debug purposes @@ -144,11 +145,14 @@ public class ImageCreationWizard extends Wizard implements UiFeedback { // build imageBaseWrite return new ImageBaseWrite(uploadWizardState.name, uploadWizardState.description, uploadWizardState.selectedOs.getOsId(), uploadWizardState.meta.getVirtualizer().getVirtId(), - uploadWizardState.isTemplate, uploadWizardState.defaultPermissions, uploadWizardState.shareMode); + uploadWizardState.isTemplate, uploadWizardState.defaultPermissions, + uploadWizardState.shareMode); } @Override protected boolean onCancelRequest() { + if (uploadWizardState.uuid == null) + return true; boolean confirmed = Gui.showMessageBox(this, "Möchten Sie den Vorgang wirklich abbrechen?", MessageType.QUESTION_YESNO, null, null); if (confirmed) { @@ -156,9 +160,8 @@ public class ImageCreationWizard extends Wizard implements UiFeedback { @Override public void fire() { try { - if (uploadWizardState.uuid != null) - ThriftManager.getSatClient().deleteImageBase(Session.getSatelliteToken(), - uploadWizardState.uuid); + ThriftManager.getSatClient().deleteImageBase(Session.getSatelliteToken(), + uploadWizardState.uuid); } catch (TException e) { LOGGER.debug("Error canceling upload on sat: ", e); } |