[Tkabber-dev] r456 - trunk/plugins/chattoolbar

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Jan 10 18:13:12 MSK 2011


Author: Rejjin
Date: 2011-01-10 18:13:12 +0300 (Mon, 10 Jan 2011)
New Revision: 456

Modified:
   trunk/plugins/chattoolbar/chattoolbar.tcl
   trunk/plugins/chattoolbar/icon-table.tcl
Log:
Fixed bugs:
Sending custom presence to chats and jids.
"Apply" button in "Topic" and "Chattoolbar settings".
Binds to transport-jids with '%'.
Auto showing toolbar on open window.

Modified: trunk/plugins/chattoolbar/chattoolbar.tcl
===================================================================
--- trunk/plugins/chattoolbar/chattoolbar.tcl	2011-01-04 14:30:27 UTC (rev 455)
+++ trunk/plugins/chattoolbar/chattoolbar.tcl	2011-01-10 15:13:12 UTC (rev 456)
@@ -107,19 +107,29 @@
 		}
 	}
 	
-	if {$user_variable(auto_show)} {change_state_toolbar $chatid $toolFrame} 
+	if {$user_variable(auto_show)} {change_state_toolbar $chatid $toolFrame show} 
 	
 	bind $chatwin <<ChattoolbarState>> \
-	[list [namespace current]::change_state_toolbar $chatid $toolFrame]
+	[double% [list [namespace current]::change_state_toolbar $chatid $toolFrame]]
 	bind $input_win <<ChattoolbarState>> \
-	[list [namespace current]::change_state_toolbar $chatid $toolFrame]
+	[double% [list [namespace current]::change_state_toolbar $chatid $toolFrame]]
 }
 
-proc chattoolbar::change_state_toolbar {chatid toolFrame args} {
+proc chattoolbar::change_state_toolbar {chatid toolFrame {type ""}} {
 variable stored_variable
 	
 	set activex [lsearch $stored_variable(activate_chats) $chatid]
-
+	
+	if {[string length $type] > 0 && [string equal $type show]} {
+		set chatwin [chat::chat_win $chatid]
+		pack $toolFrame -side bottom -anchor w -fill x \
+			-before [winfo parent $chatwin].csw
+		if {$activex < 0} {
+		lappend stored_variable(activate_chats) $chatid
+		}
+		return
+	}
+	
 	if {$activex < 0} {
 		set chatwin [chat::chat_win $chatid]
 		pack $toolFrame -side bottom -anchor w -fill x \
@@ -269,8 +279,12 @@
 	
 	redraw_buttons_on_manager
 	
-	pack $scw -expand 1 -fill both
-	pack $apply -anchor se -pady 5 -padx 4
+	place $scw -in $w -relwidth 1 -relheight 1 \
+		-x 0 -y 0 -width -1 -height -40
+			
+	place $apply -in $w -relx 1 -rely 1 \
+		-x -5 -y -2 -anchor se
+	
 	$text configure -state disabled
 }
 

Modified: trunk/plugins/chattoolbar/icon-table.tcl
===================================================================
--- trunk/plugins/chattoolbar/icon-table.tcl	2011-01-04 14:30:27 UTC (rev 455)
+++ trunk/plugins/chattoolbar/icon-table.tcl	2011-01-10 15:13:12 UTC (rev 456)
@@ -107,8 +107,11 @@
 	set sw [chat::winid $chatid].status.subject
 	$text insert end [$sw get]
 	
-	pack $scw -expand 1 -fill both
-	pack $btn -anchor se -pady 4 -padx 4
+	place $scw -in $w -relwidth 1 -relheight 1 \
+		-x 0 -y 0 -width -1 -height -40
+			
+	place $btn -in $w -relx 1 -rely 1 \
+		-x -5 -y -2 -anchor se
 }
 
 proc button_topic:send_new_subject {chatid text w} {
@@ -140,13 +143,10 @@
 set iconTable(text,custom_presence) [::msgcat::mc "Send custom presence"]
 
 proc button_custom_presence {chatid} {
-set jid [chat::get_jid $chatid]
+	set jid [::xmpp::jid::stripResource \
+		[chat::get_jid $chatid]]
 	set xlib [chat::get_xlib $chatid]
 	
-	if ![chat::is_groupchat $chatid] {
-		return
-    }
-	
 	set m .custom_presence_popup
 	
     if [winfo exists $m] {



More information about the Tkabber-dev mailing list