Skip to content

Commit 65c1122

Browse files
committed
Fix open button
Duplicate ActionListeners would be added each time a rip completed, causing multiple file manager windows to open, but now only one ActionListener is added.
1 parent 0c96e48 commit 65c1122

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/main/java/com/rarchives/ripme/ui/MainWindow.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,14 @@ private void update() {
932932
}
933933
});
934934

935+
openButton.addActionListener(event -> {
936+
try {
937+
Desktop.getDesktop().open(new File(event.getActionCommand()));
938+
} catch (Exception e) {
939+
LOGGER.error(e);
940+
}
941+
});
942+
935943
ActionListener panelSelectListener = event -> {
936944
JToggleButton source = (JToggleButton) event.getSource();
937945
Enumeration<AbstractButton> buttons = panelButtonGroup.getElements();
@@ -1794,13 +1802,6 @@ private synchronized void handleEvent(StatusEvent evt) {
17941802
appendLog("Rip complete, saved to " + f, Color.GREEN);
17951803
status("");
17961804
openButton.setActionCommand(f.toString());
1797-
openButton.addActionListener(event -> {
1798-
try {
1799-
Desktop.getDesktop().open(new File(event.getActionCommand()));
1800-
} catch (Exception e) {
1801-
LOGGER.error(e);
1802-
}
1803-
});
18041805
pack();
18051806
if (ripper.isStopped()) {
18061807
isRipping = false;

0 commit comments

Comments
 (0)