From: Pali Rohár Date: Fri, 22 Jun 2012 12:11:05 +0000 (+0200) Subject: Imported Upstream version 0.1.1 X-Git-Url: https://vcs.maemo.org/git/?p=callnotify;a=commitdiff_plain;h=617e245cd948f3d3e9f3a73a757d211f6df96e25 Imported Upstream version 0.1.1 --- diff --git a/debian/changelog b/debian/changelog index 272ce6a..ba6aec9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,5 @@ -callnotify (0.1.0-1) stable; urgency=low +callnotify (0.1.1-1) stable; urgency=low - * Added dependency to python-runtime and python-xml - * Fixed bugtracker link - *Added request for restart after installation. + * Should work now with PR1.2 - -- Omer Agmon Sun, 11 Apr 2010 20:43:14 +0000 + -- Omer Agmon Sun, 30 May 2010 22:24:54 +0000 diff --git a/debian/control b/debian/control index db89d81..173bc56 100644 --- a/debian/control +++ b/debian/control @@ -6,12 +6,12 @@ Build-Depends: debhelper (>= 5) Standards-Version: 3.7.2 Package: callnotify -Architecture: armel -Depends: python2.5, python2.5-osso, python-runtime, python2.5-dbus, python2.5-hildon, python2.5-gtk2, python2.5-hildondesktop, python-hildondesktop, hildon-desktop-python-loader, python-xml, python-runtime +Architecture: any +Depends: python2.5, python2.5-osso, python2.5-dbus, python2.5-hildon, python2.5-gtk2, python-hildondesktop 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: XSBC-Bugtracker: http://talk.maemo.org/showthread.php?t=48501 +XSBC-Bugtracker: XSBC-Bugtracker: test XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41 diff --git a/debian/copyright b/debian/copyright index 090df17..0d031ee 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,5 @@ This package was py2debianized(0.5.3) by Omer Agmon on -Sun, 11 Apr 2010 20:43:14 +0000. +Sun, 30 May 2010 22:24:54 +0000. It was downloaded from diff --git a/debian/postinst b/debian/postinst index db668de..c794ff3 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,5 +1,4 @@ #!/bin/sh killall -9 hildon-status-menu sleep 4 - killall hildon-status-menu - echo 'Please restart your device after installation.' \ No newline at end of file + killall hildon-status-menu \ No newline at end of file diff --git a/debian/rules b/debian/rules index 06e3080..d31e215 100755 --- a/debian/rules +++ b/debian/rules @@ -47,7 +47,7 @@ install: build mkdir -p "$(CURDIR)/debian/callnotify" # mkdir -p "$(CURDIR)/debian/callnotify/usr/lib/hildon-control-panel/" - cp -a "src/usr/lib/hildon-control-panel/libcallnotify.so" "$(CURDIR)/debian/callnotify/usr/lib/hildon-control-panel/libcallnotify.so" + cp -a "src/usr/lib/hildon-control-panel/libcallnotify.c" "$(CURDIR)/debian/callnotify/usr/lib/hildon-control-panel/libcallnotify.c" 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/" diff --git a/src/usr/lib/hildon-control-panel/libcallnotify.c b/src/usr/lib/hildon-control-panel/libcallnotify.c new file mode 100755 index 0000000..dc83af4 --- /dev/null +++ b/src/usr/lib/hildon-control-panel/libcallnotify.c @@ -0,0 +1,137 @@ +#include +#include +#include +#include + +osso_return_t execute(osso_context_t *osso, gpointer data, gboolean user_activated) +{ +char a = 'y'; +char b = 'y'; +char c = 'y'; +GtkWidget *dialog; +GtkWidget *btnVisual; +GtkWidget *btnVibrate; +GtkWidget *btnSound; +GtkWidget *slider; +GtkWidget *lblText; +- Show quoted text - +GtkAdjustment * adj; +gdouble sldValue = 0.0; +gdouble newValue = 0.0; +char *fileContent; +char *fileDouble; +int i; +gint response; + +/* Create dialog with OK and Cancel buttons. Leave the separator out, +* as we do not have any content. */ +dialog = gtk_dialog_new_with_buttons( +"Call Notify Settings", +GTK_WINDOW(data), +GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR, +GTK_STOCK_OK, +GTK_RESPONSE_OK, +GTK_STOCK_CANCEL, +GTK_RESPONSE_CANCEL, +NULL); + +/* ... add something to the dialog ... */ +//btnVisual = gtk_check_button_new_with_label(); +btnVisual = (GtkWidget*)hildon_check_button_new(HILDON_SIZE_FULLSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT); +gtk_button_set_label (GTK_BUTTON (btnVisual), "Visual Notification"); + +btnVibrate = (GtkWidget*)hildon_check_button_new(HILDON_SIZE_FULLSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT); +gtk_button_set_label (GTK_BUTTON (btnVibrate), "Vibrate Notification"); + +btnSound = (GtkWidget*)hildon_check_button_new(HILDON_SIZE_FULLSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT); +gtk_button_set_label (GTK_BUTTON (btnSound), "Sound Notification"); + +lblText = (GtkWidget*)gtk_label_new("Please select notification interval:"); + + +slider = gtk_hscale_new_with_range(0.0, 60.0, 0.1); + + +FILE *inputFilePtr = fopen("/home/user/.config/CallNotify/conf.txt", "r"); + +if (inputFilePtr != NULL) +{ + + + fgets(fileContent, 12,inputFilePtr); + + + if (fileContent[0]=='y') + hildon_check_button_set_active (GTK_BUTTON(btnVisual), TRUE); + if (fileContent[2]=='y') + hildon_check_button_set_active (GTK_BUTTON(btnVibrate) , TRUE); + if (fileContent[4]=='y') + hildon_check_button_set_active (GTK_BUTTON(btnSound), TRUE); + +(char*)strtok(fileContent, ";"); +(char*)strtok(NULL, ";"); +(char*)strtok(NULL, ";"); + +fileDouble = strtok(NULL, ";"); + +// replace , with . +for (i=0; ivbox), btnVisual); +gtk_container_add(GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), btnVibrate); +gtk_container_add(GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), btnSound); +gtk_container_add(GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), lblText); +gtk_container_add(GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), slider); + +gtk_widget_show_all(dialog); + +/* Wait until user finishes the dialog. */ +response = gtk_dialog_run(GTK_DIALOG(dialog)); + +if (response == GTK_RESPONSE_OK) +{ +/* ... do something with the dialog stuff ... */ +//FILE *f_write = +inputFilePtr = fopen("/home/user/.config/CallNotify/conf.txt", "w"); + + +a = hildon_check_button_get_active(GTK_BUTTON(btnVisual)) ? 'y' : 'n'; +b = hildon_check_button_get_active(GTK_BUTTON(btnVibrate)) ? 'y' : 'n'; +c = hildon_check_button_get_active(GTK_BUTTON(btnSound)) ? 'y' : 'n'; + +newValue = gtk_adjustment_get_value(adj); + + +fprintf(inputFilePtr, "%c;%c;%c;%.1f\n",a,b,c,newValue); + +fclose(inputFilePtr); + +} + +/* Free the dialog (and it's children) */ + +gtk_widget_destroy(GTK_WIDGET(dialog)); + +return OSSO_OK; +} + +osso_return_t save_state(osso_context_t *osso, gpointer data) +{ +/* ... save state ... */ + +return OSSO_OK; +} + + diff --git a/src/usr/lib/hildon-control-panel/libcallnotify.so b/src/usr/lib/hildon-control-panel/libcallnotify.so deleted file mode 100644 index be2143f..0000000 Binary files a/src/usr/lib/hildon-control-panel/libcallnotify.so and /dev/null differ 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() diff --git a/src/usr/share/applications/hildon-control-panel/callnotify.desktop b/src/usr/share/applications/hildon-control-panel/callnotify.desktop old mode 100644 new mode 100755 index de789ec..b476a5a --- a/src/usr/share/applications/hildon-control-panel/callnotify.desktop +++ b/src/usr/share/applications/hildon-control-panel/callnotify.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Encoding=UTF-8 -Vrsion=1.0 +Version=1.0 Name=Call Notify Comment=Settings for Call Notify application Type=HildonControlPanelPlugin diff --git a/src/usr/share/applications/hildon-status-menu/CallNotify.desktop b/src/usr/share/applications/hildon-status-menu/CallNotify.desktop old mode 100644 new mode 100755