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

Save print queue setup between runs #1645

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion megameklab/src/megameklab/ui/dialog/PrintQueueDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

import megamek.client.ui.Messages;
import megamek.common.*;
import megameklab.util.CConfig;
import org.apache.commons.io.FilenameUtils;

import megamek.client.Client;
Expand Down Expand Up @@ -187,9 +188,10 @@ protected Container createCenterPane() {

JPanel checkboxPanel = new FixedXYPanel(new GridLayout(2, 1));
checkboxPanel.add(oneUnitPerSheetCheck);
oneUnitPerSheetCheck.setSelected(CConfig.getBooleanParam(CConfig.PQ_SINGLE_PRINT));
if (fromMul) {
checkboxPanel.add(adjustedBvCheck);
adjustedBvCheck.setSelected(true);
adjustedBvCheck.setSelected(CConfig.getBooleanParam(CConfig.PQ_ADJUSTED_BV));
}

Box panel = Box.createVerticalBox();
Expand Down Expand Up @@ -262,7 +264,11 @@ protected void okButtonActionPerformed(ActionEvent evt) {
} else {
unlinkForce();
}
CConfig.setParam(CConfig.PQ_ADJUSTED_BV, String.valueOf(adjustedBvCheck.isSelected()));

}
CConfig.setParam(CConfig.PQ_SINGLE_PRINT, String.valueOf(oneUnitPerSheetCheck.isSelected()));
CConfig.saveConfig();

if (printToPdf) {
File exportFile;
Expand Down
3 changes: 3 additions & 0 deletions megameklab/src/megameklab/util/CConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public final class CConfig {
public static final String MEK_AUTOSORT = "mekAutosort";
public static final String MEK_AUTOCOMPACT = "mekAutocompact";

public static final String PQ_SINGLE_PRINT = "pqSinglePrint";
public static final String PQ_ADJUSTED_BV = "pqAdjustedBV";

private static final Properties config = getDefaults();

/**
Expand Down