GNOME Bugzilla – Bug 593410
There is no warning message when inserting the forbidden symbol "/" in a filename
Last modified: 2015-05-10 04:35:56 UTC
When the user tries to save a file from the "Save" option and Inputs labels containing "/" nothing happens, the "Save" dialog remains opened and he is not warned with an error message. An average user cannot understand this, since the user is not informed of what mistake he has done! In some cases a very technical message is prompted: "Error stating /file/path/xxx/xxxxx : no such file or directory" That's useless because only experienced users are able to understand its meaning, but they don't even need it because they're aware that "/" cannot stand into a filename! Newbies are very puzzled by that message instead, because it doesn't actually say WHAT their mistake was: typing "/" inside the name! I post an alternative message that was proposed on launchpad (<a href="https://bugs.launchpad.net/hundredpapercuts/+bug/393158">Bug #393158</a> ): "File names cannot contain "/" " "If you intend to save the file in a folder "xx", First Create folder "xx" in the location" It is very easy to fix and a small step towards better usability. Thank you!!
Should be fixed together with bug 593372, probably
The suggested error message needs to be handled in gtkfilechooserdefault.c:name_entry_get_parent_info_cb(). This is where we decide what to do when you type "subfolder/blah.txt". I'd like to keep the behavior where you *are* able to save something in "existing_subfolder/newfile.txt".
@ Federico: i think that current behaviour should be modified, though. I mean, I know that "/" refers to a subfolder and you know that... the average user doesn't. And moreover, he doesn't have to know it; he/she only deserve to know that "/" cannot be put into a filename! There is a whole world out there, out of geekistan, which still deserves the best (and plainest) GNU experience ;-)
@Alessandro, who is this average user? Is anyone working on this bug, or should I make an attempt?
Feel free to work on this. You have to see what error code you get in the function I mentioned; if it's something like "folder not found", then you can use Alessandro's proposed error message.
To be more specific, you need to change the very last "else" in name_entry_get_parent_info_cb(). The call to error_changing_folder_dialog() is the error message you see right now. You'll want to make a new function, something like error_with_nonexistent_parent_folder(), and call it from there.
Created attachment 208204 [details] [review] patch
*** Bug 596461 has been marked as a duplicate of this bug. ***
Created attachment 244306 [details] [review] Give-a-better-error-message-when-invalid-path-entered I've attached a patch to provide a more useful error message to the user.
Hmm it could be likely that the old error message is never actually called any-more. That call may be able to be removed completely.
Also Bug 596461 is not a duplicate of this bug, its a separate issue.
> Hmm it could be likely that the old error message is never actually called > any-more. That call may be able to be removed completely. I don't know if you refer to a later version, but it still appears in libgtk 3.4.2, used with gedit 3.4.2.
(In reply to comment #12) > > Hmm it could be likely that the old error message is never actually called > > any-more. That call may be able to be removed completely. > > I don't know if you refer to a later version, but it still appears in libgtk > 3.4.2, used with gedit 3.4.2. I was referring to my patch. I have and if/else that allows the old message to be called if the error code doesnt match, I'm not sure if that will ever happen though.
Please ignore my patch for now I'm working on a new one that also fixes Bug 596461 at the same time.
*** Bug 641094 has been marked as a duplicate of this bug. ***
This was recently addressed