Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
gui: Allow to restore default preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Oct 11, 2016
1 parent 190230f commit e8ba563
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/ImkerBase.java
Expand Up @@ -45,7 +45,7 @@ interface StatusHandler {
}

public abstract class ImkerBase extends App {
protected static final String VERSION = "v16.09.11";
protected static final String VERSION = "v16.09.12";
protected static final String PROGRAM_NAME = "Imker";
protected static final String RESOURCE_BUNDLE_BASE_NAME = "i18n/Bundle";
protected static final String GITHUB_ISSUE_TRACKER = "https://github.com/MarcoFalke/wiki-java-tools/issues/new?title=%s&body=%s";
Expand Down
13 changes: 13 additions & 0 deletions src/app/ImkerGUI.java
Expand Up @@ -836,11 +836,24 @@ private void popupPreferences() {
wikiDomain.add(wikiDomainText);
wikiDomain.add(wikiDomainField);
}

final JButton resetButton = new JButton(MSGS.getString("Button_Restore_Defaults"));
{
resetButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
prefs.put(KEY_WIKI_DOMAIN, ImkerBase.PREF_WIKI_DOMAIN_DEFAULT);
wikiDomainField.setText(ImkerBase.PREF_WIKI_DOMAIN_DEFAULT);
}
});
}
JPanel prefsPanel = new JPanel();
prefsPanel.setLayout(new BoxLayout(prefsPanel, BoxLayout.Y_AXIS));
prefsPanel.add(Box.createVerticalStrut(GAP));
prefsPanel.add(wikiDomain);
prefsPanel.add(Box.createVerticalStrut(GAP));
prefsPanel.add(resetButton);
prefsPanel.add(Box.createVerticalStrut(GAP));

final JDialog modalDialog = new JDialog(FRAME, MSGS.getString("Text_Preferences") + " - " + PROGRAM_NAME,
ModalityType.APPLICATION_MODAL);
Expand Down
1 change: 1 addition & 0 deletions src/i18n/Bundle.properties
Expand Up @@ -10,6 +10,7 @@ Prompt_Download = Download %d files?
Button_Download = Download %d files
Button_GetList = Get file list
Button_Reset = Reset internal state
Button_Restore_Defaults = Restore defaults
Button_Choose = Choose...
Button_Delete = Yes, DELETE files
Button_Option_No = No
Expand Down

0 comments on commit e8ba563

Please sign in to comment.