Skip to content

Commit

Permalink
Close the mod version dialog window after clicking the downloading / …
Browse files Browse the repository at this point in the history
…save as button if the dependency list is empty.
  • Loading branch information
burningtnt committed Oct 4, 2023
1 parent 41e8d75 commit 2a99e1d
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,21 @@ public ModVersion(RemoteMod.Version version, DownloadPage selfPage) {

JFXButton downloadButton = new JFXButton(i18n("download"));
downloadButton.getStyleClass().add("dialog-accept");
downloadButton.setOnAction(e -> selfPage.download(version));
downloadButton.setOnAction(e -> {
if (!spinnerPane.isLoading() && spinnerPane.getFailedReason() == null) {
fireEvent(new DialogCloseEvent());
}
selfPage.download(version);
});

JFXButton saveAsButton = new JFXButton(i18n("button.save_as"));
saveAsButton.getStyleClass().add("dialog-accept");
saveAsButton.setOnAction(e -> selfPage.saveAs(version));
saveAsButton.setOnAction(e -> {
if (!spinnerPane.isLoading() && spinnerPane.getFailedReason() == null) {
fireEvent(new DialogCloseEvent());
}
selfPage.saveAs(version);
});

JFXButton cancelButton = new JFXButton(i18n("button.cancel"));
cancelButton.getStyleClass().add("dialog-cancel");
Expand Down

0 comments on commit 2a99e1d

Please sign in to comment.