GNOME Bugzilla – Bug 683312
Use gsignal decorator
Last modified: 2012-11-15 20:39:08 UTC
we already depend on new pygobject, we could use the new nice syntax instead of the old ugly __gsignal__ stuff. See http://www.piware.de/2012/09/pygobject-3-3-91-released/
Created attachment 226812 [details] [review] Replace show-standalone signal with new annotation Here is a patch, but only for the show-standalone signal. I can't do the same with selection-changed signal because it conflict with the selection-changed signal from iconview. By the way why redefine our own custom signal since iconview already has the selection-changed signal (i'm just curious) ? Thanks !
Review of attachment 226812 [details] [review]: What is the problem with the selection-changed? A clock does not inherit from iconview, it just contains one internally... ::: gnomeclocks/alarm.py @@ -333,3 @@ standalone = widget.get_standalone_widget() standalone.set_ringing(True) - self.emit("show-standalone", widget) is this needed? the canonical form for signal names is with "-" and the library should take care of the conversion... if it doesn't it is a bug in the decorator
but since it has the same name it conflict with the iconview one. At least it is the error message i get. If i don't do this change, it doesn't works, plus it is the official example : http://git.gnome.org/browse/pygobject/tree/examples/signal.py
the conflict looks definitely like a bug, I can have the same signal name on different classes. I opened bug #686496
Created attachment 226928 [details] [review] Use new GSignal decorator Here is a complete patch (require last pygobject git) I'm unsure if i replaced all selection-changed signals, because some belong to the iconview and some to our view. Everything seems to work so it seems to be good but a double check would be great ! By the way since the new pygobject git, there seems to be a delay to display time and sunset times when you launch gnome-clocks and click a world clock in standalone view, not sure where it come from.
I now applied the patch, but without the part changing - to _ which is not needed (I tested and it works ok). Thanks!