Skip to content

Commit

Permalink
enforce element extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jackHay22 committed Mar 25, 2022
1 parent 19500ce commit d699b1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/system_main/ViewBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ public void actionPerformed(ActionEvent e) {

String abs_path = export_dialog.get_path(FileDialog.SAVE);

//enforce the extension
if (!abs_path.endsWith(".HALiteELEMS")) {
abs_path += ".HALiteELEMS";
}

if ((abs_path != null) && !window.get_datastore().export_element_choices(abs_path)) {
new ErrorDialog<DataStore>("Export Error", "Unable to export element choices").show_dialog();
}
Expand Down
1 change: 1 addition & 0 deletions src/system_utils/io_tools/SystemFileDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public boolean export_on_path(Backend databackend, int type) {


public String get_path(int mode) {
system_file_dialog.setFile("Untitled" + this.ext_type);
system_file_dialog.setMode(mode);
system_file_dialog.setVisible(true);

Expand Down

0 comments on commit d699b1c

Please sign in to comment.