Skip to content
This repository has been archived by the owner on Oct 18, 2019. It is now read-only.

Commit

Permalink
Hotfix 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo40Git committed Apr 30, 2018
1 parent 030dc01 commit c3c9d58
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 36 deletions.
21 changes: 4 additions & 17 deletions .version
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
1.1
1.1.1
Hotfix 1.1.1
- Improve save dialog
Version 1.1
- You can now add/replace/remove ORGs from within OrgAdder!
- New options!
- "REPLACE" - Replace ORG with new file
- "EXTRACT" - Save ORG
- Change guide to match new ability
"Hotfix" 1.0.4
- Add guide
Hotfix 1.0.3
- Disallow empty ORG names
- Fix "Save EXE As..." not working
- Add IDs next to ORG names
Hotfix 1.0.2
- App is no longer confused about what it is
- Fix error when adding/editing ORGs
Hotfix 1.0.1
- This isn't OrgMaker!
- Fix error when cancelling "add/edit ORG" dialogs
- Disallow mutiple ORG names properly
Version 1.0
- Initial release
- Change guide to match new ability
41 changes: 23 additions & 18 deletions src/main/java/com/leo/orgadder/DialogUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,29 @@ public static File openFileDialog(boolean openOrSave, Component parent, String t
dir = new File(System.getProperty("user.dir"));
fc.setCurrentDirectory(dir);
if (openOrSave) {
int ret = fc.showSaveDialog(parent);
if (ret == JFileChooser.APPROVE_OPTION) {
File sel = fc.getSelectedFile();
String selName = sel.getName();
String ext = filter.getExtensions()[0];
if (!selName.contains(".")
|| !selName.substring(selName.lastIndexOf(".") + 1, selName.length()).equalsIgnoreCase(ext)) {
selName += "." + ext;
sel = new File(sel.getParentFile().getPath() + "/" + selName);
}
if (sel.exists()) {
int confirm = JOptionPane.showConfirmDialog(parent,
"File \"" + sel.getAbsolutePath() + "\"\nalready exists! Overwrite it?",
"Overwrite selected file?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
if (confirm != JOptionPane.OK_OPTION)
return null;
}
return sel;
while (true) {
int ret = fc.showSaveDialog(parent);
if (ret == JFileChooser.APPROVE_OPTION) {
File sel = fc.getSelectedFile();
String selName = sel.getName();
String ext = filter.getExtensions()[0];
if (!selName.contains(".") || !selName.substring(selName.lastIndexOf(".") + 1, selName.length())
.equalsIgnoreCase(ext)) {
selName += "." + ext;
sel = new File(sel.getParentFile().getPath() + "/" + selName);
}
if (sel.exists()) {
int confirm = JOptionPane.showConfirmDialog(parent,
"File \"" + sel.getAbsolutePath() + "\"\nalready exists! Overwrite it?",
"Overwrite selected file?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
if (confirm == JOptionPane.OK_OPTION)
return sel;
else
continue;
}
return sel;
} else
break;
}
} else {
int ret = fc.showOpenDialog(parent);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/leo/orgadder/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class Main {

public static final Logger LOGGER = LogManager.getLogger("OrgAdder");

public static final Version VERSION = new Version("1.1");
public static final Version VERSION = new Version("1.1.1");
public static final String UPDATE_CHECK_SITE = "https://raw.githubusercontent.com/Leo40Git/OrgAdder/master/.version";
public static final String DOWNLOAD_SITE = "https://github.com/Leo40Git/OrgAdder/releases/latest/";
public static final String ISSUES_SITE = "https://github.com/Leo40Git/OrgAdder/issues";
Expand Down

0 comments on commit c3c9d58

Please sign in to comment.