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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Sep 16 04:23:47 MSD 2010


Author: bigote
Date: 2010-09-16 04:23:47 +0400 (Thu, 16 Sep 2010)
New Revision: 389

Modified:
   trunk/plugins/reminder/reminder.tcl
Log:
Added nice error messages instead of hardcoded help printing that was added in the previous commit.


Modified: trunk/plugins/reminder/reminder.tcl
===================================================================
--- trunk/plugins/reminder/reminder.tcl	2010-09-15 18:44:48 UTC (rev 388)
+++ trunk/plugins/reminder/reminder.tcl	2010-09-16 00:23:47 UTC (rev 389)
@@ -1,4 +1,4 @@
-# "Reminder" plugin for Tkabber. 2010-09-15 v. 0.9.4.1
+# "Reminder" plugin for Tkabber. 2010-09-16 v. 0.9.4.2
 # 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.
@@ -53,7 +53,7 @@
 # Taken from Alarm plugin.
     custom::defvar options(plugin_reminder_sound) \
         [file join [file dirname [info script]] sounds reminder.wav] \
-        [::msgcat::mc "Play this sound file"] \
+        [::msgcat::mc "Play this sound file."] \
         -command [list [namespace current]::load_sound_file plugin_reminder] \
         -type file -group Reminder
 }
@@ -117,7 +117,7 @@
     } elseif {[string equal [string range $body 0 7] "/delrem "]} {
         set num [::plugins::muc::parse_nick $body 8]
     } else {
-        [namespace current]::help $chatid
+        [namespace current]::show_error $chatid
         return stop
     }
     switch -- $cmd {
@@ -167,6 +167,14 @@
     return stop
 }
 
+proc reminder::show_error {chatid} {
+    set group [chat::get_jid $chatid]
+    chat::add_message $chatid $group error "Missing argument(s). Usage:\n\
+    /remind <time>\n\[message\]\n\n\
+    /delrem <selected remind>\n\n\
+    Type \'/remind help\' to see some examples." {}
+}
+
 proc reminder::set_reminder {timeout message} {
     variable rem_list
     variable rem_list2save



More information about the Tkabber-dev mailing list