[Tkabber-dev] r1049 - in trunk/tkabber: . plugins/chat plugins/search

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Mar 14 15:50:09 MSK 2007


Author: sergei
Date: 2007-03-14 15:50:08 +0300 (Wed, 14 Mar 2007)
New Revision: 1049

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/chat/histool.tcl
   trunk/tkabber/plugins/search/spanel.tcl
Log:
	* plugins/search/spanel.tcl: Added checking for existence of search
	  panel after the search is done.

	* plugins/chat/histool.tcl: Do not throw an error if the user breaks
	  full-text search by closing chats history window.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-03-14 07:34:28 UTC (rev 1048)
+++ trunk/tkabber/ChangeLog	2007-03-14 12:50:08 UTC (rev 1049)
@@ -3,6 +3,12 @@
 	* msgs/pl.msg: Updated Polish translation (thanks to Irek
 	  Chmielowiec).
 
+	* plugins/search/spanel.tcl: Added checking for existence of search
+	  panel after the search is done.
+
+	* plugins/chat/histool.tcl: Do not throw an error if the user breaks
+	  full-text search by closing chats history window.
+
 2007-03-11  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/de.msg: Updated German translation (thanks to Roger

Modified: trunk/tkabber/plugins/chat/histool.tcl
===================================================================
--- trunk/tkabber/plugins/chat/histool.tcl	2007-03-14 07:34:28 UTC (rev 1048)
+++ trunk/tkabber/plugins/chat/histool.tcl	2007-03-14 12:50:08 UTC (rev 1049)
@@ -2,8 +2,8 @@
 # History tool -- allows browsing and searching through Tkabber chat logs.
 
 option add *ChatHistory.geometry          "640x480" widgetDefault
-#option add *ChatHistory.oddBackground     ""        widgetDefault
-#option add *ChatHistory.evenBackground    beige     widgetDefault
+option add *ChatHistory.oddBackground     ""        widgetDefault
+option add *ChatHistory.evenBackground    ""     widgetDefault
 option add *ChatHistory.headerForeground  blue      widgetDefault
 option add *ChatHistory.bodyForeground    ""        widgetDefault
  
@@ -238,6 +238,10 @@
 		set fname [::logger::jid_to_filename $jid]
 		foreach msg [ftsearch_grep $what in $fname on $year-$month] {
 		    set found 1
+		    if {![winfo exists $r]} {
+			# User closed histool window
+			return $found
+		    }
 		    $r configure -state normal
 		    ftsearch_render_msg $r $year $month $jid $msg
 		    $r configure -state disabled

Modified: trunk/tkabber/plugins/search/spanel.tcl
===================================================================
--- trunk/tkabber/plugins/search/spanel.tcl	2007-03-14 07:34:28 UTC (rev 1048)
+++ trunk/tkabber/plugins/search/spanel.tcl	2007-03-14 12:50:08 UTC (rev 1049)
@@ -113,10 +113,12 @@
     $cbox   configure -state disabled
     update idletasks
 
-    set failed [catch {
-	eval $searchcmd [list [$sentry get] $dir]
-    } found]
+    set failed [catch {eval $searchcmd [list [$sentry get] $dir]} found]
 
+    # Search command may take much time to process, so it may
+    # destroy search panel (user interrupted search by closing the window)
+    if {![winfo exists $sentry]} return
+
     $sentry configure -state normal
     $sbox   configure -state normal
     $cbox   configure -state normal



More information about the Tkabber-dev mailing list