[Tkabber-dev] r128 - trunk/plugins/hidemuctopic

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Aug 28 16:09:01 MSD 2008


Author: kostix
Date: 2008-08-28 16:09:00 +0400 (Thu, 28 Aug 2008)
New Revision: 128

Added:
   trunk/plugins/hidemuctopic/hidemuctopic.tcl
Removed:
   trunk/plugins/hidemuctopic/muchidetopic.tcl
Modified:
   trunk/plugins/hidemuctopic/INSTALL
Log:
hidemuctopic/muchidetopic.tcl: Renamed to hidemuctopic/hidemuctopic.tcl

hidemuctopic/INSTALL: Updated references to plugin's name.


Modified: trunk/plugins/hidemuctopic/INSTALL
===================================================================
--- trunk/plugins/hidemuctopic/INSTALL	2008-08-28 12:04:32 UTC (rev 127)
+++ trunk/plugins/hidemuctopic/INSTALL	2008-08-28 12:09:00 UTC (rev 128)
@@ -1,8 +1,8 @@
 As usually, copy this directory under the ~/.tkabber/plugins directory
 so that you get a hierarchy like this:
   ~/.tkabber/plugins
-  ~/.tkabber/plugins/muchidetopic/
-  ~/.tkabber/plugins/muchidetopic/muchidetopic.tcl
+  ~/.tkabber/plugins/hidemuctopic/
+  ~/.tkabber/plugins/hidemuctopic/hidemuctopic.tcl
 
 Restart Tkabber, to get the plugin loaded.
 

Copied: trunk/plugins/hidemuctopic/hidemuctopic.tcl (from rev 127, trunk/plugins/hidemuctopic/muchidetopic.tcl)
===================================================================
--- trunk/plugins/hidemuctopic/hidemuctopic.tcl	                        (rev 0)
+++ trunk/plugins/hidemuctopic/hidemuctopic.tcl	2008-08-28 12:09:00 UTC (rev 128)
@@ -0,0 +1,76 @@
+# $Id$
+# Provides for hiding of the topic window in MUC rooms
+# to save a bit of screen space.
+# Written by Konstantin Khomoutov <flatworm at users.sourceforge.net>
+# See license.terms for the terms of distribution.
+# See README for the usage details.
+
+event add <<ToggleTopicWindow>> <Control-Key-t>
+
+namespace eval muchidetopic {
+	variable options
+	variable packinfo
+
+	custom::defgroup Plugins [::msgcat::mc "Plugins options."] \
+		-group Tkabber
+	custom::defgroup {MUC Hide Topic} \
+		[::msgcat::mc "Support for toggling visibility of\
+			room topic window in MUC."] \
+		-group Plugins
+	custom::defvar options(hidden_by_default) 1 \
+		[::msgcat::mc "Hide room topic window in newly\
+			opened MUC windows."] \
+		-type boolean -group {MUC Hide Topic}
+
+	hook::add open_chat_post_hook \
+		[namespace current]::setup
+}
+
+proc muchidetopic::topicwin {chatid} {
+	return [chat::winid $chatid].status
+}
+
+proc muchidetopic::setup {chatid type} {
+	if {![string equal $type groupchat]} return
+
+	variable options
+	variable packinfo
+	upvar 0 packinfo($chatid) pinfo
+
+	set mw [chat::winid $chatid]
+	set tw $mw.status
+	set slaves [pack slaves $mw]
+
+	set pinfo [pack info $tw]
+	set ix [lsearch -exact $slaves $tw]
+	lappend pinfo -before [lindex $slaves [expr {$ix + 1}]]
+
+	bind [chat::input_win $chatid] <<ToggleTopicWindow>> \
+		[list [namespace current]::toggle $chatid]
+
+	if {$options(hidden_by_default) && ![winfo ismapped $tw]} {
+		bind $tw <Map> {
+			pack forget %W
+			bind %W <Map> {}
+		}
+	}
+}
+
+proc muchidetopic::hide {chatid} {
+	pack forget [topicwin $chatid]
+}
+
+proc muchidetopic::show {chatid} {
+	variable packinfo
+	eval [list pack [topicwin $chatid]] $packinfo($chatid)
+}
+
+proc muchidetopic::toggle {chatid} {
+	set w [topicwin $chatid]
+	if {[winfo ismapped $w]} {
+		hide $chatid
+	} else {
+		show $chatid
+	}
+}
+

Deleted: trunk/plugins/hidemuctopic/muchidetopic.tcl
===================================================================
--- trunk/plugins/hidemuctopic/muchidetopic.tcl	2008-08-28 12:04:32 UTC (rev 127)
+++ trunk/plugins/hidemuctopic/muchidetopic.tcl	2008-08-28 12:09:00 UTC (rev 128)
@@ -1,76 +0,0 @@
-# $Id$
-# Provides for hiding of the topic window in MUC rooms
-# to save a bit of screen space.
-# Written by Konstantin Khomoutov <flatworm at users.sourceforge.net>
-# See license.terms for the terms of distribution.
-# See README for the usage details.
-
-event add <<ToggleTopicWindow>> <Control-Key-t>
-
-namespace eval muchidetopic {
-	variable options
-	variable packinfo
-
-	custom::defgroup Plugins [::msgcat::mc "Plugins options."] \
-		-group Tkabber
-	custom::defgroup {MUC Hide Topic} \
-		[::msgcat::mc "Support for toggling visibility of\
-			room topic window in MUC."] \
-		-group Plugins
-	custom::defvar options(hidden_by_default) 1 \
-		[::msgcat::mc "Hide room topic window in newly\
-			opened MUC windows."] \
-		-type boolean -group {MUC Hide Topic}
-
-	hook::add open_chat_post_hook \
-		[namespace current]::setup
-}
-
-proc muchidetopic::topicwin {chatid} {
-	return [chat::winid $chatid].status
-}
-
-proc muchidetopic::setup {chatid type} {
-	if {![string equal $type groupchat]} return
-
-	variable options
-	variable packinfo
-	upvar 0 packinfo($chatid) pinfo
-
-	set mw [chat::winid $chatid]
-	set tw $mw.status
-	set slaves [pack slaves $mw]
-
-	set pinfo [pack info $tw]
-	set ix [lsearch -exact $slaves $tw]
-	lappend pinfo -before [lindex $slaves [expr {$ix + 1}]]
-
-	bind [chat::input_win $chatid] <<ToggleTopicWindow>> \
-		[list [namespace current]::toggle $chatid]
-
-	if {$options(hidden_by_default) && ![winfo ismapped $tw]} {
-		bind $tw <Map> {
-			pack forget %W
-			bind %W <Map> {}
-		}
-	}
-}
-
-proc muchidetopic::hide {chatid} {
-	pack forget [topicwin $chatid]
-}
-
-proc muchidetopic::show {chatid} {
-	variable packinfo
-	eval [list pack [topicwin $chatid]] $packinfo($chatid)
-}
-
-proc muchidetopic::toggle {chatid} {
-	set w [topicwin $chatid]
-	if {[winfo ismapped $w]} {
-		hide $chatid
-	} else {
-		show $chatid
-	}
-}
-



More information about the Tkabber-dev mailing list