/[svn]/jsampler/trunk/src/org/jsampler/view/std/JSAddDbInstrumentsFromDirDlg.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/std/JSAddDbInstrumentsFromDirDlg.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1357 by iliev, Sat Sep 22 17:27:06 2007 UTC revision 1540 by iliev, Mon Dec 3 23:22:02 2007 UTC
# Line 65  import static org.linuxsampler.lscp.Pars Line 65  import static org.linuxsampler.lscp.Pars
65   * @author Grigor Iliev   * @author Grigor Iliev
66   */   */
67  public class JSAddDbInstrumentsFromDirDlg extends OkCancelDialog {  public class JSAddDbInstrumentsFromDirDlg extends OkCancelDialog {
68          private final JComboBox cbSource = new JComboBox();          private final JComboBox cbSource = StdUtils.createPathComboBox();
69          private JButton btnBrowse;          private JButton btnBrowse;
70          private final JCheckBox checkScanSubdirs =          private final JCheckBox checkScanSubdirs =
71                  new JCheckBox(i18n.getLabel("JSAddDbInstrumentsFromDirDlg.checkScanSubdirs"));                  new JCheckBox(i18n.getLabel("JSAddDbInstrumentsFromDirDlg.checkScanSubdirs"));
72          private final JCheckBox checkFlat =          private final JCheckBox checkFlat =
73                  new JCheckBox(i18n.getLabel("JSAddDbInstrumentsFromDirDlg.checkFlat"));                  new JCheckBox(i18n.getLabel("JSAddDbInstrumentsFromDirDlg.checkFlat"));
74                    
75          private final JComboBox cbDest = new JComboBox();          private final JComboBox cbDest = StdUtils.createPathComboBox();
76          private JButton btnBrowseDb;          private JButton btnBrowseDb;
77                    
78          /**          /**
# Line 172  public class JSAddDbInstrumentsFromDirDl Line 172  public class JSAddDbInstrumentsFromDirDl
172                  checkScanSubdirs.doClick(0);                  checkScanSubdirs.doClick(0);
173                  checkFlat.doClick(0);                  checkFlat.doClick(0);
174                                    
                 cbSource.setEditable(true);  
175                  String[] dirs = preferences().getStringListProperty("recentDirectories");                  String[] dirs = preferences().getStringListProperty("recentDirectories");
176                  for(String dir : dirs) cbSource.addItem(dir);                  for(String dir : dirs) cbSource.addItem(dir);
177                  cbSource.setSelectedItem(null);                  cbSource.setSelectedItem(null);
# Line 183  public class JSAddDbInstrumentsFromDirDl Line 182  public class JSAddDbInstrumentsFromDirDl
182                                    
183                  cbSource.addActionListener(getHandler());                  cbSource.addActionListener(getHandler());
184                                    
                 cbDest.setEditable(true);  
185                  dirs = preferences().getStringListProperty("recentDbDirectories");                  dirs = preferences().getStringListProperty("recentDbDirectories");
186                  for(String dir : dirs) cbDest.addItem(dir);                  for(String dir : dirs) cbDest.addItem(dir);
187                  cbDest.setSelectedItem(dbDir);                  cbDest.setSelectedItem(dbDir);
# Line 222  public class JSAddDbInstrumentsFromDirDl Line 220  public class JSAddDbInstrumentsFromDirDl
220                  int result = fc.showOpenDialog(this);                  int result = fc.showOpenDialog(this);
221                  if(result != JFileChooser.APPROVE_OPTION) return;                  if(result != JFileChooser.APPROVE_OPTION) return;
222                                    
223                  String s = toEscapedString(fc.getSelectedFile().getPath());                  path = fc.getSelectedFile().getAbsolutePath();
224                  cbSource.setSelectedItem(s);                  if(java.io.File.separatorChar == '\\') {
225                            path = path.replace('\\', '/');
226                    }
227                    path = toEscapedString(path);
228                    cbSource.setSelectedItem(path);
229                  path = fc.getCurrentDirectory().getAbsolutePath();                  path = fc.getCurrentDirectory().getAbsolutePath();
230                  preferences().setStringProperty("lastInstrumentLocation", path);                  preferences().setStringProperty("lastInstrumentLocation", path);
231          }          }

Legend:
Removed from v.1357  
changed lines
  Added in v.1540

  ViewVC Help
Powered by ViewVC