Update MainWindow.java

This commit is contained in:
Artyom Yurkov 2017-12-07 18:30:52 +03:00 committed by GitHub
parent 6b4b4c0ac4
commit 981898dc2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -661,12 +661,14 @@ public final class MainWindow implements Runnable, RipStatusHandler {
saveHistory();
});
historyButtonClear.addActionListener(event -> {
if (Utils.getConfigBoolean("history.warn_before_delete", true)) {
JPanel checkChoise = new JPanel();
checkChoise.setLayout(new FlowLayout());
JButton yesButton = new JButton("YES");
JButton noButton = new JButton("NO");
yesButton.setPreferredSize(new Dimension(70,30));
noButton.setPreferredSize(new Dimension(70,30));
yesButton.setPreferredSize(new Dimension(70, 30));
noButton.setPreferredSize(new Dimension(70, 30));
checkChoise.add(yesButton);
checkChoise.add(noButton);
JFrame.setDefaultLookAndFeelDecorated(true);
@ -685,9 +687,20 @@ public final class MainWindow implements Runnable, RipStatusHandler {
HISTORY.clear();
try {
historyTableModel.fireTableDataChanged();
} catch (Exception e) { }
} catch (Exception e) {
}
saveHistory();
});
}
else {
Utils.clearURLHistory();
HISTORY.clear();
try {
historyTableModel.fireTableDataChanged();
} catch (Exception e) {
}
saveHistory();
}
});
// Re-rip all history