diff options
| author | Mürsel Türk | 2020-07-07 12:08:12 +0200 |
|---|---|---|
| committer | Mürsel Türk | 2020-07-07 12:08:12 +0200 |
| commit | b0fe31442af8158ff9a2f72669f24e6b303df9bf (patch) | |
| tree | 528760b000b6549d70a751b215c75adb599a6bae /dozentenmodul/src/main/java/org | |
| parent | [client] Add resource bundle files for wizard/page classes. Update the wizard... (diff) | |
| download | tutor-module-b0fe31442af8158ff9a2f72669f24e6b303df9bf.tar.gz tutor-module-b0fe31442af8158ff9a2f72669f24e6b303df9bf.tar.xz tutor-module-b0fe31442af8158ff9a2f72669f24e6b303df9bf.zip | |
[client] Add resource bundle files for wizard classes. Update the wizard classes accordingly.
Diffstat (limited to 'dozentenmodul/src/main/java/org')
4 files changed, 22 insertions, 19 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 845c4e3f..0f310c15 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 @@ -9,6 +9,7 @@ import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageBaseWrite; import org.openslx.bwlp.thrift.iface.ImageVersionWrite; import org.openslx.dozmod.gui.Gui; +import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.helper.QuitNotification; import org.openslx.dozmod.gui.helper.UiFeedback; @@ -56,7 +57,7 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif @Override public String getWindowTitle() { - return "Neue VM erzeugen"; + return I18n.WIZARD.getString("ImageCreation.Wizard.title"); } @Override @@ -67,7 +68,7 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif // check state if (!isStateValid()) { // TODO: Show what went wrong - Gui.showMessageBox(this, "Ein interner Fehler ist aufgetreten.\n\nDetails in der Logdatei.", + Gui.showMessageBox(this, I18n.WIZARD.getString("ImageCreation.Message.error.stateInvalid"), MessageType.ERROR, null, null); return false; } @@ -77,7 +78,7 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif ThriftActions.updateImageBase(state.uuid, imageBaseWriteFromState()); } catch (TException e) { ThriftError.showMessage(null, LOGGER, e, - "Konnte die Metadaten der VM nicht auf dem Satelliten speichern!"); + I18n.WIZARD.getString("ImageCreation.Message.error.baseNotWritten")); return false; } baseWritten = true; @@ -88,7 +89,7 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif try { ThriftActions.writeImagePermissions(state.uuid, state.permissionMap); } catch (TException e) { - Gui.showMessageBox(this, "Konnte die Berechtigungen nicht auf dem Satelliten speichern!", + Gui.showMessageBox(this, I18n.WIZARD.getString("ImageCreation.Message.error.permissionsNotWritten"), MessageType.ERROR, null, null); ThriftActions.deleteImageBase(JOptionPane.getFrameForComponent(this), state.uuid); return false; @@ -106,8 +107,8 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif state.isRestricted)); } catch (TException e) { if (state.isRestricted) { - Gui.showMessageBox(null, "Unerwarteter Fehler beim Setzen der Option" - + " 'Enthält lizenzpflichtige Software' für diese Virtuelle Maschine.", + Gui.showMessageBox(null, + I18n.WIZARD.getString("ImageCreation.Message.error.updateImageVersionFailed"), MessageType.WARNING, LOGGER, e); } } @@ -193,7 +194,7 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif protected boolean onCancelRequest() { if (state.uuid == null) return true; - boolean confirmed = Gui.showMessageBox(this, "Möchten Sie den Vorgang wirklich abbrechen?", + boolean confirmed = Gui.showMessageBox(this, I18n.WIZARD.getString("ImageCreation.Message.yesNo.cancelRequest"), MessageType.QUESTION_YESNO, null, null); if (confirmed) { QuickTimer.scheduleOnce(new Task() { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java index b7f5370c..d807e85c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java @@ -7,6 +7,7 @@ import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; import org.openslx.bwlp.thrift.iface.ImageVersionWrite; import org.openslx.dozmod.gui.Gui; +import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.helper.QuitNotification; import org.openslx.dozmod.gui.helper.UiFeedback; @@ -49,8 +50,7 @@ public class ImageUpdateWizard extends Wizard implements UiFeedback, QuitNotific if (state.isRestricted) { Gui.showMessageBox( null, - "Unerwarteter Fehler beim Setzen der Option" - + " 'Enthält lizenzpflichtige Software' für diese Virtuelle Maschine.", + I18n.WIZARD.getString("ImageUpdate.Message.error.updateImageVersionFailed"), MessageType.WARNING, LOGGER, e); } } @@ -70,7 +70,7 @@ public class ImageUpdateWizard extends Wizard implements UiFeedback, QuitNotific protected boolean onCancelRequest() { if (state.uuid == null) return true; - boolean confirmed = Gui.showMessageBox(this, "Möchten Sie den Vorgang wirklich abbrechen?", + boolean confirmed = Gui.showMessageBox(this, I18n.WIZARD.getString("ImageUpdate.Message.yesNo.cancelRequest"), MessageType.QUESTION_YESNO, null, null); if (confirmed && state.upload != null) { QuickTimer.scheduleOnce(new Task() { @@ -95,7 +95,7 @@ public class ImageUpdateWizard extends Wizard implements UiFeedback, QuitNotific @Override public String getWindowTitle() { - return "Neue VM-Version"; + return I18n.WIZARD.getString("ImageUpdate.Wizard.title"); } @Override diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java index 577cd16e..a5b235a9 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java @@ -9,6 +9,7 @@ import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.LectureWrite; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.MainWindow; +import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.helper.UiFeedback; import org.openslx.dozmod.gui.window.LectureListWindow; @@ -61,12 +62,12 @@ public class LectureWizard extends Wizard implements UiFeedback { @Override public String getWindowTitle() { - return "Neue Veranstaltung erzeugen"; + return I18n.WIZARD.getString("Lecture.Wizard.title"); } @Override protected boolean onCancelRequest() { - return Gui.showMessageBox(this, "Möchten Sie den Vorgang wirklich abbrechen?", + return Gui.showMessageBox(this, I18n.WIZARD.getString("Lecture.Message.yesNo.cancelRequest"), MessageType.QUESTION_YESNO, null, null); } @@ -109,7 +110,7 @@ public class LectureWizard extends Wizard implements UiFeedback { } // all good, refresh cache and change to LectureList - Gui.showMessageBox(this, "Veranstaltung erstellt!", MessageType.INFO, null, null); + Gui.showMessageBox(this, I18n.WIZARD.getString("Lecture.Message.info.finish"), MessageType.INFO, null, null); LectureCache.get(true); MainWindow.showPage(LectureListWindow.class); return true; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/Wizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/Wizard.java index 6a5afa3f..82a3c7a4 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/Wizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/Wizard.java @@ -25,6 +25,7 @@ import javax.swing.SwingConstants; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.control.QLabel; import org.openslx.dozmod.gui.helper.GridManager; +import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.util.ResourceLoader; @SuppressWarnings("serial") @@ -76,10 +77,10 @@ public abstract class Wizard extends JDialog { footer.setLayout(new BoxLayout(footer, BoxLayout.LINE_AXIS)); footer.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); footer.add(Box.createHorizontalGlue()); - btnPrev = new JButton("< Zurück"); - btnNext = new JButton("Weiter >"); - btnCancel = new JButton("Abbrechen"); - btnFinish = new JButton("Fertigstellen"); + btnPrev = new JButton(I18n.WIZARD.getString("Wizard.Button.prev.text")); + btnNext = new JButton(I18n.WIZARD.getString("Wizard.Button.next.text")); + btnCancel = new JButton(I18n.WIZARD.getString("Wizard.Button.cancel.text")); + btnFinish = new JButton(I18n.WIZARD.getString("Wizard.Button.finish.text.0")); footer.add(btnPrev); footer.add(btnNext); footer.add(Box.createRigidArea(new Dimension(10, 10))); @@ -286,7 +287,7 @@ public abstract class Wizard extends JDialog { isPostFinish = true; btnPrev.setVisible(false); btnNext.setVisible(false); - btnFinish.setText("Schließen"); + btnFinish.setText(I18n.WIZARD.getString("Wizard.Button.finish.text.1")); postFinishPage.setVisible(false); contentPanel.add(postFinishPage); showPage(-1); |
