GNOME Bugzilla – Bug 141193
GnomeFileEntry doesn't write the file name in the save mode
Last modified: 2007-01-09 00:28:53 UTC
- Hit (default) prntscrn to take a screenshot. Screenshot filename is given as Screenshot- [application].png selected so the user can change it. - click 'browse' to save the image in a different directory - filename is now gone IMO the filename should stay and be selected ready to be changed by the user if they choose. However, if the user is just wanting to put the screenshot in a different directory other than $HOME they have to retype the filename. This should be a pretty simple fix which I'd provide a patch for if I could...
Hmm, a quick glance at GnomeFileEntry shows that this should work, needs to be debugged. I'd expect this code (in gnome-file-entry.c:browse_clicked()) to make it happen: p = build_filename (fentry); if (p) { gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (fw), p); g_free (p); }
Well I don't really think that this will work.gtk_file_chooser_set_filename will print the filename only if the file exists or nothing will be done except for the directory change. To pre-enter a filename for the user, as in a save-as dialog,we need to use gtk_file_chooser_set_current_name().I'll attach a patch for the same in a day or two
Created attachment 28455 [details] [review] This is one solution for the bug #141193 .There is little problem in this see the next patch. I think the problem is in the glade file, This patch will solve the problem. and you will get a different file selector browser when you click on browse button.
Created attachment 28465 [details] [review] This is one solution for the bug #141193 There is problem in the previous patch. This one will work properly.
Kirti comments are right, but patch is not. Moving to the old fileselection is not a proper solution. Then this is a bug on the libgnomeui GtkFileEntry save mode support, the code should be: p = build_filename (fentry); if (p) { gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (fw), p); if (action == GTK_FILE_CHOOSER_ACTION_SAVE) { char *f = g_path_get_basename (p); gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (fw), f); g_free (f); } g_free (p); } So I'm moving this bug to libgnomeui and poking andersca to apply the fix :)
Anders, is this ok to commit?
Created attachment 46324 [details] [review] patch as described
I don't see the original problem here with current CVS. Do we still need this? Can someone come up with a different way to reproduce it?
Marking as OBSOLETE based on feedback from Fernando.