GNOME Bugzilla – Bug 702497
Add gtk_file_chooser_get_current_name()
Last modified: 2013-06-19 18:56:24 UTC
Similar to gtk_file_chooser_set_current_name(), it would be nice to have gtk_file_chooser_get_current_name() to get the currently typed filename in Save dialogs.
Created attachment 247060 [details] [review] proposed patch
Thanks! I like the symmetry that this gives to the API. One quick question: How do you envision using the text from the filename entry as entered by the user? It could contain things like "~/Something/blah.txt" that you need to parse yourself.
indeed, I'd need to parse that myself. one use case is: the dialog is opened in 'recent used' mode, so, there's no physical directory (get_filename() would return null). then the user would save an image, he set the name 'image.png' and the realizes it can change the format to jpg, by clicking in a combobox custom widget. the callback function would get the filename and change only the extension part.
Nice use case. I've pushed your patch with two changes: - Make get_current_name() return a non-const gchar *, to be consistent with the rest of the file chooser. - Minor tweaks to the docstring. This is in master in commit 84b4910b39bdd.