[Tkabber-dev] r1511 - in trunk/tkabber: . ifacetk

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Oct 11 16:08:19 MSD 2008


Author: sergei
Date: 2008-10-11 16:08:18 +0400 (Sat, 11 Oct 2008)
New Revision: 1511

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/chats.tcl
   trunk/tkabber/ifacetk/iface.tcl
Log:
	* chats.tcl, ifacetk/iface.tcl: Added command which programmatically
	  closes chat window (thanks to Konstantin Khomoutov).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2008-10-11 07:58:32 UTC (rev 1510)
+++ trunk/tkabber/ChangeLog	2008-10-11 12:08:18 UTC (rev 1511)
@@ -4,6 +4,9 @@
 
 	* msgs/pl.msg: Updated Polish translation (thanks to Irek Chmielowiec).
 
+	* chats.tcl, ifacetk/iface.tcl: Added command which programmatically
+	  closes chat window (thanks to Konstantin Khomoutov).
+
 2008-10-10  Sergei Golovan  <sgolovan at nes.ru>
 
 	* doc/tkabber.html, doc/tkabber.xml, README: Added notes about new

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2008-10-11 07:58:32 UTC (rev 1510)
+++ trunk/tkabber/chats.tcl	2008-10-11 12:08:18 UTC (rev 1511)
@@ -111,6 +111,14 @@
     open_to_user $connid $open_chat_jid
 }
 
+# chat::close --
+#  Closes the container chat window for a chat identified
+#  by given chat ID. Has the same effect as if the user closed
+#  the chat's window using the UI.
+proc chat::close {chatid} {
+    ifacetk::destroy_win [winid $chatid]
+}
+
 proc chat::get_nick {connid jid type} {
     variable chats
 

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2008-10-11 07:58:32 UTC (rev 1510)
+++ trunk/tkabber/ifacetk/iface.tcl	2008-10-11 12:08:18 UTC (rev 1511)
@@ -1059,10 +1059,12 @@
     global usetabbar
 
     if {$usetabbar} {
-	set page [ifacetk::nbpage $path]
-	eval destroy [pack slaves [.nb getframe $page]]
-	.nb delete $page 1
-	ifacetk::tab_move .nb 0
+	if {[winfo exists $path]} {
+	    set page [ifacetk::nbpage $path]
+	    eval destroy [pack slaves [.nb getframe $page]]
+	    .nb delete $page 1
+	    ifacetk::tab_move .nb 0
+	}
     } else {
 	destroy $path
     }



More information about the Tkabber-dev mailing list