Skip to content

Commit

Permalink
correct small UX errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 4, 2024
1 parent cba7bef commit 4c344f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/ai/nets/samj/communication/model/SAMModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ public void closeProcess() {
samj.close();
samj = null;
}

/**
* Check whether the model is loaded or not
* @return whether the model is loaded or not
*/
public boolean isLoaded() {
return samj != null;
}

public String persistEncoding() throws IOException, InterruptedException {
try {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ai/nets/samj/gui/MainGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,8 @@ public void validPromptChosen(boolean isValid) {
CardLayout lyt = (CardLayout) cardPanel1_2.getLayout();
lyt.show(cardPanel1_2, INVISIBLE_STR);
isValidPrompt = true;
MainGUI.this.chkInstant.setEnabled(true);
if (cmbModels.getSelectedModel().isLoaded())
MainGUI.this.chkInstant.setEnabled(true);
} else if (!isValid && isValidPrompt) {
CardLayout lyt = (CardLayout) cardPanel1_2.getLayout();
lyt.show(cardPanel1_2, VISIBLE_STR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ private void stopLoadingAnimation() {
isLoading = false;
if (loadingAnimationThread != null && loadingAnimationThread.isAlive()) {
loadingAnimationThread.interrupt();
try {
loadingAnimationThread.join();
} catch (InterruptedException e) {}
}
}

Expand Down

0 comments on commit 4c344f5

Please sign in to comment.