From 3832620f8a56ec82009843e014d37b5544a24e5d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 5 Sep 2015 22:25:53 +0200 Subject: [client] Change wording of upload wizard, refine cancel check --- .../dozmod/gui/wizard/ImageCreationWizard.java | 21 ++++++++++++--------- .../gui/wizard/layout/ImageUploadPageLayout.java | 11 +++++++---- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'dozentenmodul/src/main/java/org/openslx') 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); } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageUploadPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageUploadPageLayout.java index 6775b080..1e6fc9ca 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageUploadPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageUploadPageLayout.java @@ -3,6 +3,7 @@ package org.openslx.dozmod.gui.wizard.layout; import java.awt.event.KeyEvent; import javax.swing.BorderFactory; +import javax.swing.Box; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JTextArea; @@ -54,6 +55,8 @@ public abstract class ImageUploadPageLayout extends WizardPage { grid.add(softwareLicenseBox, 2, 1).fill(false, false).expand(true, false); grid.nextRow(); + grid.add(Box.createVerticalGlue(), 3).expand(true, true); + // -- info text field -- JTextArea infoText = new JTextArea(); infoText.setBorder(BorderFactory.createTitledBorder("Hinweis")); @@ -62,12 +65,12 @@ public abstract class ImageUploadPageLayout extends WizardPage { infoText.setEditable(false); infoText.setFocusable(false); infoText.setOpaque(false); - infoText.setText("Sollten Sie noch kein fertiges Image besitzen, " - + "können Sie sich in der Imageübersicht eine Vorlage herunterladen, " - + "diese an Ihre Bedürfnisse anpassen und anschliessend über diesen Dialog hochladen."); + infoText.setText("Haben Sie noch keine eigene Virtuelle Maschine erstellt, " + + "können Sie sich in der Übersicht eine VM als Vorlage herunterladen, " + + "diese an Ihre Bedürfnisse anpassen und anschließend über diesen Assistenten hochladen."); grid.add(infoText, 3).fill(true,false).expand(true, false); grid.nextRow(); - grid.finish(true); + grid.finish(false); } } -- cgit v1.2.3-55-g7522