[Tkabber-dev] r87 - in trunk/plugins: . recentstatus unixkeys

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Jan 8 05:24:40 MSK 2008


Author: kostix
Date: 2008-01-08 05:24:40 +0300 (Tue, 08 Jan 2008)
New Revision: 87

Added:
   trunk/plugins/recentstatus/
   trunk/plugins/recentstatus/AUTHORS
   trunk/plugins/recentstatus/INSTALL
   trunk/plugins/recentstatus/README
   trunk/plugins/recentstatus/TODO
   trunk/plugins/recentstatus/license.terms
   trunk/plugins/recentstatus/recentstatus.tcl
   trunk/plugins/unixkeys/license.terms
Modified:
   trunk/plugins/unixkeys/unixkeys.tcl
Log:
* Added new Tkabber plugin "recentstatus" -- provides for saving
  the availability status messages the user sets.
* Added "license.terms" file into "unixkeys" plugin;
  Added references to documentation files to the code of this plugin.


Added: trunk/plugins/recentstatus/AUTHORS
===================================================================
--- trunk/plugins/recentstatus/AUTHORS	                        (rev 0)
+++ trunk/plugins/recentstatus/AUTHORS	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1 @@
+Konstantin Khomoutov <flatworm at users.sourceforge.com>


Property changes on: trunk/plugins/recentstatus/AUTHORS
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/plugins/recentstatus/INSTALL
===================================================================
--- trunk/plugins/recentstatus/INSTALL	                        (rev 0)
+++ trunk/plugins/recentstatus/INSTALL	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1,9 @@
+As usually, copy this directory under the ~/.tkabber/plugins directory
+so that you get a hierarchy like this:
+  ~/.tkabber/plugins
+  ~/.tkabber/plugins/recentstatus/
+  ~/.tkabber/plugins/recentstatus/recentstatus.tcl
+
+Restart Tkabber, to get the plugin loaded.
+Consult the README file for the details about using this plugin.
+


Property changes on: trunk/plugins/recentstatus/INSTALL
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/plugins/recentstatus/README
===================================================================
--- trunk/plugins/recentstatus/README	                        (rev 0)
+++ trunk/plugins/recentstatus/README	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1,86 @@
+$Id$
+"Recent Status" -- plugin for Tkabber.
+
+
+I. The idea
+
+This plugin subverts the standard Tkabber's widget for managing
+the user's availability status message (this is an entry box to
+the right of the presence menu button) by a combobox widget that
+keeps track of entered messages.
+
+The history of availability status messages is preserved across
+Tkabber restarts (via the Customize mechanism -- "Technical
+details" below").
+
+
+II. Usage
+
+Usage is not very different from the standard widget: you type
+your new availability message and press the Return (Enter) key
+to "apply" (send) it (or, alternatively, select another
+availability status from the status menu).
+
+When you set the new status message it's saved and made
+available via the drop-down list of this combobox widget.
+
+So instead of manually entering the message you want you can
+just post the drop-down list (using the special button on the
+right-hand side of the combobox widget or pressing the "Cursor
+Down" key) and select one of the saved messages.
+
+NOTE that when you select a message using the drop-down list you
+still need to "apply" it (see above).
+
+You can clear the history of status messages by using the "Clear
+history" command from the context menu of the combobox entry
+(invoked by the right mouse button). This operation is
+irreversible, so think before you do this -- no confirmation
+will be asked.
+
+
+III. Configuration
+
+Currently there's no configuration options available for this
+plugin.
+
+
+IV. Limitations
+
+* The maximum number of messages kept in history cannot be set.
+
+* There's no way to edit the history messages from within
+  Tkabber.
+
+
+V. Technical Details
+
+The history of messages is stored via the Customize mechanism of
+Tkabber, which stores the settings to the file named
+"custom.tcl" located under the Tkabber configuration directory.
+
+So observe some things:
+* If you run several Tkabber processes in parallel and they all
+  share the same configuration directory, the history of
+  availability status messages will be overwritten each time you
+  set it from one copy or another; the history which will be
+  reloaded the next time Tkabber is run will be the history of
+  the last Tkabber process it will be written from.
+* You may edit the history messages by manually editing
+  "custom.tcl" -- look for the variable named
+  "::plugins::recentstatus::history". Note that its value must
+  be a well-formed Tcl list and the file is in UTF-8.
+
+
+VI. See Also
+
+If you find yourself using certain availability status messages
+over and over again, you may consider looking at the
+"customstatus" Tkabber plugin which provides for maintaining
+custom presets of availability status/message pairs.
+
+This plugin is available at:
+http://svn.xmpp.ru/repos/tkabber-3rd-party/trunk/plugins/customstatus/
+
+
+# vim:tw=64:noet


Property changes on: trunk/plugins/recentstatus/README
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/plugins/recentstatus/TODO
===================================================================
--- trunk/plugins/recentstatus/TODO	                        (rev 0)
+++ trunk/plugins/recentstatus/TODO	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1,11 @@
+$Id$
+
+* Implement configuration option for limiting the maximum
+  number of history messages (old messages above the threshold
+  should be removed when the new message is added).
+
+* Implement editing of history messages.
+  Deletion of arbitrary history messages also would be cool.
+
+
+# vim:tw=64:noet


Property changes on: trunk/plugins/recentstatus/TODO
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/plugins/recentstatus/license.terms
===================================================================
--- trunk/plugins/recentstatus/license.terms	                        (rev 0)
+++ trunk/plugins/recentstatus/license.terms	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1,19 @@
+Copyright (c) 2007 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/recentstatus/license.terms
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/plugins/recentstatus/recentstatus.tcl
===================================================================
--- trunk/plugins/recentstatus/recentstatus.tcl	                        (rev 0)
+++ trunk/plugins/recentstatus/recentstatus.tcl	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1,75 @@
+# $Id$
+# "Recent Status" -- plugin for Tkabber.
+# This plugin subverts the standard Tkabber's entry widget for
+# managing user's availability status message by a combobox
+# widget which maintains the history of status messages;
+# this history is preserved across Tkabber restarts.
+# Written by Konstantin Khomoutov <flatworm at users.sourceforge.net>
+# See INSTALL for installation procedure.
+# See README for details on usage.
+# See license.terms for info on terms of usage and distribution.
+
+namespace eval recentstatus {
+	variable history
+
+	custom::defvar history [list] \
+		[::msgcat::mc "History of availability status messages"] \
+		-type list \
+		-group Hidden
+
+	hook::add finload_hook [namespace current]::subvert_presence_widget
+}
+
+proc recentstatus::subvert_presence_widget {} {
+	variable history
+
+	set w .presence.status
+
+	set pinfo [pack info $w]
+	set var [$w cget -textvariable]
+	set cmd [bind $w <Return>]
+
+	destroy $w
+
+	ComboBox $w -textvariable $var -values $history
+	$w bind <Return> $cmd
+	$w bind <Return> +[list [namespace current]::save_availability_status $w]
+	$w bind <Button-3> [list [namespace current]::show_context_menu $w]
+
+	set pack [concat [list pack $w] $pinfo]
+	eval $pack
+
+}
+
+proc recentstatus::save_availability_status {w} {
+	variable history
+
+	set ix [$w getvalue]
+	if {$ix >= 0} return
+
+	set avstatus [$w cget -text]
+
+	lappend history $avstatus
+	$w configure -values $history
+}
+
+proc recentstatus::show_context_menu {w} {
+	set m $w.menu
+
+	if {![winfo exists $m]} {
+		menu $m -title [::msgcat::mc "Availability status history"]
+		$m add command \
+			-label [::msgcat::mc "Clear history"] \
+			-command [list [namespace current]::clear_history $w]
+	}
+
+	tk_popup $m [winfo pointerx $w] [winfo pointery $w]
+}
+
+proc recentstatus::clear_history {w} {
+	variable history
+
+	set history [list]
+	$w configure -values $history
+}
+


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

Added: trunk/plugins/unixkeys/license.terms
===================================================================
--- trunk/plugins/unixkeys/license.terms	                        (rev 0)
+++ trunk/plugins/unixkeys/license.terms	2008-01-08 02:24:40 UTC (rev 87)
@@ -0,0 +1,19 @@
+Copyright (c) 2007 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/unixkeys/license.terms
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/plugins/unixkeys/unixkeys.tcl
===================================================================
--- trunk/plugins/unixkeys/unixkeys.tcl	2008-01-07 23:28:24 UTC (rev 86)
+++ trunk/plugins/unixkeys/unixkeys.tcl	2008-01-08 02:24:40 UTC (rev 87)
@@ -4,7 +4,11 @@
 # to Unix users: they resemble "canonical" bindings found in
 # readline and Emacs.
 # Written by Konstantin Khomoutov <flatworm at users.sourceforge.net>
+# See INSTALL for installation procedure.
+# See README for usage guidelines.
+# See license.terms for details on usage and distribution.
 
+
 namespace eval unixkeys {
 	foreach mod {Alt Meta} {
 		bind Text <$mod-a> [bind Text <Control-Key-Home>]



More information about the Tkabber-dev mailing list