21
21
package org.kuehntopf.streamtastic;
24
import javax.swing.JFileChooser;
25
import javax.swing.JOptionPane;
23
26
import javax.swing.SwingUtilities;
24
27
import javax.swing.UIManager;
25
28
import javax.swing.UnsupportedLookAndFeelException;
29
import javax.swing.filechooser.FileFilter;
26
30
import org.jvnet.substance.SubstanceDefaultLookAndFeel;
27
31
import org.jvnet.substance.button.ClassicButtonShaper;
28
32
import org.jvnet.substance.theme.SubstanceOrangeTheme;
73
Utilities.showLocalizedError("STREAMRIPPER_NOT_INSTALLED");
77
// Ask if the User wants to select it manually
78
int ret = JOptionPane.showConfirmDialog(null,
79
Utilities.getString("STREAMRIPPER_NOT_INSTALLED"),
80
Utilities.getString("ERROR"),
81
JOptionPane.ERROR_MESSAGE,
82
JOptionPane.YES_NO_OPTION);
86
case JOptionPane.YES_OPTION:
87
JFileChooser chooser = new JFileChooser();
88
chooser.setFileFilter(new FileFilter() {
91
public boolean accept(File arg0) {
92
if (arg0.isDirectory() || (arg0.getName().contains("streamripper")) && arg0.canExecute())
99
public String getDescription() {
100
return "Streamripper Program";
104
chooser.showOpenDialog(null);
106
// Check if "Cancel" was pressed
107
if (chooser.getSelectedFile() == null)
113
// Save new Streamripper Command
114
Config.getInstance().setProperty("STREAMRIPPER_CMD",
115
chooser.getSelectedFile().getPath());
116
Config.getInstance().saveProperties();
118
// Redo checks (should also check version)
119
checkStreamripperAvailable();
123
case JOptionPane.NO_OPTION:
75
127
case NOTSUPPORTED:
76
128
Utilities.showLocalizedError("STREAMRIPPER_VERSION_UNSUPPORTED");