mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Fixed a problem of defaulting pile setiing in deck editor. Pile setiing is now saved separate for different usages.
This commit is contained in:
parent
d97d697a53
commit
88d8c30b6c
14 changed files with 85 additions and 64 deletions
|
|
@ -91,12 +91,12 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, piles, bigCard, gameId, true);
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, bigCard, gameId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId, boolean merge) {
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId, boolean merge) {
|
||||
boolean drawImage = showCards.size() < MAX_IMAGES;
|
||||
this.bigCard = bigCard;
|
||||
this.gameId = gameId;
|
||||
|
|
@ -119,8 +119,8 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
addCard(card, bigCard, gameId, drawImage);
|
||||
}
|
||||
}
|
||||
System.gc();
|
||||
drawCards(sortSetting, piles);
|
||||
// System.gc();
|
||||
drawCards(sortSetting);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawCards(SortSetting sortSetting, boolean piles) {
|
||||
public void drawCards(SortSetting sortSetting) {
|
||||
int maxWidth = this.getParent().getWidth();
|
||||
int numColumns = maxWidth / Config.dimensions.frameWidth;
|
||||
int curColumn = 0;
|
||||
|
|
@ -164,7 +164,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
}
|
||||
MageCard lastCard = null;
|
||||
for (MageCard cardImg: sortedCards) {
|
||||
if (piles) {
|
||||
if (sortSetting.isPilesToggle()) {
|
||||
if (lastCard == null) {
|
||||
lastCard = cardImg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,21 +199,20 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
this.bigCard = bigCard;
|
||||
this.gameId = gameId;
|
||||
|
||||
boolean piles = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_DRAFT_PILES_TOGGLE, "true").equals("true");
|
||||
cbSortBy.setSelectedItem(sortSetting.getSortBy());
|
||||
chkPiles.setSelected(piles);
|
||||
currentView.loadCards(showCards, sortSetting, piles, bigCard, gameId);
|
||||
chkPiles.setSelected(sortSetting.isPilesToggle());
|
||||
currentView.loadCards(showCards, sortSetting, bigCard, gameId);
|
||||
}
|
||||
|
||||
private void redrawCards() {
|
||||
if (cards == null) {
|
||||
cards = new CardsView();
|
||||
}
|
||||
currentView.loadCards(cards, sortSetting, false, bigCard, gameId);
|
||||
currentView.loadCards(cards, sortSetting, bigCard, gameId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawCards(SortSetting sortSetting, boolean piles) {
|
||||
public void drawCards(SortSetting sortSetting) {
|
||||
int maxWidth = this.getParent().getWidth();
|
||||
int numColumns = maxWidth / Config.dimensions.frameWidth;
|
||||
int curColumn = 0;
|
||||
|
|
@ -245,7 +244,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
}
|
||||
CardView lastCard = null;
|
||||
for (CardView card: sortedCards) {
|
||||
if (chkPiles.isSelected()) {
|
||||
if (sortSetting.isPilesToggle()) {
|
||||
if (lastCard == null) {
|
||||
lastCard = card;
|
||||
}
|
||||
|
|
@ -339,17 +338,13 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
mainModel.addCardEventListener(listener);
|
||||
}
|
||||
|
||||
public void drawCards(SortSetting sortSetting) {
|
||||
drawCards(sortSetting, false);
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, bigCard, gameId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, piles, bigCard, gameId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId, boolean merge) {
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId, boolean merge) {
|
||||
cards = showCards;
|
||||
this.bigCard = bigCard;
|
||||
this.gameId = gameId;
|
||||
|
|
@ -484,12 +479,12 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
|
||||
private void cbSortByActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSortByActionPerformed
|
||||
sortSetting.setSortBy((SortBy) cbSortBy.getSelectedItem());
|
||||
drawCards(sortSetting, chkPiles.isSelected());
|
||||
drawCards(sortSetting);
|
||||
}//GEN-LAST:event_cbSortByActionPerformed
|
||||
|
||||
private void chkPilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkPilesActionPerformed
|
||||
drawCards(sortSetting, chkPiles.isSelected());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_PILES_TOGGLE, (chkPiles.isSelected()?"True":"False"));
|
||||
sortSetting.setPilesToggle(chkPiles.isSelected());
|
||||
drawCards(sortSetting);
|
||||
}//GEN-LAST:event_chkPilesActionPerformed
|
||||
|
||||
private void jToggleListViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleListViewActionPerformed
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ import mage.view.CardsView;
|
|||
public interface ICardGrid {
|
||||
void clearCardEventListeners();
|
||||
void addCardEventListener(Listener<Event> listener);
|
||||
void drawCards(SortSetting sortSetting, boolean piles);
|
||||
void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId);
|
||||
void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId, boolean merge);
|
||||
void drawCards(SortSetting sortSetting);
|
||||
void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId);
|
||||
void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId, boolean merge);
|
||||
void refresh();
|
||||
int cardsSize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
jButtonAddToSideboard.setEnabled(false);
|
||||
filterCards();
|
||||
chkPiles.setSelected(true);
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
|
||||
public void loadSideboard(List<Card> sideboard, BigCard bigCard) {
|
||||
|
|
@ -341,7 +341,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
if (currentView instanceof CardGrid && filteredCards.size() > CardGrid.MAX_IMAGES) {
|
||||
this.toggleViewMode();
|
||||
}
|
||||
this.currentView.loadCards(new CardsView(filteredCards), sortSetting, chkPiles.isSelected(), bigCard, null, false);
|
||||
this.currentView.loadCards(new CardsView(filteredCards), sortSetting, bigCard, null, false);
|
||||
this.cardCount.setText(String.valueOf(filteredCards.size()));
|
||||
}
|
||||
finally {
|
||||
|
|
@ -857,7 +857,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
if (cbSortBy.getSelectedItem() instanceof SortBy) {
|
||||
if (this.currentView != null) {
|
||||
sortSetting.setSortBy((SortBy) cbSortBy.getSelectedItem());
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_cbSortByActionPerformed
|
||||
|
|
@ -865,7 +865,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private void chkPilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkPilesActionPerformed
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy) {
|
||||
if (this.currentView != null) {
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
sortSetting.setPilesToggle(chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_chkPilesActionPerformed
|
||||
|
|
@ -1022,33 +1023,33 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private javax.swing.JToolBar tbTypes;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private mage.client.cards.CardGrid cardGrid;
|
||||
private final mage.client.cards.CardGrid cardGrid;
|
||||
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy) {
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy) {
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy) {
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e) {
|
||||
if (cbSortBy.getSelectedItem() instanceof SortBy) {
|
||||
this.currentView.drawCards(sortSetting, chkPiles.isSelected());
|
||||
this.currentView.drawCards(sortSetting);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,10 +58,12 @@ import mage.client.MageFrame;
|
|||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.ICardGrid;
|
||||
import mage.client.constants.Constants.DeckEditorMode;
|
||||
import static mage.client.constants.Constants.DeckEditorMode.Constructed;
|
||||
import static mage.client.constants.Constants.DeckEditorMode.Limited;
|
||||
import static mage.client.constants.Constants.DeckEditorMode.Sideboard;
|
||||
import mage.client.constants.Constants.SortBy;
|
||||
import mage.client.dialog.AddLandDialog;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.plugins.MagePlugins;
|
||||
import mage.client.plugins.adapters.MageActionCallback;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.Event;
|
||||
|
|
@ -80,8 +82,8 @@ import org.apache.log4j.Logger;
|
|||
public class DeckEditorPanel extends javax.swing.JPanel {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeckEditorPanel.class);
|
||||
private JFileChooser fcSelectDeck;
|
||||
private JFileChooser fcImportDeck;
|
||||
private final JFileChooser fcSelectDeck;
|
||||
private final JFileChooser fcImportDeck;
|
||||
private Deck deck = new Deck();
|
||||
private boolean isShowCardInfo = false;
|
||||
private UUID tableId;
|
||||
|
|
|
|||
|
|
@ -39,18 +39,22 @@ public abstract class SortSetting {
|
|||
SortBy sortBy;
|
||||
int sortIndex;
|
||||
boolean ascending;
|
||||
boolean pilesToggle;
|
||||
|
||||
String prefSortBy;
|
||||
String prefSortIndex;
|
||||
String prefSortAscending;
|
||||
String prefPilesToggle;
|
||||
|
||||
public SortSetting(String prefSortBy, String prefSortIndex, String prefSortAscending) {
|
||||
public SortSetting(String prefSortBy, String prefSortIndex, String prefSortAscending, String prefPilesToggle) {
|
||||
this.prefSortBy = prefSortBy;
|
||||
this.prefSortIndex = prefSortIndex;
|
||||
this.prefSortAscending = prefSortAscending;
|
||||
this.prefPilesToggle = prefPilesToggle;
|
||||
this.sortBy = SortBy.getByString(PreferencesDialog.getCachedValue(this.prefSortBy, "Color"));
|
||||
this.sortIndex = Integer.parseInt(PreferencesDialog.getCachedValue(this.prefSortIndex, "1"));
|
||||
this.ascending = PreferencesDialog.getCachedValue(this.prefSortAscending, "1").equals("1");
|
||||
this.ascending = PreferencesDialog.getCachedValue(this.prefSortAscending, "1").equals("1");
|
||||
this.pilesToggle = PreferencesDialog.getCachedValue(this.prefPilesToggle, "true").equals("true");
|
||||
}
|
||||
|
||||
public void setSortBy(SortBy sortBy) {
|
||||
|
|
@ -68,6 +72,11 @@ public abstract class SortSetting {
|
|||
PreferencesDialog.saveValue(this.prefSortAscending, this.ascending ? "1":"0");
|
||||
}
|
||||
|
||||
public void setPilesToggle(boolean pileToggle) {
|
||||
this.pilesToggle = pileToggle;
|
||||
PreferencesDialog.saveValue(this.prefSortAscending, this.pilesToggle ? "true":"false");
|
||||
}
|
||||
|
||||
public SortBy getSortBy() {
|
||||
return sortBy;
|
||||
}
|
||||
|
|
@ -79,4 +88,8 @@ public abstract class SortSetting {
|
|||
public boolean isAscending() {
|
||||
return ascending;
|
||||
}
|
||||
|
||||
public boolean isPilesToggle() {
|
||||
return pilesToggle;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,6 @@ public class SortSettingBase extends SortSetting {
|
|||
}
|
||||
|
||||
private SortSettingBase() {
|
||||
super(PreferencesDialog.KEY_BASE_SORT_BY, PreferencesDialog.KEY_BASE_SORT_INDEX, PreferencesDialog.KEY_BASE_SORT_ASCENDING);
|
||||
super(PreferencesDialog.KEY_BASE_SORT_BY, PreferencesDialog.KEY_BASE_SORT_INDEX, PreferencesDialog.KEY_BASE_SORT_ASCENDING, PreferencesDialog.KEY_BASE_PILES_TOGGLE);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,6 @@ public class SortSettingDeck extends SortSetting {
|
|||
}
|
||||
|
||||
private SortSettingDeck() {
|
||||
super(PreferencesDialog.KEY_DECK_SORT_BY, PreferencesDialog.KEY_DECK_SORT_INDEX, PreferencesDialog.KEY_DECK_SORT_ASCENDING);
|
||||
super(PreferencesDialog.KEY_DECK_SORT_BY, PreferencesDialog.KEY_DECK_SORT_INDEX, PreferencesDialog.KEY_DECK_SORT_ASCENDING, PreferencesDialog.KEY_DECK_PILES_TOGGLE);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,6 @@ public class SortSettingDraft extends SortSetting {
|
|||
}
|
||||
|
||||
private SortSettingDraft() {
|
||||
super(PreferencesDialog.KEY_DRAFT_SORT_BY, PreferencesDialog.KEY_DRAFT_SORT_INDEX,PreferencesDialog.KEY_DRAFT_SORT_INDEX );
|
||||
super(PreferencesDialog.KEY_DRAFT_SORT_BY, PreferencesDialog.KEY_DRAFT_SORT_INDEX,PreferencesDialog.KEY_DRAFT_SORT_INDEX, PreferencesDialog.KEY_DRAFT_PILES_TOGGLE );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ import mage.client.dialog.PreferencesDialog;
|
|||
|
||||
public class SortSettingSideboard extends SortSetting {
|
||||
|
||||
private static SortSettingSideboard fInstance = new SortSettingSideboard();
|
||||
private static final SortSettingSideboard fInstance = new SortSettingSideboard();
|
||||
|
||||
public static SortSettingSideboard getInstance() {
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
private SortSettingSideboard() {
|
||||
super(PreferencesDialog.KEY_SIDEBOARD_SORT_BY, PreferencesDialog.KEY_SIDEBOARD_SORT_INDEX, PreferencesDialog.KEY_SIDEBOARD_SORT_INDEX);
|
||||
super(PreferencesDialog.KEY_SIDEBOARD_SORT_BY, PreferencesDialog.KEY_SIDEBOARD_SORT_INDEX, PreferencesDialog.KEY_SIDEBOARD_SORT_INDEX, PreferencesDialog.KEY_SIDEBOARD_PILES_TOGGLE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,15 +78,15 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
protected CardEventSource cardEventSource = new CardEventSource();
|
||||
protected BigCard bigCard;
|
||||
protected UUID gameId;
|
||||
private Map<UUID, CardView> cards = new LinkedHashMap<UUID, CardView>();
|
||||
private Map<String, Integer> cardsNoCopies = new LinkedHashMap<String, Integer>();
|
||||
private List<CardView> view = new ArrayList<CardView>();
|
||||
private final Map<UUID, CardView> cards = new LinkedHashMap<UUID, CardView>();
|
||||
private final Map<String, Integer> cardsNoCopies = new LinkedHashMap<String, Integer>();
|
||||
private final List<CardView> view = new ArrayList<CardView>();
|
||||
private Dimension cardDimension;
|
||||
|
||||
private boolean displayNoCopies = false;
|
||||
private UpdateCountsCallback updateCountsCallback;
|
||||
|
||||
private String column[] = { "", "Name", "Cost", "Color", "Type", "Stats", "Rarity", "Set" };
|
||||
private final String column[] = { "", "Name", "Cost", "Color", "Type", "Stats", "Rarity", "Set" };
|
||||
|
||||
private SortSetting sortSetting;
|
||||
private int recentSortedColumn;
|
||||
|
|
@ -100,12 +100,12 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, piles, bigCard, gameId, true);
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, bigCard, gameId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, boolean piles, BigCard bigCard, UUID gameId, boolean merge) {
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId, boolean merge) {
|
||||
if (this.sortSetting == null) {
|
||||
this.sortSetting = sortSetting;
|
||||
}
|
||||
|
|
@ -185,7 +185,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
}
|
||||
|
||||
sort(this.sortSetting.getSortIndex(), this.sortSetting.isAscending());
|
||||
drawCards(sortSetting, piles);
|
||||
drawCards(sortSetting);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -278,7 +278,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawCards(SortSetting sortSetting, boolean piles) {
|
||||
public void drawCards(SortSetting sortSetting) {
|
||||
fireTableDataChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,23 +150,26 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
// used to save and restore the settings for the cardArea (draft, sideboarding, deck builder)
|
||||
public static final String KEY_DRAFT_VIEW = "draftView";
|
||||
public static final String KEY_DRAFT_PILES_TOGGLE = "draftPilesToggle";
|
||||
|
||||
|
||||
public static final String KEY_DRAFT_SORT_BY = "draftSortBy";
|
||||
public static final String KEY_DRAFT_SORT_INDEX = "draftSortIndex";
|
||||
public static final String KEY_DRAFT_SORT_ASCENDING = "draftSortAscending";
|
||||
public static final String KEY_DRAFT_PILES_TOGGLE = "draftPilesToggle";
|
||||
|
||||
public static final String KEY_BASE_SORT_BY = "baseSortBy";
|
||||
public static final String KEY_BASE_SORT_INDEX = "baseSortIndex";
|
||||
public static final String KEY_BASE_SORT_ASCENDING = "baseSortAscending";
|
||||
public static final String KEY_BASE_PILES_TOGGLE = "basePilesToggle";
|
||||
|
||||
public static final String KEY_SIDEBOARD_SORT_BY = "sideboardSortBy";
|
||||
public static final String KEY_SIDEBOARD_SORT_INDEX = "sideboardSortIndex";
|
||||
public static final String KEY_SIDEBOARD_SORT_ASCENDING = "sideboardSortAscending";
|
||||
public static final String KEY_SIDEBOARD_PILES_TOGGLE = "sideboardPilesToggle";
|
||||
|
||||
public static final String KEY_DECK_SORT_BY = "deckSortBy";
|
||||
public static final String KEY_DECK_SORT_INDEX = "deckSortIndex";
|
||||
public static final String KEY_DECK_SORT_ASCENDING = "deckSortAscending";
|
||||
public static final String KEY_DECK_PILES_TOGGLE = "deckPilesToggle";
|
||||
|
||||
public static final String KEY_PROXY_ADDRESS = "proxyAddress";
|
||||
public static final String KEY_PROXY_PORT = "proxyPort";
|
||||
|
|
@ -246,7 +249,12 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
|
||||
|
||||
/** Creates new form PreferencesDialog */
|
||||
/**
|
||||
* Creates new form PreferencesDialog
|
||||
*
|
||||
* @param parent
|
||||
* @param modal
|
||||
*/
|
||||
public PreferencesDialog(java.awt.Frame parent, boolean modal) {
|
||||
super(parent, modal);
|
||||
initComponents();
|
||||
|
|
@ -1854,10 +1862,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, checkBox, propName, PhaseManager.PHASE_ON, PhaseManager.PHASE_OFF, false);
|
||||
}
|
||||
|
||||
private static void save(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String onValue, boolean updateCache) {
|
||||
prefs.put(propName, checkBox.isSelected() ? yesValue : onValue);
|
||||
private static void save(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String noValue, boolean updateCache) {
|
||||
prefs.put(propName, checkBox.isSelected() ? yesValue : noValue);
|
||||
if (updateCache) {
|
||||
updateCache(propName, checkBox.isSelected() ? yesValue : onValue);
|
||||
updateCache(propName, checkBox.isSelected() ? yesValue : noValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue