Skip to content

Commit

Permalink
added checkbox to disable example loader directly in dialog (KeYProje…
Browse files Browse the repository at this point in the history
  • Loading branch information
wadoon authored Mar 1, 2024
2 parents d637fd4 + b4cb677 commit 573c82c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions key.ui/src/main/java/de/uka/ilkd/key/gui/ExampleChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import javax.swing.tree.TreeSelectionModel;

import de.uka.ilkd.key.gui.utilities.GuiUtilities;
import de.uka.ilkd.key.settings.ProofIndependentSettings;
import de.uka.ilkd.key.settings.ViewSettings;

import org.key_project.util.java.IOUtil;

Expand Down Expand Up @@ -277,6 +279,15 @@ public void mouseClicked(MouseEvent e) {
.setMaximumSize(new Dimension(Integer.MAX_VALUE, (int) buttonDim.getHeight() + 10));
getContentPane().add(buttonPanel);

// create the checkbox to hide example load on next startup
ViewSettings vs = ProofIndependentSettings.DEFAULT_INSTANCE.getViewSettings();
JCheckBox showAgainCheckbox =
new JCheckBox("Show this dialog on startup", vs.getShowLoadExamplesDialog());
buttonPanel.add(showAgainCheckbox);
showAgainCheckbox.addActionListener(e -> {
vs.setShowLoadExamplesDialog(showAgainCheckbox.isSelected());
});

// create "load" button
loadButton = new JButton("Load Example");
loadButton.addActionListener(e -> {
Expand Down Expand Up @@ -312,6 +323,7 @@ public void mouseClicked(MouseEvent e) {
buttonPanel.add(cancelButton);
GuiUtilities.attachClickOnEscListener(cancelButton);


// select first example
DefaultMutableTreeNode firstLeaf =
((DefaultMutableTreeNode) model.getRoot()).getFirstLeaf();
Expand Down

0 comments on commit 573c82c

Please sign in to comment.