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 661236 - messageTray: Make Source usable without subclassing
messageTray: Make Source usable without subclassing
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-07 22:36 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-17 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
messageTray: Make Source usable without subclassing (2.33 KB, patch)
2011-10-07 22:36 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Start using MessageTray.Source directly instead of having to subclass it (11.29 KB, patch)
2011-10-07 22:36 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
messageTray: Make Source usable without subclassing (2.81 KB, patch)
2011-10-08 22:01 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Start using MessageTray.Source directly instead of having to subclass it (13.64 KB, patch)
2011-10-08 22:01 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
messageTray: Make Source usable without subclassing (3.02 KB, patch)
2011-10-20 21:43 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
messageTray: Make Source usable without subclassing (2.83 KB, patch)
2012-05-02 20:19 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Start using MessageTray.Source directly instead of having to subclass it (12.46 KB, patch)
2012-05-02 20:19 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
messageTray: Make Source usable without subclassing (2.82 KB, patch)
2012-05-10 01:38 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
Start using MessageTray.Source directly instead of having to subclass it (13.23 KB, patch)
2012-05-10 01:38 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
messageTray: Make Source usable without subclassing (2.58 KB, patch)
2012-05-16 22:42 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Start using MessageTray.Source directly instead of having to subclass it (12.76 KB, patch)
2012-05-16 22:42 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-10-07 22:36:02 UTC
Just another code cleanup
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-10-07 22:36:11 UTC
Created attachment 198574 [details] [review]
messageTray: Make Source usable without subclassing

Rather than ask most users of Source to subclass it to simply set their icon,
just allow them to create a new instance and add it without any complex magic.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-10-07 22:36:21 UTC
Created attachment 198575 [details] [review]
Start using MessageTray.Source directly instead of having to subclass it

For most subclasses, this is a direct swap -- a lot of the time, the
constructor called its superclass's _init and overrided _setSummaryIcon.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-10-08 22:01:10 UTC
Created attachment 198637 [details] [review]
messageTray: Make Source usable without subclassing

Rather than ask most users of Source to subclass it to simply set their icon,
just allow them to create a new instance and add it without any complex magic.



Fixed a few issues -- this is getting a bit dirty.
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-10-08 22:01:17 UTC
Created attachment 198638 [details] [review]
Start using MessageTray.Source directly instead of having to subclass it

For most subclasses, this is a direct swap -- a lot of the time, the
constructor called its superclass's _init and overrided _setSummaryIcon.
Comment 5 Jasper St. Pierre (not reading bugmail) 2011-10-20 21:43:07 UTC
Created attachment 199588 [details] [review]
messageTray: Make Source usable without subclassing

Rather than ask most users of Source to subclass it to simply set their icon,
just allow them to create a new instance and add it without any complex magic.



I forgot the first hunk, which made the patch actually work.

-function Source(title) {
-    this._init(title);
+function Source(title, icon_name, icon_type) {
+    this._init(title, icon_name, icon_type);
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-05-02 20:19:07 UTC
Created attachment 213332 [details] [review]
messageTray: Make Source usable without subclassing

Rather than ask most users of Source to subclass it to simply set their icon,
just allow them to create a new instance and add it without any complex magic.



Rebased onto HEAD.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-05-02 20:19:11 UTC
Created attachment 213333 [details] [review]
Start using MessageTray.Source directly instead of having to subclass it

For most subclasses, this is a direct swap -- a lot of the time, the
constructor called its superclass's _init and overrided _setSummaryIcon.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-05-10 01:38:29 UTC
Created attachment 213777 [details] [review]
messageTray: Make Source usable without subclassing

Rather than ask most users of Source to subclass it to simply set their icon,
just allow them to create a new instance and add it without any complex magic.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-05-10 01:38:33 UTC
Created attachment 213778 [details] [review]
Start using MessageTray.Source directly instead of having to subclass it

For most subclasses, this is a direct swap -- a lot of the time, the
constructor was a blank class that override createNotificationIcon,
and called _setSummaryIcon in _init.
Comment 10 drago01 2012-05-16 22:04:27 UTC
Review of attachment 213777 [details] [review]:

Yeah makes sense.

::: js/ui/messageTray.js
@@ +1000,3 @@
+            // this.createNotificationIcon threw an error.
+            // This could be normal in the case of notificationDaemon, which
+            // calls _setSummaryIcon itself.

That's ugly but at least there is a comment ...
Comment 11 drago01 2012-05-16 22:07:23 UTC
Review of attachment 213778 [details] [review]:

Looks good and is a nice cleanup.
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-05-16 22:42:15 UTC
Created attachment 214216 [details] [review]
messageTray: Make Source usable without subclassing

Rather than ask most users of Source to subclass it to simply set their icon,
just allow them to create a new instance and add it without any complex magic.



Is this alternative better?
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-05-16 22:42:20 UTC
Created attachment 214217 [details] [review]
Start using MessageTray.Source directly instead of having to subclass it

For most subclasses, this is a direct swap -- a lot of the time, the
constructor was a blank class that override createNotificationIcon,
and called _setSummaryIcon in _init.
Comment 14 drago01 2012-05-17 12:15:35 UTC
Review of attachment 214216 [details] [review]:

Yes that's better.
Comment 15 drago01 2012-05-17 12:16:14 UTC
Review of attachment 214217 [details] [review]:

Looks good.
Comment 16 Jasper St. Pierre (not reading bugmail) 2012-05-17 12:33:21 UTC
Attachment 214216 [details] pushed as c6fabe5 - messageTray: Make Source usable without subclassing
Attachment 214217 [details] pushed as 9e1a2cf - Start using MessageTray.Source directly instead of having to subclass it