[Tkabber-dev] r307 - trunk/plugins/reminder

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Feb 22 10:38:18 MSK 2010


Author: bigote
Date: 2010-02-22 10:38:18 +0300 (Mon, 22 Feb 2010)
New Revision: 307

Modified:
   trunk/plugins/reminder/reminder.tcl
Log:
An option options(silent_cmd_execution) is added. If set, a message dialog won't pop-up if your reminder is a command. This option is unset by default.


Modified: trunk/plugins/reminder/reminder.tcl
===================================================================
--- trunk/plugins/reminder/reminder.tcl	2010-02-22 06:25:54 UTC (rev 306)
+++ trunk/plugins/reminder/reminder.tcl	2010-02-22 07:38:18 UTC (rev 307)
@@ -1,4 +1,4 @@
-# "Reminder" plugin for Tkabber. 2010-02-22 v. 0.9.2
+# "Reminder" plugin for Tkabber. 2010-02-22 v. 0.9.3
 # Written by Serge Yudin xmpp:bigote at jabber.ru
 # Its purpose is to remind about your contact birthdays automatically
 # and about some tasks that you assign by means of "/remind" command.
@@ -39,6 +39,10 @@
         [::msgcat::mc "Play sound when a remind pops up."] \
         -type boolean -group Reminder
 
+    custom::defvar options(silent_cmd_execution) 0 \
+        [::msgcat::mc "Do not show a message dialog if the message is a command."] \
+        -type boolean -group Reminder
+
     custom::defvar stored_rem_list {} \
         "List of reminders to store" \
         -type string -group Hidden
@@ -183,13 +187,19 @@
     if {[winfo exists $w]} {
         destroy $w
     }
+    if {$options(play_sound)} {
+        ::sound::play $::sound::options(plugin_reminder_sound)
+    }
     if {[string match cmd\ * $msg]} {
         set cmd [string trimleft $msg cmd\ ]
-        eval $cmd
+        if {$options(silent_cmd_execution)} {
+            [namespace current]::clean_rem_list
+            eval $cmd
+            return
+        } else {
+            eval $cmd
+        }
     }
-    if {$options(play_sound)} {
-        ::sound::play $::sound::options(plugin_reminder_sound)
-    }
     set msg "Now is: [clock format [clock seconds]]\n$msg"
     Dialog $w -title [::msgcat::mc "Reminder"] \
         -modal none -separator 1 -anchor e -default 0 -parent .



More information about the Tkabber-dev mailing list