Add a New Comment (Rich Markup)
Thank you. So the parent directory of each selected file should be compared before allowing the file selection dialog to return.
comment #2:
> Can someone with Matlab describe what this warning message and interaction look like? Does the warning return to the Matlab prompt? Or is the file dialog still shown until the user changes the selection or hits Cancel? > > The easiest fix would be for Octave to return an error to the prompt, but maybe it would be better to catch it graphically and allow the user to fix their selection before returning.
I just checked it. As soon as pressing the ok button in the file selection dialog, Matlab throws a warningdlg. After pressing ok in the warningdlg, Matlab returns to the file selection dialog letting the user re-select correctly.
Can someone with Matlab describe what this warning message and interaction look like? Does the warning return to the Matlab prompt? Or is the file dialog still shown until the user changes the selection or hits Cancel? The easiest fix would be for Octave to return an error to the prompt, but maybe it would be better to catch it graphically and allow the user to fix their selection before returning.
I just saw this in the Matlab docs for uigetfile
> If a user selects multiple files, then they must be in the same folder; otherwise MATLAB displays a warning dialog box. Microsoft® Windows libraries can span multiple folders.
So maybe we need to change the file selection code to look at the directory for each selected file and make sure they are all the same.
The uigetfile function with the 'MultiSelect' option enabled fundamentally expects that all selected files will be in the same filesystem directory. The return values from uigetfile are a cell array of file names and a single directory containing all of those files. That is the Matlab API that we are attempting to match. However, when a user is running in GNOME, the file selection dialog offers a "Recent" files view, which shows a list of files that span multiple directories. In this case, a user may multi-select files in the "Recent" view, but only a single directory will be returned. I expect that other desktop and windowing environments may offer something similar. This is a relatively minor issue, but it is definitely possible for a user to select multiple files with this interface and receive misleading return values. This seems to me like a shortcoming in the design of this function. Example return values:
>> [fname, fpath, fidx] = uigetfile ("MultiSelect", "on") fname = { [1,1] = hosts [1,2] = octave } fpath = /home/mike/ fidx = 0
The files selected were actually /etc/hosts and /usr/bin/octave.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only project members can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11