[pkg-fso-maint] openmoko-panel-plugin and notifications (was Re: openmoko-panel-plugin v0.5)
Christian Adams
morlac at morlac.de
Wed Nov 5 12:51:15 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Luca
you are right - there is a missing
if (notificationAvailable):
but it should be on line 570:
- - if (sendNofication):
- - self.gsmStatusChanged = True
- - self.sendNotification()
+ if (sendNofication):
+ if (notificationAvailable):
+ self.gsmStatusChanged = True
+ self.sendNotification()
in our repo at projects.openmoko.org this error i made is fixed ..
ciao, christian (morlac) adams
> --8<---------------cut here---------------start------------->8---
> diff --git a/openmoko-panel-plugin b/openmoko-panel-plugin
> index 4493e31..c34f427 100755
> --- a/openmoko-panel-plugin
> +++ b/openmoko-panel-plugin
> @@ -378,10 +378,11 @@ class StatusIcon( object ):
> self.icon.set_tooltip(self.getTooltip())
>
> def sendNotification(self):
> - n = pynotify.Notification("Hardware",
> self.getNotificationText(), "file://%s" % self.getIcon())
> - n.set_urgency(pynotify.URGENCY_CRITICAL)
> - n.set_timeout(10000) # 10 seconds timeout
> - n.show()
> + if (notificationAvailable):
> + n = pynotify.Notification("Hardware",
> self.getNotificationText(), "file://%s" % self.getIcon())
> + n.set_urgency(pynotify.URGENCY_CRITICAL)
> + n.set_timeout(10000) # 10 seconds timeout
> + n.show()
>
> def getNotificationText(self):
> return self.getTooltip()
> --8<---------------cut here---------------end--------------->8---
p.s: look at the other places where self.sendNotification() is called ..
i know it would be less code when the if-clause would be within the
function itself,
but i think calling the function is more expensive than avoiding
calling it, deciding not to send the notification and returning)
- --
- -----BEGIN CONTACT BLOCK-----
eMail: morlac at morlac.de
Jabber: morlac at skavaer.homelinux.org
- ------END CONTACT BLOCK------
- -----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS$/IT;d-;s:;a?;C++(+++)>++++;UL++++;P++(+++)>++++;
L++(+++);E---;W++;N(+);o?;K?;!w;!O;!M+>;!V;PS(+);PE;
Y+;PGP++;t+(++);5(+)>++;X(+);R*;tv->+;b++(+++);DI++;
D++(+++)>++++;G(+)>++;e+>+++;h-()>++;r++;y++;
- ------END GEEK CODE BLOCK------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFJEZbEr81gVylJyzERAj/vAKDFLO/r5d7tNY2QSWE72K8ImpmxaQCfQd+L
M1rz9YmEgvpwO9CXGlTXGc8=
=S5Wb
-----END PGP SIGNATURE-----
More information about the pkg-fso-maint
mailing list