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 683312 - Use gsignal decorator
Use gsignal decorator
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on: 686496
Blocks:
 
 
Reported: 2012-09-04 07:56 UTC by Paolo Borelli
Modified: 2012-11-15 20:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Replace show-standalone signal with new annotation (3.42 KB, patch)
2012-10-19 11:41 UTC, Maël Lavault
none Details | Review
Use new GSignal decorator (3.96 KB, patch)
2012-10-21 14:50 UTC, Maël Lavault
none Details | Review

Description Paolo Borelli 2012-09-04 07:56:10 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/
Comment 1 Maël Lavault 2012-10-19 11:41:10 UTC
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 !
Comment 2 Paolo Borelli 2012-10-19 11:49:58 UTC
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
Comment 3 Maël Lavault 2012-10-19 16:42:49 UTC
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
Comment 4 Paolo Borelli 2012-10-19 20:21:37 UTC
the conflict looks definitely like a bug, I can have the same signal name on different classes.

I opened bug #686496
Comment 5 Maël Lavault 2012-10-21 14:50:06 UTC
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.
Comment 6 Paolo Borelli 2012-11-15 20:39:08 UTC
I now applied the patch, but without the part changing - to _ which is not needed (I tested and it works ok).

Thanks!