-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenFileDialog at a specific target #2301
Comments
You're right, the current set of phoebus/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/script/FileUtil.java Line 154 in a3f8c5d
FileUtil.openSaveDialog phoebus/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/script/FileUtil.java Line 168 in a3f8c5d
boolean inWorkspace which is there for compatibility with the older Eclipse version that had a 'workspace' and no longer has any meaning.
Feel free to create a pull request which adds for example this:
|
I've solved the issue but i can't push my branch : |
Excellent!
See github intro https://docs.github.com/en/get-started/quickstart/fork-a-repo |
Thank you, the pull request is ready. |
Closed with #2306, thanks! |
The code change for this issue has broken a feature in the FileBrowser: if user right clicks on a directory node to create a new display or data browser plot, the file chooser dialog is not initialized correctly with the directory on which user has clicked. In other words: that target for the dialog is wrong. @JeoffreyGi , can you please take a look? |
I apologies but that is, i don't understand the probleme, and can't see the difference between before and after my commit, or it's not me. Using openSaveFileDialog(String) to replace openFileDialog(Boolean) when you select "new display" I only checked if i were the generator of the issue and didn't check the code directly |
Issue is that the target directory in the file dialog of the new display/plot file is wrong. It should be the same as the directory as where user has right-clicked to launch the context menu. With this change the dialog is not initialized with a directory, so it defaults to something. This default on Mac is the user's Desktop directory, on CentOS Linux it is the user's home directory. |
Yes that issue exist before too. I checked, and that was the case too. Before it wasn't worked either. |
I disagree. This worked fine before: if user right clicks on any directory, the new display/plot file was created in that directory. |
Come on, try this checkout, it's before my changes |
In your commit d892353 the SaveAsDialog.doPropmtForFile() method reads:
When called from the context menu handler in the case I describe, I apologize if this change is not from you, but this is what I conclude from the git commit history. |
First of all, in your case, if the file does not exist, how did you right click on it ? Because I recall, a file in java is just a path and could be whatever. So if the file don't exist the dialog can't open on it. And, one more thing you should know, before, there was no fonction who call promptForFile with File != null. It just doesn't existed before. SO YOU COULDN'T OPEN A DIALOG AT A SPECIFIC PLACE, THAT'S WHY I MADE THIS TICKET. You conclude it's from me without even test the checkout, just checkout, compile and try. If you are a developper, you know how to test no ? |
The right-click in the FileBrowser is invoked on an existing directory. However, the context menu handler constructs a Java So: |
So you return 2 years earlier, to check if i made a mistake there is 2 mounth... |
Looks like it's Friday with everybody ready to start the weekend. |
I compare to a 2 year old commit since that is the version preceding your commit of If I checkout the commit you propose (3567e89) the FileBrowser feature we are discussing works fine, just as expected. |
I added an additional check which should handle the case of new (as yet non existent) file and get the existing parent folder. |
#2301 use parent folder when creating a new (non existent file)
Hello,
Today, you can create an Dialog box to choose a file with the Python script. You can launch it in the FileUtil class :
new OpenFileDialog().promptForFile(window, "Open File", null, null);
But, you can't choose the first location of the OpenFileDialog.
To work, tt seem to be :
new OpenFileDialog().promptForFile(window, "Open File", "My Path", null);
Whereas, this is not implements.
Maybe we could add this figure.
I can make it.
But if we can do it without change the Java code, i would be glad to know how.
I want to launch a script which settle parameters, and one is the file to use.
The text was updated successfully, but these errors were encountered: