Skip to content

Commit

Permalink
Save print queue setup between runs
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbraginskiy committed Oct 27, 2024
1 parent a3385e7 commit cb0f45e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit cb0f45e

Please sign in to comment.