diff options
| author | Simon Rettberg | 2015-07-10 19:58:23 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2015-07-10 19:58:23 +0200 |
| commit | 4b05db1e51852dda4be1bb7f92524e47276014d8 (patch) | |
| tree | 3a602d10d96544d50cede493409c565515c6811f | |
| parent | [client] Got rid of ini4j, store config as java properties file, simplified c... (diff) | |
| parent | [client] null check on selectedElement in ImageListWindow to prevent those na... (diff) | |
| download | tutor-module-4b05db1e51852dda4be1bb7f92524e47276014d8.tar.gz tutor-module-4b05db1e51852dda4be1bb7f92524e47276014d8.tar.xz tutor-module-4b05db1e51852dda4be1bb7f92524e47276014d8.zip | |
Merge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1
4 files changed, 42 insertions, 25 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java index 4075adf0..3d3221d4 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java @@ -30,7 +30,7 @@ public class ImageListWindow extends ImageListWindowLayout { public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection(); ImageSummaryRead selectedElement = (ImageSummaryRead) selection.getFirstElement(); - + if (selectedElement == null) return; String imageName = selectedElement.getImageName(); if (imageName == null) { imageSelectedNameLabel.setText("Unknown"); 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 937ed86e..dc25aad9 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 @@ -1,21 +1,23 @@ package org.openslx.dozmod.gui.wizard; +import org.apache.log4j.Logger; import org.eclipse.jface.wizard.Wizard; +import org.openslx.dozmod.gui.MainWindow; +import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.wizard.page.ImageMetaDataPage; import org.openslx.dozmod.gui.wizard.page.ImageUploadPage; public class ImageWizard extends Wizard { + private final static Logger LOGGER = Logger.getLogger(ImageWizard.class); + protected ImageUploadPage imageUploadPage; protected ImageMetaDataPage imageMetaDataPage; protected boolean editExistingImage; - - - /** * Wizard for creating or editing an image - * @param editExistingImage wether to create new or edit existing image + * @param editExistingImage whether to create new or edit existing image */ public ImageWizard(boolean editExistingImage) { super(); @@ -40,7 +42,7 @@ public class ImageWizard extends Wizard { @Override public boolean performFinish() { - // TODO actually try to upload the stuff + MainWindow.showMessageBox("Would try to upload now :)", MessageType.INFO, LOGGER, null); return true; } } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java index b39e8733..67cfb045 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java @@ -51,7 +51,8 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { Label osCaption = new Label(container, SWT.NONE); osCaption.setText("Betriebssystem:"); - osCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY); + osCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); + osCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); Label descriptionCation = new Label(container, SWT.NONE); descriptionCation.setText("Beschreibung:"); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageMetaDataPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageMetaDataPage.java index d79c109a..0e6c01f6 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageMetaDataPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageMetaDataPage.java @@ -3,15 +3,15 @@ package org.openslx.dozmod.gui.wizard.page; import java.util.List; import org.apache.log4j.Logger; -import org.apache.thrift.TException; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.widgets.Composite; import org.openslx.bwlp.thrift.iface.OperatingSystem; -import org.openslx.dozmod.gui.MainWindow; -import org.openslx.dozmod.gui.helper.MessageType; +import org.openslx.dozmod.gui.helper.Gui; import org.openslx.dozmod.gui.wizard.layout.ImageMetaDataPageLayout; -import org.openslx.thrifthelper.ThriftManager; +import org.openslx.dozmod.thrift.MetaDataCache; +import org.openslx.util.QuickTimer; +import org.openslx.util.QuickTimer.Task; public class ImageMetaDataPage extends ImageMetaDataPageLayout { @@ -27,22 +27,22 @@ public class ImageMetaDataPage extends ImageMetaDataPageLayout { super.createControl(parent); // fetch the OS list - List<OperatingSystem> osList = null; - try { - osList = ThriftManager.getSatClient().getOperatingSystems(); - } catch (TException e) { - MainWindow.showMessageBox("Konnte die Liste der Betriebsysteme nicht holen!", MessageType.ERROR, LOGGER, e); - return; - } + QuickTimer.scheduleOnce(new Task() { + List<OperatingSystem> osList = null; - for (OperatingSystem os : osList) { - if (os.isSetOsName()) { - osCombo.add(os.getOsName()); - osCombo.setData(os.osName, os); + @Override + public void fire() { + osList = MetaDataCache.getOperatingSystems(); + // now send the organisations back to the LoginWindow + // through populateIdpCombo() + Gui.display.asyncExec(new Runnable() { + @Override + public void run() { + fillOsCombo(osList); + } + }); } - } - // select the first one by default - osCombo.select(0); + }); descriptionText.addKeyListener(new KeyListener() { @Override @@ -55,4 +55,18 @@ public class ImageMetaDataPage extends ImageMetaDataPageLayout { } }); } + + /** + * @param osList list of OS's to fill the combo with + */ + private void fillOsCombo(List<OperatingSystem> osList) { + for (OperatingSystem os : osList) { + if (os.isSetOsName()) { + osCombo.add(os.getOsName()); + osCombo.setData(os.osName, os); + } + } + // select the first one by default + osCombo.select(0); + } } |
