Skip to content

Commit

Permalink
Stabalized the loading of the open git and the closing og files storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Harrington committed Jan 25, 2025
1 parent 8ee1917 commit 0399e32
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public void run() {
}.start();

String key = t.getScripting().getGitRepo() + ":" + t.getScripting().getGitFile();
if(key.length()==1)
throw new RuntimeException("Failed to create a file key");
ArrayList<String> files = new ArrayList<>();
files.add(t.getScripting().getGitRepo());
files.add(t.getScripting().getGitFile());
Expand All @@ -174,12 +176,15 @@ public void run() {

addTab(fileTab, true);
widgets.put(file.getAbsolutePath(), t);
System.err.println("Open Tab " + file.getAbsolutePath());

fileTab.setOnCloseRequest(event -> {

widgets.remove(file.getAbsolutePath());
openFiles.remove(file.getAbsolutePath());
ConfigurationDatabase.removeObject("studio-open-git", key);
t.getScripting().close();
com.neuronrobotics.sdk.common.Log.error("Closing " + file.getAbsolutePath());
System.err.println("Closing " + file.getAbsolutePath());
});
FileChangeWatcher watcher = FileChangeWatcher.watch(file);
watcher.addIFileChangeListener(new IFileChangeListener() {
Expand Down
Loading

0 comments on commit 0399e32

Please sign in to comment.