[Tkabber-dev] r2014 - in trunk/tkabber: . ifacetk plugins/search

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Jul 4 14:34:46 MSK 2013


Author: sergei
Date: 2013-07-04 14:34:46 +0400 (Thu, 04 Jul 2013)
New Revision: 2014

Added:
   trunk/tkabber/plugins/search/muclists.tcl
Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/muc.tcl
   trunk/tkabber/plugins/search/search.tcl
   trunk/tkabber/plugins/search/spanel.tcl
Log:
	* ifacetk/muc.tcl: Added a new hook which is called after a MUC
	  affiliation or role list dialog is constructed.

	* plugins/search/muclists.tcl: Implemented search in MUC affiliation
	  and role lists.

	* plugins/search/search.tcl: Fixed search highlighting in multicolumn
	  listboxes.

	* plugins/search/spanel.tcl: Do not propagate Return and Shift-Return
	  events to make search bindings working in dialogs also.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2013-07-03 13:45:21 UTC (rev 2013)
+++ trunk/tkabber/ChangeLog	2013-07-04 10:34:46 UTC (rev 2014)
@@ -1,3 +1,17 @@
+2013-07-04  Sergei Golovan  <sgolovan at nes.ru>
+
+	* ifacetk/muc.tcl: Added a new hook which is called after a MUC
+	  affiliation or role list dialog is constructed.
+
+	* plugins/search/muclists.tcl: Implemented search in MUC affiliation
+	  and role lists.
+
+	* plugins/search/search.tcl: Fixed search highlighting in multicolumn
+	  listboxes.
+
+	* plugins/search/spanel.tcl: Do not propagate Return and Shift-Return
+	  events to make search bindings working in dialogs also.
+
 2013-07-03  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/search/search.tcl: Added code for searching in multicolumn

Modified: trunk/tkabber/ifacetk/muc.tcl
===================================================================
--- trunk/tkabber/ifacetk/muc.tcl	2013-07-03 13:45:21 UTC (rev 2013)
+++ trunk/tkabber/ifacetk/muc.tcl	2013-07-04 10:34:46 UTC (rev 2014)
@@ -517,6 +517,8 @@
 
     bindscroll $sw $lb
 
+    hook::run open_muc_list_post_hook $w $sw $sw.listbox
+
     $w draw
 }
 

Added: trunk/tkabber/plugins/search/muclists.tcl
===================================================================
--- trunk/tkabber/plugins/search/muclists.tcl	                        (rev 0)
+++ trunk/tkabber/plugins/search/muclists.tcl	2013-07-04 10:34:46 UTC (rev 2014)
@@ -0,0 +1,34 @@
+# $Id$
+#############################################################################
+
+namespace eval search::muclists {}
+
+proc search::muclists::open_panel {w sw swl sf} {
+    pack $sf -side bottom -anchor w -fill x -before $sw
+    update idletasks
+    $swl see end
+}
+
+#############################################################################
+
+proc search::muclists::close_panel {w sw swl sf} {
+    $swl selection clear 0 end
+    pack forget $sf
+    $w setfocus 0
+}
+
+#############################################################################
+
+proc search::muclists::setup_panel {w sw swl} {
+    set sf [plugins::search::spanel $w.search \
+		-searchcommand [list [namespace parent]::mclistbox::do_search $swl] \
+		-closecommand [list [namespace current]::close_panel $w $sw $swl]]
+
+    bind $w <<OpenSearchPanel>> \
+	    [double% [list [namespace current]::open_panel $w $sw $swl $sf]]
+}
+
+hook::add open_muc_list_post_hook \
+	  [namespace current]::search::muclists::setup_panel
+
+##########################################################################

Modified: trunk/tkabber/plugins/search/search.tcl
===================================================================
--- trunk/tkabber/plugins/search/search.tcl	2013-07-03 13:45:21 UTC (rev 2013)
+++ trunk/tkabber/plugins/search/search.tcl	2013-07-04 10:34:46 UTC (rev 2014)
@@ -402,18 +402,18 @@
 	set step   1
 	set start1 [incr selection_last]
 	set end1   [$w index end]
-	set cond1  {!$found && $i <= $end1}
+	set cond1  {$i <= $end1}
 	set start2 0
 	set end2   $selection_last
-	set cond2  {!$found && $i < $end2}
+	set cond2  {$i < $end2}
     } else {
 	set step   -1
 	set start1 [incr selection_first -1]
 	set end1   0
-	set cond1  {!$found && $i >= $end1}
+	set cond1  {$i >= $end1}
 	set start2 [$w index end]
 	set end2   $selection_first
-	set cond2  {!$found && $i > $end2}
+	set cond2  {$i > $end2}
     }
 
     set found 0
@@ -425,6 +425,7 @@
 		break
 	    }
 	}
+	if {$found} break
     }
     if {!$found} {
 	for {set i $start2} $cond2 {incr i $step} {
@@ -434,6 +435,7 @@
 		    break
 		}
 	    }
+	    if {$found} break
 	}
     }
 

Modified: trunk/tkabber/plugins/search/spanel.tcl
===================================================================
--- trunk/tkabber/plugins/search/spanel.tcl	2013-07-03 13:45:21 UTC (rev 2013)
+++ trunk/tkabber/plugins/search/spanel.tcl	2013-07-04 10:34:46 UTC (rev 2014)
@@ -112,7 +112,9 @@
     }
 
     bind $sentry <Key-Return> [double% [list $sbox invoke $defbutton]]
+    bind $sentry <Key-Return> +break ;# prevent forwarding upstream
     bind $sentry <Shift-Key-Return> [double% [list $sbox invoke [expr {!$defbutton}]]]
+    bind $sentry <Shift-Key-Return> +break ;# prevent forwarding upstream
 
     if {$canclose} {
 	bind $sentry <Escape> [double% [list $cbox invoke 0]]



More information about the Tkabber-dev mailing list