Changeset 95
- Timestamp:
- 03/08/08 16:12:32 (9 months ago)
- Files:
-
- trunk/src/main/org/lastpod/ExeFileFilter.java (modified) (3 diffs)
- trunk/src/main/org/lastpod/PreferencesEditor.java (modified) (3 diffs)
- trunk/src/main/org/lastpod/action/ExitApplication.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/org/lastpod/ExeFileFilter.java
r53 r95 29 29 */ 30 30 public class ExeFileFilter extends FileFilter { 31 public final static boolean OS_IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); 32 31 33 /** 32 34 * Filters a given file and returns <code>true</code> if it should be … … 40 42 } 41 43 42 if (f.getName().endsWith(".exe")) { 44 /* Only filter .exe extensions for Windows. */ 45 if (OS_IS_WINDOWS) { 46 if (f.getName().endsWith(".exe")) { 47 return true; 48 } 49 50 return false; 51 } else { 43 52 return true; 44 53 } 45 46 return false;47 54 } 48 55 … … 52 59 */ 53 60 public String getDescription() { 54 return "*.exe";61 return OS_IS_WINDOWS ? "*.exe" : "*"; 55 62 } 56 63 } trunk/src/main/org/lastpod/PreferencesEditor.java
r82 r95 168 168 p.add(new JLabel()); 169 169 170 TitledBorder b4 = BorderFactory.createTitledBorder("i Tunes:");170 TitledBorder b4 = BorderFactory.createTitledBorder("iPod Manager (iTunes, gtkpod, etc):"); 171 171 p4.setBorder(b4); 172 p4.setToolTipText("Enable if you want to use audioPod with iTunes");172 p4.setToolTipText("Enable if you want to use lastpod with an iPod Manager."); 173 173 174 174 JPanel p41 = new JPanel(); … … 222 222 p4.add(new JLabel()); 223 223 224 JLabel exelabel = new JLabel("Location of i Tunes.exe:");224 JLabel exelabel = new JLabel("Location of iPod Manager (such as iTunes.exe):"); 225 225 p4.add(exelabel); 226 226 this.iTunesfield = new JTextField(); … … 545 545 if (returnVal == JFileChooser.APPROVE_OPTION) { 546 546 File f = fc.getSelectedFile(); 547 iTunesfield.setText(f.getPa rent());547 iTunesfield.setText(f.getPath()); 548 548 } 549 549 } trunk/src/main/org/lastpod/action/ExitApplication.java
r66 r95 96 96 97 97 String message = 98 "No tracks have been submitted to Last.fm. \n"99 + " Would you still like to launch iTunes?";100 String title = "Launch i Tunes";98 "No tracks have been submitted to Last.fm. Would you\n" 99 + " still like to launch iPod Manager (such as iTunes)?"; 100 String title = "Launch iPod Manager"; 101 101 int opt = JOptionPane.YES_NO_OPTION; 102 102 choice = JOptionPane.showConfirmDialog(mainAppFrame, message, title, opt); … … 120 120 String iTunesPath = fPrefs.get("iT Path", "default"); 121 121 122 if (!iTunesPath.endsWith("iTunes.exe")) { 123 iTunesPath += "\\iTunes.exe"; 124 } 122 Runtime rt = null; 125 123 126 124 try { 127 Runtimert = Runtime.getRuntime();125 rt = Runtime.getRuntime(); 128 126 rt.exec(iTunesPath); 129 127 } catch (IOException e) { 130 System.out.println(iTunesPath + " not found! Cannot launch iTunes."); 128 if (!iTunesPath.endsWith("iTunes.exe")) { 129 iTunesPath += "\\iTunes.exe"; 130 } 131 132 try { 133 rt.exec(iTunesPath); 134 } catch (IOException e2) { 135 System.out.println(iTunesPath + " not found! Cannot launch iPod manager."); 136 } 131 137 } 132 138 }
