From 449266e4b41d44ff15fe65b7f2b6c2a4816a3c27 Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Sat, 28 Dec 2024 10:34:50 -0600 Subject: [PATCH] Remove unused user preferences handling from BatchXPDialog Removed the entire `setUserPreferences` method, as it was no longer in use, along with associated imports. This cleanup reduces unnecessary code complexity and ensures better maintainability. --- MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java | 40 +------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java b/MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java index 3db8851d0d..00476751b7 100644 --- a/MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 - The MegaMek Team. All Rights Reserved + * Copyright (c) 2016-2024 - The MegaMek Team. All Rights Reserved * * This file is part of MekHQ. * @@ -19,7 +19,6 @@ package mekhq.gui.dialog; import megamek.client.ui.models.XTableColumnModel; -import megamek.client.ui.preferences.*; import megamek.codeUtilities.MathUtility; import megamek.common.enums.SkillLevel; import megamek.logging.MMLogger; @@ -91,8 +90,6 @@ public BatchXPDialog(JFrame parent, Campaign campaign) { personnelModel.refreshData(); initComponents(); - - setUserPreferences(); } private void initComponents() { @@ -105,41 +102,6 @@ private void initComponents() { setLocationRelativeTo(getParent()); } - private void setUserPreferences() { - try { - PreferencesNode preferences = MekHQ.getMHQPreferences().forClass(BatchXPDialog.class); - - choiceType.setName("primaryRole"); - preferences.manage(new JComboBoxPreference(choiceType)); - - choiceExp.setName("experienceLevel"); - preferences.manage(new JComboBoxPreference(choiceExp)); - - choiceRank.setName("rank"); - preferences.manage(new JComboBoxPreference(choiceRank)); - - onlyOfficers.setName("onlyOfficers"); - preferences.manage(new JToggleButtonPreference(onlyOfficers)); - - noOfficers.setName("noOfficers"); - preferences.manage(new JToggleButtonPreference(noOfficers)); - - choiceSkill.setName("skill"); - preferences.manage(new JComboBoxPreference(choiceSkill)); - - skillLevel.setName("skillLevel"); - preferences.manage(new JIntNumberSpinnerPreference(skillLevel)); - - allowPrisoners.setName("allowPrisoners"); - preferences.manage(new JToggleButtonPreference(allowPrisoners)); - - this.setName("dialog"); - preferences.manage(new JWindowPreference(this)); - } catch (Exception ex) { - logger.error("Failed to set user preferences", ex); - } - } - private JComponent getPersonnelTable() { personnelTable = new JTable(personnelModel); personnelTable.setCellSelectionEnabled(false);