Depends: python2.5, python-osso, python-dbus, python2.5-gtk2, python-hildondesktop
Description: Call and SMS notifier.
Will display a small status bar icon for missed Calls and SMS.
- The icon will disappear after closwing the yellow notification or viewing the SMS.
-XSBC-Bugtracker: http://bugs.maemo.org
+ The icon will disappear after closing the yellow notification or viewing the SMS.
+XSBC-Bugtracker: http://talk.maemo.org/showthread.php?t=48501
XB-Maemo-Icon-26:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41
# mkdir -p "$(CURDIR)/debian/callnotify/usr/lib/hildon-desktop/"
cp -a "src/usr/lib/hildon-desktop/CallNotify.py" "$(CURDIR)/debian/callnotify/usr/lib/hildon-desktop/CallNotify.py"
+ mkdir -p "$(CURDIR)/debian/callnotify/usr/lib/hildon-desktop/"
+ cp -a "src/usr/lib/hildon-desktop/CallNotify.pyo" "$(CURDIR)/debian/callnotify/usr/lib/hildon-desktop/CallNotify.pyo"
+ mkdir -p "$(CURDIR)/debian/callnotify/usr/share/applications/hildon-status-menu/"
+ cp -a "src/usr/share/applications/hildon-status-menu/CallNotify.desktop" "$(CURDIR)/debian/callnotify/usr/share/applications/hildon-status-menu/CallNotify.desktop"
mkdir -p "$(CURDIR)/debian/callnotify/usr/share/CallNotify/"
cp -a "src/usr/share/CallNotify/1.png" "$(CURDIR)/debian/callnotify/usr/share/CallNotify/1.png"
mkdir -p "$(CURDIR)/debian/callnotify/usr/share/CallNotify/"
import sqlite3
import time
import dbus
+import osso
from dbus.mainloop.glib import DBusGMainLoop
self.missedSMS = self.getMissedCallsCount(True)
self.missedLastCall = self.missed
self.missedLastSMS = self.missedSMS
- gobject.timeout_add(5000, self.handleMissedCall)
+
+ # Register to handle screen off/on events
+ osso_c = osso.Context("osso_test_device_on", "0.0.1", False)
+ device = osso.DeviceState(osso_c)
+ device.set_display_event_cb(self.state_cb)
+
+ self.tmr_main = gobject.timeout_add(5000, self.handleMissedCall)
# add d-bus listener for removing notification after viewing missed call
# Doing timeout_add with return False instead of explicitly raising a thread
self.imgList.append(gtk.gdk.pixbuf_new_from_file_at_size("/usr/share/CallNotify/5.png",18,18))
self.imgList.append(gtk.gdk.pixbuf_new_from_file_at_size("/usr/share/CallNotify/more.png",18,18))
+ # Screen off event-handler
+ def state_cb(self, state):
+ if state == osso.device_state.OSSO_DISPLAY_OFF:
+ gobject.source_remove(self.tmr_main)
+ gobject.source_remove(self.tmr_ptr)
+ elif state == osso.device_state.OSSO_DISPLAY_ON:
+ self.tmr_main = gobject.timeout_add(5000, self.handleMissedCall)
+ self.show()
+ return False
+
# Method to define the way to add dbus signal receiver
def startDbusListeners(self):
DBusGMainLoop(set_as_default=True)
#bus.add_signal_receiver(self.stop_notification, "NotificationClosed", "org.freedesktop.Notifications", "org.freedesktop.Notifications", "/org/freedesktop/Notifications")
#bus.add_signal_receiver(self.handleMissedCall, "Notify", None, None, None)
#bus.add_signal_receiver(self.handleMissedCall, "MembersChanged", None, None, None)
- bus.add_signal_receiver(self.smsReceived, "Received", "org.freedesktop.Telepathy.Channel.Type.Text", 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()
return False
- def smsReceived(self, a, b, c, d, e, f):
- if self.missedLastSMS == self.getMissedCallsCount(True):
- if self.msgType == "Call":
- self.msgType = "Both"
- else:
- self.msgType = "SMS"
- self.show()
- self.missedLastSMS = self.getMissedCallsCount(True)
+ def smsReceived(self, a):
+ if a[0].has_key('message-type'):
+ if self.missedLastSMS == self.getMissedCallsCount(True):
+ if self.msgType == "Call":
+ self.msgType = "Both"
+ else:
+ self.msgType = "SMS"
+ self.show()
+ self.missedLastSMS = self.getMissedCallsCount(True)
def smsRead(self, a):
self.stop_notification(a)
index = self.getMissedCallsCount(isSMS) - counter - 1
if index >= 5:
index = 5
- if index < 0
+ if index < 0:
index = 0
if self.msgType != "Both":
img = self.imgList[index]