[Tkabber-dev] r774 - in trunk/tkabber: . examples/configs ifacetk

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Nov 3 21:04:12 MSK 2006


Author: sergei
Date: 2006-11-03 21:04:08 +0300 (Fri, 03 Nov 2006)
New Revision: 774

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/examples/configs/badlop-config-home.tcl
   trunk/tkabber/examples/configs/badlop-config.tcl
   trunk/tkabber/ifacetk/iroster.tcl
Log:
	* examples/configs/badlop-config.tcl,
	  examples/configs/badlop-config-home.tcl: Fixed paths of sourced
	  scripts.

	* ifacetk/iroster.tcl: Added support of checkbuttons in roster
	  popup menu.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-10-27 20:13:03 UTC (rev 773)
+++ trunk/tkabber/ChangeLog	2006-11-03 18:04:08 UTC (rev 774)
@@ -1,3 +1,12 @@
+2006-11-03  Sergei Golovan  <sgolovan at nes.ru>
+
+	* examples/configs/badlop-config.tcl,
+	  examples/configs/badlop-config-home.tcl: Fixed paths of sourced
+	  scripts.
+
+	* ifacetk/iroster.tcl: Added support of checkbuttons in roster
+	  popup menu.
+
 2006-10-27  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/chat/irc_commands.tcl: Fixed bug with joining conference

Modified: trunk/tkabber/examples/configs/badlop-config-home.tcl
===================================================================
--- trunk/tkabber/examples/configs/badlop-config-home.tcl	2006-10-27 20:13:03 UTC (rev 773)
+++ trunk/tkabber/examples/configs/badlop-config-home.tcl	2006-11-03 18:04:08 UTC (rev 774)
@@ -8,8 +8,8 @@
 # If you want to change any of them, copy the corresponding line (or lines) from that file,
 #   insert it on the following section ('finload_hook') so your personal options
 #   will always be securely saved on your own config file.
-if {[file exists $rootdir/examples/badlop-config.tcl]} {
-    source $rootdir/examples/badlop-config.tcl
+if {[file exists $rootdir/examples/configs/badlop-config.tcl]} {
+    source $rootdir/examples/configs/badlop-config.tcl
 }
 
 # Configure here your own options

Modified: trunk/tkabber/examples/configs/badlop-config.tcl
===================================================================
--- trunk/tkabber/examples/configs/badlop-config.tcl	2006-10-27 20:13:03 UTC (rev 773)
+++ trunk/tkabber/examples/configs/badlop-config.tcl	2006-11-03 18:04:08 UTC (rev 774)
@@ -21,7 +21,7 @@
     set pixmaps_theme gush
 
     set load_default_xrdb 0
-    option readfile $rootdir/examples/badlop-dark.xrdb userDefault
+    option readfile $rootdir/examples/xrdb/badlop-dark.xrdb userDefault
 
 #    option add *font fixed userDefault
     switch -- [winfo screenwidth .]x[winfo screenheight .] {

Modified: trunk/tkabber/ifacetk/iroster.tcl
===================================================================
--- trunk/tkabber/ifacetk/iroster.tcl	2006-10-27 20:13:03 UTC (rev 773)
+++ trunk/tkabber/ifacetk/iroster.tcl	2006-11-03 18:04:08 UTC (rev 774)
@@ -1498,6 +1498,10 @@
 	    set m2 [menu $m.$suffix2 -tearoff 0]
 	    $m add cascad -label $label -menu $m2
 	    add_menu_submenu $m2 $prefix .$suffix2 $jids
+	} elseif {![catch { $m1 entrycget $i -variable } var]} {
+	    # Can't distinguish checkbuttons and radiobuttons
+	    # Works only for checkbuttons
+	    add_checkbutton_submenu $m $prefix $suffix $i $label $jids
 	} else {
 	    add_command_submenu $m $prefix $suffix $i $label $jids
 	}
@@ -1534,7 +1538,39 @@
     }
 }
 
+###############################################################################
 
+proc roster::add_checkbutton_submenu {m prefix suffix i label jids} {
+    set command_list {}
+    foreach jid $jids {
+	set m1 $prefix[jid_to_tag $jid]$suffix
+	set idx [$m1 index $label]
+	if {$idx != "none"} {
+	    set var [$m1 entrycget $idx -variable]
+	    set command [$m1 entrycget $idx -command]
+	    if {![lcontain $command_list [list $var $command]]} {
+		lappend command_list [list $var $command]
+	    }
+	}
+    }
+    if {[llength $command_list] > 1} {
+	set m2 [menu $m.$i -tearoff 0]
+	$m add cascad -label $label -menu $m2
+	foreach jid $jids {
+	    set m1 $prefix[jid_to_tag $jid]$suffix
+	    set idx [$m1 index $label]
+	    if {$idx != "none"} {
+		set var [$m1 entrycget $idx -variable]
+		set command [$m1 entrycget $idx -command]
+		$m2 add checkbutton -label $jid variable $var -command $command
+	    }
+	}
+    } else {
+	lassign [lindex $command_list 0] var command
+	$m add checkbutton -label $label -variable $var -command $command
+    }
+}
+
 ###############################################################################
 
 proc roster::add_separator {m connid jid} {



More information about the Tkabber-dev mailing list