[Tkabber-dev] r704 - in trunk/tkabber/plugins: general search

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Aug 18 16:33:44 MSD 2006


Author: sergei
Date: 2006-08-18 16:33:40 +0400 (Fri, 18 Aug 2006)
New Revision: 704

Added:
   trunk/tkabber/plugins/search/rawxml.tcl
Modified:
   trunk/tkabber/plugins/general/rawxml.tcl
Log:
	* pixmaps/*/*.gif: svn:mime-type property is set to
	  application/octet-stream to avoid corruption when downloading
	  on nonunix systems
	  (Closes: http://www.jabber.ru/bugzilla/show_bug.cgi?id=256)

	* plugins/general/rawxml.tcl, plugins/search/rawxml.tcl:
	  Search in Raw XML window is added


Modified: trunk/tkabber/plugins/general/rawxml.tcl
===================================================================
--- trunk/tkabber/plugins/general/rawxml.tcl	2006-08-18 12:12:38 UTC (rev 703)
+++ trunk/tkabber/plugins/general/rawxml.tcl	2006-08-18 12:33:40 UTC (rev 704)
@@ -257,6 +257,8 @@
     bind $input <Meta-Next> $next_binding
     bind $input <Alt-Prior> $prior_binding
     bind $input <Alt-Next> $next_binding
+
+    hook::run open_rawxml_post_hook $w
 }
 
 proc rawxml::history_move {shift} {

Copied: trunk/tkabber/plugins/search/rawxml.tcl (from rev 703, trunk/tkabber/plugins/search/chat.tcl)
===================================================================
--- trunk/tkabber/plugins/search/rawxml.tcl	                        (rev 0)
+++ trunk/tkabber/plugins/search/rawxml.tcl	2006-08-18 12:33:40 UTC (rev 704)
@@ -0,0 +1,59 @@
+# $Id$
+
+namespace eval search {}
+
+namespace eval search::rawxml {
+    hook::add open_rawxml_post_hook [namespace current]::setup_panel
+}
+
+proc search::rawxml::open_panel {sf w} {
+    set sentry $sf.search
+
+    pack $sf -side bottom -anchor w -fill x -before $w.sw
+    focus $sentry
+
+    update idletasks
+    $w.dump see end
+}
+
+proc search::rawxml::close_panel {sf w} {
+    $w.dump tag remove search_highlight 0.0 end
+    pack forget $sf
+    focus $w.input
+}
+
+proc search::rawxml::setup_panel {w} {
+    set dump $w.dump
+
+    $dump mark set sel_start end
+    $dump mark set sel_end 0.0
+
+    set sf [frame [winfo parent $dump].search]
+
+    set sentry \
+	[entry $sf.search \
+	       -validate all \
+	       -validatecommand [list [namespace parent]::validate_entry %W %P]]
+    pack $sentry -padx 1m -side left
+
+    set sbox [ButtonBox $sf.sbox -spacing 0]
+    $sbox add -text [::msgcat::mc "Search up"] \
+         -command [list [namespace parent]::do_text_search $dump $sentry 1]
+    $sbox add -text [::msgcat::mc "Search down"] \
+         -command [list [namespace parent]::do_text_search $dump $sentry 0]
+    pack $sbox -side left -padx 1m
+    
+    set cbox [ButtonBox $sf.cbox -spacing 0]
+    $cbox add -text [::msgcat::mc "Close"] \
+         -command [list [namespace current]::close_panel $sf $w]
+    pack $cbox -side right -padx 1m
+
+    bind $sentry <Key-Return> [double% [list $sbox invoke 0]]
+    bind $sentry <Shift-Key-Return> [double% [list $sbox invoke 1]]
+    bind $sentry <Escape> \
+	[double% [list [namespace current]::close_panel $sf $w]]
+
+    bind $w.input <<OpenSearchPanel>> \
+	[double% [list [namespace current]::open_panel $sf $w]]
+}
+



More information about the Tkabber-dev mailing list