Fixing clipboard autorip
This commit is contained in:
parent
72fe3303e3
commit
158616e382
@ -71,8 +71,6 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
|
|
||||||
private boolean isRipping = false; // Flag to indicate if we're ripping something
|
private boolean isRipping = false; // Flag to indicate if we're ripping something
|
||||||
|
|
||||||
private History history = new History();
|
|
||||||
|
|
||||||
private static JFrame mainFrame;
|
private static JFrame mainFrame;
|
||||||
private static JTextField ripTextfield;
|
private static JTextField ripTextfield;
|
||||||
private static JButton ripButton,
|
private static JButton ripButton,
|
||||||
@ -157,7 +155,9 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
upgradeProgram();
|
upgradeProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
ClipboardUtils.setClipboardAutoRip(Utils.getConfigBoolean("clipboard.autorip", false));
|
boolean autoripEnabled = Utils.getConfigBoolean("clipboard.autorip", false);
|
||||||
|
ClipboardUtils.setClipboardAutoRip(autoripEnabled);
|
||||||
|
trayMenuAutorip.setState(autoripEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void upgradeProgram() {
|
public void upgradeProgram() {
|
||||||
@ -709,7 +709,6 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
trayMenuAutorip = new CheckboxMenuItem("Clipboard Autorip");
|
trayMenuAutorip = new CheckboxMenuItem("Clipboard Autorip");
|
||||||
trayMenuAutorip.setState(ClipboardUtils.getClipboardAutoRip());
|
|
||||||
trayMenuAutorip.addItemListener(new ItemListener() {
|
trayMenuAutorip.addItemListener(new ItemListener() {
|
||||||
@Override
|
@Override
|
||||||
public void itemStateChanged(ItemEvent arg0) {
|
public void itemStateChanged(ItemEvent arg0) {
|
||||||
@ -774,7 +773,7 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadHistory() {
|
private void loadHistory() {
|
||||||
history = new History();
|
History history = new History();
|
||||||
File historyFile = new File("history.json");
|
File historyFile = new File("history.json");
|
||||||
if (historyFile.exists()) {
|
if (historyFile.exists()) {
|
||||||
try {
|
try {
|
||||||
@ -794,6 +793,10 @@ public class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveHistory() {
|
private void saveHistory() {
|
||||||
|
History history = new History();
|
||||||
|
for (int i = 0; i < historyListModel.size(); i++) {
|
||||||
|
history.add( (HistoryEntry) historyListModel.get(i) );
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
history.toFile("history.json");
|
history.toFile("history.json");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user