X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fusr%2Flib%2Fhildon-desktop%2FCallNotify.py;fp=src%2Fusr%2Flib%2Fhildon-desktop%2FCallNotify.py;h=d6c0c71f7b72028e850afad85c5d2f7db4a4096a;hb=617e245cd948f3d3e9f3a73a757d211f6df96e25;hp=2838f51b59043ffbafd7154b8d465a7f7e997159;hpb=8b903176f294a71b00e6ddcf17fe8edfafaf2020;p=callnotify diff --git a/src/usr/lib/hildon-desktop/CallNotify.py b/src/usr/lib/hildon-desktop/CallNotify.py index 2838f51..d6c0c71 100755 --- a/src/usr/lib/hildon-desktop/CallNotify.py +++ b/src/usr/lib/hildon-desktop/CallNotify.py @@ -21,7 +21,7 @@ class CallNotify(hildondesktop.StatusMenuItem): self.msgType = "" self.toShow = True self.stop = False - self.path = "/home/user/.rtcom-eventlogger/el.db" + self.path = "/home/user/.rtcom-eventlogger/el-v1.db" self.missed = self.getMissedCallsCount(False) self.missedSMS = self.getMissedCallsCount(True) self.missedLastCall = self.missed @@ -301,6 +301,8 @@ class CallNotify(hildondesktop.StatusMenuItem): def handleMissedCall(self): self.dbg('handleMissedCall started') + #self.dbg('self.missedLastCall: ' + self.missedLastCall) + #self.dbg('self.getMissedCallsCount(False): ' + self.getMissedCallsCount(False)) if self.missedLastCall != self.getMissedCallsCount(False): if self.msgType == "SMS": self.msgType = "Both" @@ -336,13 +338,15 @@ class CallNotify(hildondesktop.StatusMenuItem): return True def getMissedCallsCount(self, isSms): - self.dbg('getMissedCallsCount started. agrs: ' + str(isSms)) - eType = 3 - if isSms: - eType=7 - conn = sqlite3.connect(self.path) - cur = conn.cursor() - cur.execute("select count(id) from Events where event_type_id = " + str(eType)) + self.dbg('getMissedCallsCount started. agrs: ' + str(isSms)) + conn = sqlite3.connect(self.path) + cur = conn.cursor() + if isSms: + #Nokia changed the event number from 7 to 11 and also combined the incomming and outgoing sms's + cur.execute("select count(id) from Events where event_type_id = 11 and outgoing = 0") + else: + #Nokia changed the event from 3 to 2 + cur.execute("select count(id) from Events where event_type_id = 2") return cur.fetchone()[0] def show(self): @@ -396,9 +400,9 @@ hd_plugin_type = CallNotify # Uncomment from "if __name__..." to "gtk.main()" if running from CLI as: # "run-standalone.sh python CallNotify.py" -#if __name__=="__main__": -# gobject.type_register(hd_plugin_type) -# obj = gobject.new(hd_plugin_type, plugin_id="plugid_id") -# obj.show_all() -# gtk.main() +if __name__=="__main__": + gobject.type_register(hd_plugin_type) + obj = gobject.new(hd_plugin_type, plugin_id="plugid_id") + obj.show_all() + gtk.main()