diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java index 985544c8..47c5b8d1 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java @@ -38,7 +38,8 @@ public class ImageUploadPage extends ImageUploadPageLayout { private String lastDetectedName = null; private ImageDetailsRead existingImage = null; - public ImageUploadPage(Wizard wizard, UploadWizardState uploadWizardState, final ImageDetailsRead existingImage) { + public ImageUploadPage(Wizard wizard, UploadWizardState uploadWizardState, + final ImageDetailsRead existingImage) { super(wizard); setPageComplete(false); this.canComeBack = false; @@ -121,7 +122,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { if (vmDiskFileInfo.canRead()) { state.diskFile = vmDiskFileInfo; } else { - setErrorMessage("'" + vmDiskFileInfo.getPath() + "' kann nicht gelesen werden!"); + setErrorMessage("'" + vmDiskFileInfo.getName() + "' kann nicht gelesen werden!"); setPageComplete(false); return; } @@ -134,7 +135,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { String imageName = imageNameTextField.getText(); if (imageName.isEmpty() || imageName.equals(lastDetectedName)) { imageNameTextField.setText(state.meta.getDisplayName()); - } + } } lastDetectedName = state.meta.getDisplayName(); state.detectedOs = state.meta.getOs(); @@ -163,8 +164,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { // are we creating a new image? then either: // get the image name either auto filled by VmwareMetaData or by user // get the image name from the image we are uploading a new version of - state.name = existingImage != null ? - existingImage.getImageName() : imageNameTextField.getText(); + state.name = existingImage != null ? existingImage.getImageName() : imageNameTextField.getText(); // -- create image to get uuid -- if (existingImage == null) { @@ -172,7 +172,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { state.uuid = ThriftActions.createImage(JOptionPane.getFrameForComponent(this), state.name); if (state.uuid == null) return false; - + imageNameTextField.setEnabled(false); imageFileBrowseButton.setEnabled(false); imageFileTextField.setEnabled(false); @@ -182,8 +182,9 @@ public class ImageUploadPage extends ImageUploadPageLayout { } // -- request upload for that uuid -- if (state.transferInformation == null) { - state.transferInformation = ThriftActions.requestVersionUpload(JOptionPane.getFrameForComponent(this), - state.uuid, state.diskFile.length(), null, state.meta.getFilteredDefinition()); + state.transferInformation = ThriftActions.requestVersionUpload( + JOptionPane.getFrameForComponent(this), state.uuid, state.diskFile.length(), null, + state.meta.getFilteredDefinition()); if (state.transferInformation == null) return false; } |