From 28bce67e7cdbcd381d6aa239eb9d148d5b8a18a7 Mon Sep 17 00:00:00 2001 From: Matteo Hausner Date: Mon, 1 Jan 2024 23:53:25 +0100 Subject: [PATCH] Fixes #150 - EditActionsDialog: initialize unsavedProfile property from parent dialog --- .../controllerbuddy/gui/EditActionsDialog.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/bwravencl/controllerbuddy/gui/EditActionsDialog.java b/src/main/java/de/bwravencl/controllerbuddy/gui/EditActionsDialog.java index 02e9a295..cd72b03a 100644 --- a/src/main/java/de/bwravencl/controllerbuddy/gui/EditActionsDialog.java +++ b/src/main/java/de/bwravencl/controllerbuddy/gui/EditActionsDialog.java @@ -30,7 +30,6 @@ import de.bwravencl.controllerbuddy.input.action.annotation.ActionProperty; import io.github.classgraph.ClassGraph; import java.awt.BorderLayout; -import java.awt.Dialog; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; @@ -126,6 +125,9 @@ public final class EditActionsDialog extends JDialog { private final JList availableActionsList = new JList<>(); private final JList assignedActionsList = new JList<>(); + @SuppressWarnings({"serial", "RedundantSuppression"}) + private final Profile unsavedProfile; + @SuppressWarnings({"serial", "RedundantSuppression"}) private Main main; @@ -135,9 +137,6 @@ public final class EditActionsDialog extends JDialog { @SuppressWarnings({"serial", "RedundantSuppression"}) private Input input; - @SuppressWarnings({"serial", "RedundantSuppression"}) - private Profile unsavedProfile; - @SuppressWarnings({"serial", "RedundantSuppression"}) private ButtonToCycleAction cycleAction; @@ -152,7 +151,7 @@ public final class EditActionsDialog extends JDialog { @SuppressWarnings("unchecked") public EditActionsDialog( - @SuppressWarnings("exports") final Dialog parentDialog, + @SuppressWarnings("exports") final EditActionsDialog parentDialog, @SuppressWarnings("exports") final ButtonToCycleAction cycleAction) { super(parentDialog); this.cycleAction = cycleAction; @@ -165,6 +164,8 @@ public EditActionsDialog( throw new RuntimeException(e); } + unsavedProfile = parentDialog.unsavedProfile; + preInit(parentDialog); setTitle(MessageFormat.format( Main.strings.getString("EDIT_ACTIONS_DIALOG_TITLE_CYCLE_ACTION_EDITOR"),