diff --git a/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java b/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java index 9cd1151efffac74bc565511e8f61a2ad6a2c2f65..6820f27f1842d5b4b942273c54880b5b445327d8 100644 --- a/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java +++ b/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java @@ -97,6 +97,7 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac private String url; private NetworkModelPanel panel; private String filePath; + private JFileChooser jfc; /** Creates new form */ @@ -124,6 +125,13 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac protected void myInitComponents() { + + if (ConfigurationTTool.DownloadedFILEPath.length() > 0) { + jfc = new JFileChooser(ConfigurationTTool.DownloadedFILEPath); + } else { + jfc = new JFileChooser(); + } + mode = NOT_LISTED; setButtons(); } @@ -356,14 +364,18 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac jta.append("Loading model: " + fileName); String urlToLoad = URLManager.getBaseURL(url) + fileName; URLManager urlm = new URLManager(); - if ((ConfigurationTTool.DownloadedFILEPath == null) || (ConfigurationTTool.DownloadedFILEPath.length() == 0)) { - filePath = fileName; - } else { - filePath = ConfigurationTTool.DownloadedFILEPath + "/" + fileName; - } - boolean ok = urlm.downloadFile(filePath, urlToLoad,this); - if (!ok) { - loadFailed(); + jfc.setSelectedFile(new File(FileUtils.removeFileExtension(fileName))); + int returnVal = jfc.showSaveDialog(f); + if(returnVal == JFileChooser.APPROVE_OPTION) { + filePath = jfc.getSelectedFile().getAbsolutePath(); + filePath = FileUtils.addFileExtensionIfMissing(filePath, "xml"); + boolean ok = urlm.downloadFile(filePath, urlToLoad,this); + if (!ok) { + loadFailed(); + } + } + else { + panel.reactivateSelection(); } } diff --git a/ttool/launch_configurations/config.xml b/ttool/launch_configurations/config.xml index 7e3a956c05fa4482a1a7e08e8ebc4b506f0eb8e6..136c01167ff8e9f377ddd9ba20264862882a46c6 100755 --- a/ttool/launch_configurations/config.xml +++ b/ttool/launch_configurations/config.xml @@ -68,20 +68,10 @@ <PLUGIN_JAVA_CODE_GENERATOR data="../plugins/CustomizerAvatarCodeGeneration.jar" /> -<<<<<<< HEAD -<<<<<<< Upstream, based on origin/project_manager -<LastOpenFile data="/home/satan/ZigBeeTutorial.ttool/ZigBeeTutorial.xml"/> -======= -<LastOpenFile data="/home/dblouin/Projets/TTool/git/TTool/modeling/DIPLODOCUS/ZigBeeTutorial.xml"/> ->>>>>>> 4749348 Issue #98: Fixed default C Code generation directory -======= -<LastOpenFile data="/home/dblouin/Projets/TTool/git/TTool/modeling/DIPLODOCUS/ZigBeeTutorial.xml"/> ->>>>>>> ac0a9cec52efa7fb18b9e7e8f72519b069f3c727 - - +<LastOpenFile data="/home/satan/TTool/modeling/DIPLODOCUS/ZigBeeTutorial.ttool"/> <LastWindowAttributes x="65" y="24" width="1301" height="744" max="true" /> -<ProVerifHash data="-695076237"/> +<ProVerifHash data="1427594573"/> </TURTLECONFIGURATION>