From: Pali Rohár Date: Fri, 20 Jul 2012 09:06:36 +0000 (+0200) Subject: By default visual, sound and vibration events are enabled, default timeout interval... X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=58fd40016454e9484af09784cf1db724111c850d;p=callnotify By default visual, sound and vibration events are enabled, default timeout interval is 5 minutes, default sound level is 0.5 and sleep for vibration is 0.5 --- diff --git a/src/usr/lib/hildon-control-panel/libcallnotify.c b/src/usr/lib/hildon-control-panel/libcallnotify.c index 5e60b96..4d5754c 100644 --- a/src/usr/lib/hildon-control-panel/libcallnotify.c +++ b/src/usr/lib/hildon-control-panel/libcallnotify.c @@ -18,7 +18,7 @@ osso_return_t execute(osso_context_t *osso, gpointer data, gboolean user_activat GtkWidget *slider; GtkWidget *lblText; GtkAdjustment * adj; - gdouble sldValue = 0.0; + gdouble sldValue = 5.0; gdouble newValue = 0.0; char fileContent[64]; char *fileDouble; @@ -54,6 +54,9 @@ osso_return_t execute(osso_context_t *osso, gpointer data, gboolean user_activat slider = gtk_hscale_new_with_range(0.0, 60.0, 0.1); adj = gtk_range_get_adjustment(GTK_RANGE(slider)); + hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnVisual), TRUE); + hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnVibrate) , TRUE); + hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnSound), TRUE); inputFilePtr = fopen("/home/user/.config/CallNotify/conf.txt", "r"); @@ -63,12 +66,12 @@ osso_return_t execute(osso_context_t *osso, gpointer data, gboolean user_activat fgets(fileContent, 12,inputFilePtr); - if (fileContent[0]=='y') - hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnVisual), TRUE); - if (fileContent[2]=='y') - hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnVibrate) , TRUE); - if (fileContent[4]=='y') - hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnSound), TRUE); + if (fileContent[0]=='n') + hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnVisual), FALSE); + if (fileContent[2]=='n') + hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnVibrate) , FALSE); + if (fileContent[4]=='n') + hildon_check_button_set_active (HILDON_CHECK_BUTTON(btnSound), FALSE); (char*)strtok(fileContent, ";"); (char*)strtok(NULL, ";"); diff --git a/src/usr/lib/hildon-desktop/CallNotify.py b/src/usr/lib/hildon-desktop/CallNotify.py index e9ae6bf..399b5cd 100644 --- a/src/usr/lib/hildon-desktop/CallNotify.py +++ b/src/usr/lib/hildon-desktop/CallNotify.py @@ -74,7 +74,11 @@ class CallNotify(hildondesktop.StatusMenuItem): self.soundCall = self.soundFile self.soundSMS = self.soundFile self.soundBoth = self.soundFile - self.volume = 1.0 + self.volume = 0.5 + self.visual = True + self.sound = True + self.vibration = True + self.interval = float(5.0) self.readConfigurationFile() self.dbg('constructor') @@ -121,6 +125,7 @@ class CallNotify(hildondesktop.StatusMenuItem): self.sound = raw_set[1] in ('y') self.vibration = raw_set[2] in ('y') self.interval = float(raw_set[3].replace(',','.')) + self.dbg('visual='+str(self.visual)+' sound='+str(self.sound)+' vibration='+str(self.vibration)+' interval='+str(self.interval)) f.close() # read sound config file @@ -169,7 +174,7 @@ class CallNotify(hildondesktop.StatusMenuItem): if self.vibration and profiled.get_value("", "vibrating.alert.enabled") == "On": self.dbg('vibrate:') mce.req_vibrator_pattern_activate("PatternIncomingCall") - time.sleep(1); + time.sleep(0.5); mce.req_vibrator_pattern_deactivate("PatternIncomingCall") return True