From bf99946e1c1e13566ef0a2585f6b076a96b77921 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Fri, 22 Jun 2012 14:11:04 +0200 Subject: [PATCH 1/1] Imported Upstream version 0.0.3 --- debian/changelog | 8 ++++---- debian/control | 2 +- debian/copyright | 2 +- debian/postinst | 1 + debian/postrm | 1 + src/usr/lib/hildon-desktop/CallNotify.py | 18 ++++++++++++++++-- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 071a601..1e77328 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -callnotify (0.0.2-1) stable; urgency=low +callnotify (0.0.3-1) stable; urgency=low - * Fixed - IM messages would trigger the notification as well. - * Notification will stop when screen is off to save battery. + * Sending SMS to yourself will not rise notification + * Better cleanup after update/remove. - -- Omer Agmon Sun, 28 Mar 2010 13:39:41 +0000 + -- Omer Agmon Sun, 28 Mar 2010 20:51:53 +0000 diff --git a/debian/control b/debian/control index 46e098c..04aa18a 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2 Package: callnotify Architecture: all Depends: python2.5, python-osso, python-dbus, python2.5-gtk2, python-hildondesktop -Description: Call and SMS notifier. +Description: Missed calls and SMS notifier. Will display a small status bar icon for missed Calls and SMS. The icon will disappear after closing the yellow notification or viewing the SMS. XSBC-Bugtracker: http://talk.maemo.org/showthread.php?t=48501 diff --git a/debian/copyright b/debian/copyright index 810fef9..d8a123c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,5 @@ This package was py2debianized(0.5.3) by Omer Agmon on -Sun, 28 Mar 2010 13:39:41 +0000. +Sun, 28 Mar 2010 20:51:53 +0000. It was downloaded from diff --git a/debian/postinst b/debian/postinst index 27fa7f2..d313abf 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,2 +1,3 @@ #!/bin/sh + killall -9 hildon-status-menu killall hildon-status-menu \ No newline at end of file diff --git a/debian/postrm b/debian/postrm index 27fa7f2..d313abf 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,2 +1,3 @@ #!/bin/sh + killall -9 hildon-status-menu killall hildon-status-menu \ No newline at end of file diff --git a/src/usr/lib/hildon-desktop/CallNotify.py b/src/usr/lib/hildon-desktop/CallNotify.py index 1722673..d0c9989 100644 --- a/src/usr/lib/hildon-desktop/CallNotify.py +++ b/src/usr/lib/hildon-desktop/CallNotify.py @@ -5,6 +5,7 @@ import sqlite3 import time import dbus import osso +import atexit from dbus.mainloop.glib import DBusGMainLoop @@ -25,7 +26,7 @@ class CallNotify(hildondesktop.StatusMenuItem): self.missedSMS = self.getMissedCallsCount(True) self.missedLastCall = self.missed self.missedLastSMS = self.missedSMS - + self.mainLoop = None # Register to handle screen off/on events osso_c = osso.Context("osso_test_device_on", "0.0.1", False) device = osso.DeviceState(osso_c) @@ -36,6 +37,12 @@ class CallNotify(hildondesktop.StatusMenuItem): # add d-bus listener for removing notification after viewing missed call # Doing timeout_add with return False instead of explicitly raising a thread gobject.timeout_add(500, self.startDbusListeners) + atexit.register(self.cleanup) + + def cleanup(): + gobject.source_remove(self.tmr_main) + gobject.source_remove(self.tmr_ptr) + self.mainLoop.quit() def loadImages(self): # Load phone image @@ -65,6 +72,10 @@ class CallNotify(hildondesktop.StatusMenuItem): return False # Method to define the way to add dbus signal receiver + + def smsrec(self): + self.stop_notification(self) + def startDbusListeners(self): DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() @@ -73,7 +84,10 @@ class CallNotify(hildondesktop.StatusMenuItem): #bus.add_signal_receiver(self.handleMissedCall, "MembersChanged", None, None, None) bus.add_signal_receiver(self.smsReceived, "MessageReceived", None, None, None) bus.add_signal_receiver(self.smsRead, "NotificationClosed", "org.freedesktop.Notifications", None, "/org/freedesktop/Notifications") - gobject.MainLoop().run() + bus.add_signal_receiver(self.smsrec, "Closed", None, None, None) + + self.mainLoop = gobject.MainLoop() + self.mainLoop.run() return False def smsReceived(self, a): -- 1.7.9.5