Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove User Preferences Handling from BatchXPDialog #5550

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading