[Tkabber-dev] r115 - in trunk/plugins: . snoopstatus

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Aug 13 04:03:08 MSD 2008


Author: kostix
Date: 2008-08-13 04:03:07 +0400 (Wed, 13 Aug 2008)
New Revision: 115

Added:
   trunk/plugins/snoopstatus/
   trunk/plugins/snoopstatus/INSTALL
   trunk/plugins/snoopstatus/license.terms
   trunk/plugins/snoopstatus/snoopstatus.tcl
Log:
Added new plugin "snoopstatus" which collects status messages
reported via [set_status] into a special separate log window.


Added: trunk/plugins/snoopstatus/INSTALL
===================================================================
--- trunk/plugins/snoopstatus/INSTALL	                        (rev 0)
+++ trunk/plugins/snoopstatus/INSTALL	2008-08-13 00:03:07 UTC (rev 115)
@@ -0,0 +1,13 @@
+As usually, copy this directory under the ~/.tkabber/plugins directory
+so that you get a hierarchy like this:
+  ~/.tkabber/plugins
+  ~/.tkabber/plugins/snoopstatus/
+  ~/.tkabber/plugins/snoopstatus/snoopstatus.tcl
+
+Restart Tkabber, to get the plugin loaded.
+
+Activate "Tkabber->Plugins->Snoop status messages" main menu item
+to open the window which will collect the status messages.
+
+Consult the README file for the details about using this plugin.
+


Property changes on: trunk/plugins/snoopstatus/INSTALL
___________________________________________________________________
Added: svn:eol-style
   + native

Added: trunk/plugins/snoopstatus/license.terms
===================================================================
--- trunk/plugins/snoopstatus/license.terms	                        (rev 0)
+++ trunk/plugins/snoopstatus/license.terms	2008-08-13 00:03:07 UTC (rev 115)
@@ -0,0 +1,19 @@
+Copyright (c) 2008 Konstantin Khomoutov <flatworm at users.sourceforge.net>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.


Property changes on: trunk/plugins/snoopstatus/license.terms
___________________________________________________________________
Added: svn:eol-style
   + native

Added: trunk/plugins/snoopstatus/snoopstatus.tcl
===================================================================
--- trunk/plugins/snoopstatus/snoopstatus.tcl	                        (rev 0)
+++ trunk/plugins/snoopstatus/snoopstatus.tcl	2008-08-13 00:03:07 UTC (rev 115)
@@ -0,0 +1,57 @@
+# $Id$
+# "Snoop status messages" -- plugin for Tkabber which collects
+# notification messages reported via [set_status] into a separate
+# window with a text widget and a scrollbar.
+# Written by Konstantin Khomoutov <flatworm at users.sourceforge.net>
+# See README for usage notes.
+# See license.terms for the terms of distribution.
+
+namespace eval snoopstatus {
+    variable win .snoopstatus
+
+    hook::add finload_hook \
+	[namespace current]::install_menu_item
+    hook::add set_status_hook \
+	[namespace current]::process_status
+}
+
+proc snoopstatus::install_menu_item {} {
+    set m  [.mainframe getmenu plugins]
+    $m insert end command \
+	-label [::msgcat::mc "Snoop status messages"] \
+	-command [namespace current]::snoop_status_messages
+}
+
+proc snoopstatus::snoop_status_messages {} {
+    variable win
+    if {[winfo exists $win]} return
+
+    add_win $win -class SnoopStatus \
+	-title [::msgcat::mc "Status messages"] \
+	-tabtitle [::msgcat::mc "Status messages"]
+
+    text $win.text -state disabled -wrap word \
+	-yscrollcommand [list $win.vsb set]
+    scrollbar $win.vsb -command [list $win.text yview]
+
+    grid $win.text $win.vsb -sticky ns
+    grid $win.text -sticky news
+    grid rowconfigure $win 0 -weight 1
+    grid columnconfigure $win 0 -weight 1
+}
+
+proc snoopstatus::process_status text {
+    variable win
+    set t $win.text
+    if {![winfo exists $t]} return
+
+    append msg [clock format [clock seconds] \
+	-format $::plugins::options(timestamp_format)] " " $text \n
+
+    $t configure -state normal
+    $t insert end $msg
+    $t configure -state disabled
+    $t see end
+}
+
+# vim:ts=8:sw=4:sts=4:noet


Property changes on: trunk/plugins/snoopstatus/snoopstatus.tcl
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native



More information about the Tkabber-dev mailing list