Skip to content

Commit

Permalink
improv(GUI Ready status): Enable generation button and turn of status…
Browse files Browse the repository at this point in the history
… bar after generation has completed, but before dialogs are shown. Looks better and makes more sense.
  • Loading branch information
Griefed committed Jun 6, 2022
1 parent 68f8253 commit d3ab985
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2069,8 +2069,7 @@ private void generateServerpack(ActionEvent event) {
break;

default:
BUTTON_GENERATESERVERPACK.setEnabled(true);
STATUS_BAR.setIndeterminate(false);
ready();
break;
}
}
Expand Down Expand Up @@ -2163,6 +2162,8 @@ public void handle(String line) {
false);
MATERIALTEXTPANEUI.installUI(SERVERPACKGENERATEDTEXTPANE);

ready();

if (JOptionPane.showConfirmDialog(
FRAME_SERVERPACKCREATOR,
SERVERPACKGENERATEDTEXTPANE,
Expand Down Expand Up @@ -2210,6 +2211,8 @@ public void handle(String line) {
errors.append(i + 1).append(": ").append(encounteredErrors.get(i)).append("\n");
}

ready();

JOptionPane.showMessageDialog(
FRAME_SERVERPACKCREATOR,
errors,
Expand All @@ -2224,9 +2227,7 @@ public void handle(String line) {

tailer.stop();

BUTTON_GENERATESERVERPACK.setEnabled(true);
STATUS_BAR.setIndeterminate(false);
FRAME_SERVERPACKCREATOR.setResizable(true);
ready();

System.gc();
System.runFinalization();
Expand All @@ -2235,6 +2236,11 @@ public void handle(String line) {
});
}

private void ready() {
BUTTON_GENERATESERVERPACK.setEnabled(true);
STATUS_BAR.setIndeterminate(false);
}

/**
* Save the current configuration to a specified file.
*
Expand Down

0 comments on commit d3ab985

Please sign in to comment.