diff options
author | Simon Rettberg | 2015-07-31 18:09:31 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-07-31 18:09:31 +0200 |
commit | d54ec5d58f657d5529c47bc5fafa38ca7f2283e3 (patch) | |
tree | c60c3dce4efc091e749d08eca8b916320f2807dd /dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java | |
parent | [client] Continued implementation of Wizard (diff) | |
download | tutor-module-d54ec5d58f657d5529c47bc5fafa38ca7f2283e3.tar.gz tutor-module-d54ec5d58f657d5529c47bc5fafa38ca7f2283e3.tar.xz tutor-module-d54ec5d58f657d5529c47bc5fafa38ca7f2283e3.zip |
[client] Mostly finished Wizard implementation
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java index 33cdea74..97efd804 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageWizard.java @@ -46,26 +46,26 @@ public class ImageWizard extends Wizard { } @Override - public boolean performFinish() { - // TODO evaluate table state and create the map of permissions - // - // since we only started the download and created a "blank" image entry + public boolean wantFinish() { + // since we only started the upload and created a "blank" image entry // we can here do all the sanity checks on the fields of UploadWizardState // and react accordingly. // check state - if (!isStateValid()) { - LOGGER.error("Invalid state!"); - return false; - } else { - // TODO run the actually request over external threaded class - try { - // push to sat - ThriftManager.getSatClient().updateImageBase(Session.getSatelliteToken(), - uploadWizardState.uuid.toString(), imageBaseWriteFromState()); - } catch (TException e) { - LOGGER.error("Fail to push image metadata to satellite: ", e); - return false; - } + return isStateValid(); + } + + @Override + public void performFinish() { + // TODO evaluate table state and create the map of permissions + // TODO run the actually request over external threaded class + try { + // push to sat + ThriftManager.getSatClient().updateImageBase(Session.getSatelliteToken(), + uploadWizardState.uuid.toString(), imageBaseWriteFromState()); + } catch (TException e) { + Gui.showMessageBox(this, "Fail to push image metadata to satellite: ", MessageType.ERROR, LOGGER, + e); + return; } // push permissions to satellite server @@ -75,9 +75,9 @@ public class ImageWizard extends Wizard { ThriftManager.getSatClient().writeImagePermissions(Session.getSatelliteToken(), uploadWizardState.uuid, uploadWizardState.permissionList); } catch (TException e) { - // TODO Auto-generated catch block - LOGGER.error("Could not write permissions list to satellite: ", e); - return false; + Gui.showMessageBox(this, "Could not write permissions list to satellite: ", + MessageType.ERROR, LOGGER, e); + return; } } try { @@ -86,12 +86,12 @@ public class ImageWizard extends Wizard { uploadWizardState.transferInformation.getToken(), new ImageVersionWrite(uploadWizardState.isEnabled, uploadWizardState.isRestricted)); } catch (TException e) { - LOGGER.error("Could not set active/restricted flags to satellite: ", e); - return false; + Gui.showMessageBox(this, "Could not set active/restricted flags to satellite: ", + MessageType.ERROR, LOGGER, e); + return; } Gui.showMessageBox(this, "Creation of image worked :)", MessageType.INFO, LOGGER, null); - return true; } private boolean isStateValid() { |