Skip to content

Commit

Permalink
fix #24009 - don't call setting storage in settings setup stage or ch…
Browse files Browse the repository at this point in the history
…eckbox state gets lost

git-svn-id: https://josm.openstreetmap.de/svn/trunk@19258 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Nov 15, 2024
1 parent af4fb15 commit 970825b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ public static class OSMDownloadSourcePanel extends AbstractDownloadSourcePanel<L
/** This is used to keep track of the components for download sources, and to dynamically update/remove them */
private final JPanel downloadSourcesPanel;

private boolean inRestore = false;

private final ChangeListener checkboxChangeListener;

/**
Expand Down Expand Up @@ -255,13 +257,16 @@ public List<IDownloadSourceType> getData() {

@Override
public void rememberSettings() {
DOWNLOAD_SOURCES.forEach(type -> type.getBooleanProperty().put(type.getCheckBox().isSelected()));
if (!inRestore)
DOWNLOAD_SOURCES.forEach(type -> type.getBooleanProperty().put(type.getCheckBox().isSelected()));
}

@Override
public void restoreSettings() {
inRestore = true;
updateSources();
DOWNLOAD_SOURCES.forEach(type -> type.getCheckBox().setSelected(type.isEnabled()));
inRestore = false;
}

@Override
Expand Down

0 comments on commit 970825b

Please sign in to comment.