source: josm/trunk/src/org/openstreetmap/josm/gui/preferences/FilePreferences.java@ 2535

Last change on this file since 2535 was 1742, checked in by stoecker, 15 years ago

fixed #2849 - patch by jttt - fix memory leak

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.gui.preferences;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import javax.swing.JCheckBox;
7import javax.swing.JSeparator;
8import javax.swing.SwingConstants;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.tools.GBC;
12
13/**
14 * Out of pure laziness, I add the file stuff to connection tab.
15 * Feel free to fix this.
16 *
17 * @author imi
18 */
19public class FilePreferences implements PreferenceSetting {
20
21 public static class Factory implements PreferenceSettingFactory {
22 public PreferenceSetting createPreferenceSetting() {
23 return new FilePreferences();
24 }
25 }
26
27 private JCheckBox keepBackup = new JCheckBox(tr("Keep backup files"));
28
29 public void addGui(PreferenceDialog gui) {
30 gui.connection.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL));
31 keepBackup.setSelected(Main.pref.getBoolean("save.keepbackup"));
32 keepBackup.setToolTipText(tr("When saving, keep backup files ending with a ~"));
33 gui.connection.add(keepBackup, GBC.eol().insets(20,0,0,0));
34 }
35
36 public boolean ok() {
37 Main.pref.put("save.keepbackup", keepBackup.isSelected());
38 return false;
39 }
40}
Note: See TracBrowser for help on using the repository browser.