After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 353196 - Add a file-set signal to GtkFileChooserButton
Add a file-set signal to GtkFileChooserButton
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 352873
 
 
Reported: 2006-08-28 09:02 UTC by Mariano Suárez-Alvarez
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a file-set signal to GtkFileChooserButton (3.30 KB, patch)
2006-08-28 09:03 UTC, Mariano Suárez-Alvarez
needs-work Details | Review
Essentially the same patch, upto Matthias's comment #2. (4.49 KB, patch)
2006-08-28 21:07 UTC, Mariano Suárez-Alvarez
accepted-commit_now Details | Review
Test case for file-set bug (884 bytes, text/x-csrc)
2008-05-02 03:38 UTC, Steffen Gutmann
  Details

Description Mariano Suárez-Alvarez 2006-08-28 09:02:31 UTC
It would be very nice to have a file-set signal on GtkFileChooserButtons, just as we have color-set on color buttons and so on. Otherwise, it's a bit awkward to code, say, an instant apply preference dialog using a file chooser button.
Comment 1 Mariano Suárez-Alvarez 2006-08-28 09:03:39 UTC
Created attachment 71754 [details] [review]
Add a file-set signal to GtkFileChooserButton
Comment 2 Matthias Clasen 2006-08-28 16:06:04 UTC
Makes sense to me.

class->file_set = NULL;

is not necessary, and the signal needs some actual docs. Other than that,
it looks fine.
Comment 3 Federico Mena Quintero 2006-08-28 21:01:02 UTC
Yes, this would be very useful.  Right now people abuse "selection-changed", which is just not for that.

Alternatively, GtkFileChooserButton could simply *not* proxy that signal unless the dialog has just been closed.
Comment 4 Mariano Suárez-Alvarez 2006-08-28 21:07:27 UTC
Created attachment 71801 [details] [review]
Essentially the same patch, upto Matthias's comment #2.

This new patch does not set G_SIGNAL_ACTION on the signal.

This also corrects a typo in the documentation for GtkFileChooser::update-preview.
Comment 5 Mariano Suárez-Alvarez 2006-12-26 22:21:08 UTC
Fixed on HEAD:


2006-12-26  Mariano Suárez-Alvarez  <mariano@gnome.org>

        * gtk/gtkfilechooserbuuton.[hc]: Add a file-set signal to the
        filechooser button. Bug 353196.

Comment 6 Danielle Madeley 2007-09-25 04:32:42 UTC
Just a follow up to this.

It seems that the documentation for this signal isn't generating properly. Neither library.gnome.org or the packaged GTK+ 2.12 docs (from Debian) pick up the documentation for this signal.
Comment 7 Sven Neumann 2008-03-03 12:37:01 UTC
This should fix the problem with the documentation:

2008-03-03  Sven Neumann  <sven@gimp.org>

	* gtk/gtkfilechooserbutton.c (G_DEFINE_TYPE_WITH_CODE): fixed a
	typo in the documentation of the GtkFileChooserButtons::file-set
	signal (see bug #353196).
Comment 8 Steffen Gutmann 2008-05-02 03:37:43 UTC
Has anyone noticed that 'file-set' is triggered regardless of whether 'Ok' or 'Cancel' has been pressed in the dialog?  Even worse, when pressing 'Cancel' gtk_file_chooser_get_filename also reports the filename last selected.

Here is how to reproduce:

1. Compile and run the attached test case.
2. Press the file chooser button, select a filename and press 'Ok',
3. Press the file chooser button again, select a different filename and press 'Cancel'.

The output received is something like:
Received 'file-set', filename: '/etc/vimrc'
Received 'file-set', filename: '/etc/yp.conf'

While the first output is correct, I would expect no 'file-set' triggered and thus no output for line 3.
Comment 9 Steffen Gutmann 2008-05-02 03:38:27 UTC
Created attachment 110258 [details]
Test case for file-set bug
Comment 10 Steffen Gutmann 2008-05-02 03:39:55 UTC
Forgot to mention that this happens with gtk2-2.12.5-1.fc8
Comment 11 Murray Cumming 2009-02-10 10:31:07 UTC
Why was this new signal marked as G_SIGNAL_ACTION? That's normally for key-binding signals, right?
Comment 12 Matthias Clasen 2009-02-10 17:39:30 UTC
Just an oversight, I guess. In comment 4, Mariano said:

This new patch does not set G_SIGNAL_ACTION on the signal.

But in fact, his patch still did...

So, this should be removed.