Skip to content

Commit

Permalink
Change import sort message
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Jan 13, 2023
1 parent aa06ade commit 01ec82b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/io/github/arrayv/main/ArrayVisualizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,15 @@ public synchronized void drop(DropTargetDropEvent e) {
}
ArrayVisualizer.this.sortAnalyzer.sortSorts();
ArrayVisualizer.this.refreshSorts();
String message = "Successfully imported " + success + "/" + droppedFiles.size() + " sorts";
JOptionPane.showMessageDialog(null, message, "Import Sorts", JOptionPane.INFORMATION_MESSAGE);
if (success == 0) {
JErrorPane.invokeCustomErrorMessage("Failed to import all " + droppedFiles.size() + " sorts");
} else {
String message = "Successfully imported " + success + " sorts";
if (success < droppedFiles.size()) {
message += " and failed to import " + (droppedFiles.size() - success);
}
JOptionPane.showMessageDialog(null, message, "Import Sorts", JOptionPane.INFORMATION_MESSAGE);
}
} catch (Exception ex) {
ex.printStackTrace();
}
Expand Down

0 comments on commit 01ec82b

Please sign in to comment.