Skip to content

Commit

Permalink
Merge pull request #5550 from IllianiCBT/massTrain_removePreferences
Browse files Browse the repository at this point in the history
Remove User Preferences Handling from `BatchXPDialog`
  • Loading branch information
IllianiCBT authored Dec 29, 2024
2 parents d109037 + 449266e commit aad5c67
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java
Original file line number Diff line number Diff line change
@@ -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.
*
Expand All @@ -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;
Expand Down Expand Up @@ -91,8 +90,6 @@ public BatchXPDialog(JFrame parent, Campaign campaign) {
personnelModel.refreshData();

initComponents();

setUserPreferences();
}

private void initComponents() {
Expand All @@ -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);
Expand Down

0 comments on commit aad5c67

Please sign in to comment.