[Tkabber-dev] r466 - in trunk/plugins/chattoolbar: . msgs

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Jan 28 16:01:19 MSK 2011


Author: Rejjin
Date: 2011-01-28 16:01:18 +0300 (Fri, 28 Jan 2011)
New Revision: 466

Modified:
   trunk/plugins/chattoolbar/AUTHORS
   trunk/plugins/chattoolbar/README
   trunk/plugins/chattoolbar/TODO
   trunk/plugins/chattoolbar/chattoolbar.tcl
   trunk/plugins/chattoolbar/icon-table.tcl
   trunk/plugins/chattoolbar/msgs/ru.msg
Log:
Fixed bugs:
Sending custom presence to chats and jids.
"Apply" button in "Topic" and "Chattoolbar settings" on small window sizes.

Modified: trunk/plugins/chattoolbar/AUTHORS
===================================================================
--- trunk/plugins/chattoolbar/AUTHORS	2011-01-23 11:40:26 UTC (rev 465)
+++ trunk/plugins/chattoolbar/AUTHORS	2011-01-28 13:01:18 UTC (rev 466)
@@ -1,3 +1,3 @@
-Written by Renji.
-email: webrenji at gmail.com
+Written by Renji.
+email: webrenji at gmail.com
 xmpp: rejjin at jabber.dk
\ No newline at end of file


Property changes on: trunk/plugins/chattoolbar/AUTHORS
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/plugins/chattoolbar/README
===================================================================
--- trunk/plugins/chattoolbar/README	2011-01-23 11:40:26 UTC (rev 465)
+++ trunk/plugins/chattoolbar/README	2011-01-28 13:01:18 UTC (rev 466)
@@ -1,36 +1,36 @@
-"ChatToolBar" plugin for Tkabber.
-
-[INTRO]
-If you activate the plugin, then the conversation 
-window bar appears, which contains buttons for 
-quick and convenient access to commands. Buttons 
-can be sorted as you like. You can disable some buttons.
-
-[SHOW|HIDE TOOLBAR]
-For changing chattoolbar state use combination:
-Control-B
-
-[OPTIONS]
-The plugin can be configured through the standard menu 
-plugin. To do this you need to go to the menu "Tkabber",
-choose "Settings", then "Plugins" and "ChatToolbar".
-
-] user_variable(toolbar_button) - add a button to quickly 
-	mutations both position and status on main toolbar.
-] user_variable(chat_active) - using in chat-windows.
-] user_variable(groupchat_active) - using in groupchats.
-] user_variable(auto_show) - automatically display the toolbar 
-	when you open a new window.
-] user_variable(spacing) - Distance between the buttons in toolbar.
-
-[BUTTONS]
-For mutations both sort keys to enter the window settings 
-ChatToolBar. To do this, open the system menu "Services", 
-then "ChatToolbar options". A new window opens, where you 
-see all the buttons, plug-in. Up and down arrows you can move 
-the buttons of others. Unchecking one of the buttons it is 
-deactivated. Just below you can see an example of mutations both. 
-In the same window, added ability to mutations both the distance 
-between the buttons. After making all the mutations both click 
-the "Apply" (if you have many windows open, it may take some time), 
+"ChatToolBar" plugin for Tkabber.
+
+[INTRO]
+If you activate the plugin, then the conversation 
+window bar appears, which contains buttons for 
+quick and convenient access to commands. Buttons 
+can be sorted as you like. You can disable some buttons.
+
+[SHOW|HIDE TOOLBAR]
+For changing chattoolbar state use combination:
+Control-B
+
+[OPTIONS]
+The plugin can be configured through the standard menu 
+plugin. To do this you need to go to the menu "Tkabber",
+choose "Settings", then "Plugins" and "ChatToolbar".
+
+] user_variable(toolbar_button) - add a button to quickly 
+	mutations both position and status on main toolbar.
+] user_variable(chat_active) - using in chat-windows.
+] user_variable(groupchat_active) - using in groupchats.
+] user_variable(auto_show) - automatically display the toolbar 
+	when you open a new window.
+] user_variable(spacing) - Distance between the buttons in toolbar.
+
+[BUTTONS]
+For mutations both sort keys to enter the window settings 
+ChatToolBar. To do this, open the system menu "Services", 
+then "ChatToolbar options". A new window opens, where you 
+see all the buttons, plug-in. Up and down arrows you can move 
+the buttons of others. Unchecking one of the buttons it is 
+deactivated. Just below you can see an example of mutations both. 
+In the same window, added ability to mutations both the distance 
+between the buttons. After making all the mutations both click 
+the "Apply" (if you have many windows open, it may take some time), 
 now the mutations both introduced.
\ No newline at end of file


Property changes on: trunk/plugins/chattoolbar/README
___________________________________________________________________
Added: svn:eol-style
   + native


Property changes on: trunk/plugins/chattoolbar/TODO
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/plugins/chattoolbar/chattoolbar.tcl
===================================================================
--- trunk/plugins/chattoolbar/chattoolbar.tcl	2011-01-23 11:40:26 UTC (rev 465)
+++ trunk/plugins/chattoolbar/chattoolbar.tcl	2011-01-28 13:01:18 UTC (rev 466)
@@ -1,406 +1,407 @@
-# Chattoolbar - plugin for Tkabber.
-# Written by Renji <webrenji at gmail.com>
-# See README for details.
-
-package require msgcat
-package require Img
-
-event add <<ChattoolbarState>> <Control-b> <Control-B> <Control-Egrave> <Control-egrave>
-
-namespace eval chattoolbar {
-variable user_variable
-variable stored_variable
-variable iconTable
-
-	::msgcat::mcload [file join [file dirname [info script]] msgs]
-	source [file join [file dirname [info script]] icon-table.tcl]
-	
-	custom::defgroup Plugins [::msgcat::mc "Plugins options."] -group Tkabber	
-	custom::defgroup ChatToolbar [::msgcat::mc "ChatToolbar options."] -group Plugins	
-	
-	custom::defvar user_variable(toolbar_button) 1 \
-		[::msgcat::mc "Create button on toolbar."] \
-		-group ChatToolbar -type boolean \
-		-command [namespace current]::state_toolbar_button
-	custom::defvar user_variable(chat_active) 1 \
-		[::msgcat::mc "Enable for chats."] \
-		-group ChatToolbar -type boolean \
-		-command [namespace current]::redraw_all_chats
-	custom::defvar user_variable(groupchat_active) 1 \
-		[::msgcat::mc "Enable for groupchats."] \
-		-group ChatToolbar -type boolean \
-		-command [namespace current]::redraw_all_chats
-	custom::defvar user_variable(auto_show) 1 \
-		[::msgcat::mc "Automatically open the toolbar at the entrance to the room."] \
-		-group ChatToolbar -type boolean 
-	custom::defvar user_variable(spacing) 1 \
-		[::msgcat::mc "Distance between the buttons."] \
-		-group ChatToolbar -type integer \
-		-command [namespace current]::redraw_all_chats
-	
-	custom::defvar stored_variable(activate_chats) {} {} \
-	-group Hidden -type string 
-	custom::defvar stored_variable(sort_index) {} {} \
-	-group Hidden -type string 
-	custom::defvar stored_variable(button_state) {} {} \
-	-group Hidden -type string 
-	custom::defvar stored_variable(toolbar_btn_index) -1 {} \
-	-group Hidden -type string 	
-	
-	foreach id $iconTable(id_list) {
-	image create photo plugins/chattoolbar/$id \
-		-data $iconTable(icon,$id)
-	}
-
-	image create photo plugins/chattoolbar/toolbar \
-	-data $iconTable(toolbar)
-	
-	image create photo plugins/chattoolbar/up \
-	-data $iconTable(up_arrow)
-	image create photo plugins/chattoolbar/down \
-	-data $iconTable(down_arrow)
-	
-	hook::add open_chat_post_hook [namespace current]::setup_toolbar
-	hook::add finload_hook [namespace current]::add_toolbar_button
-	hook::add finload_hook [namespace current]::add_services_menu
-}
-
-proc chattoolbar::add_services_menu {} {
-	[.mainframe getmenu services] insert \
-		[::msgcat::mc "Plugins"] \
-		separator
-		
-	[.mainframe getmenu services] insert \
-		[::msgcat::mc "Plugins"] command \
-		-label [::msgcat::mc "ChatToolbar options."] \
-		-command [namespace current]::configure_buttons
-}
-		
-proc chattoolbar::setup_toolbar {chatid type} {
-variable stored_variable
-variable user_variable
-variable iconTable
-
-	if {[chat::is_groupchat $chatid] && !$user_variable(groupchat_active)} {
-	return
-	} elseif {![chat::is_groupchat $chatid] && !$user_variable(chat_active)} {
-	return
-	}
-	set chatwin [chat::chat_win $chatid]
-	set input_win [chat::input_win $chatid]
-	
-	catch {destroy [winfo parent $chatwin].toolbar.bbox}
-	catch {destroy [winfo parent $chatwin].toolbar}
-	
-	set toolFrame [frame [winfo parent $chatwin].toolbar]
-	set bbox [ButtonBox $toolFrame.bbox -spacing $user_variable(spacing)]	
-	pack $bbox -side left -padx 1m
-
-	foreach id [get_sorted_ids] {
-		if {[get_button_state $id]} {
-		$bbox add -image plugins/chattoolbar/$id \
-		-highlightthickness 1 \
-		-takefocus 0 -relief link \
-		-bd $::tk_borderwidth -padx 2 \
-		-pady 3 -command [list [namespace current]::button_$id $chatid] \
-		-helptext $iconTable(text,$id) -justify left
-		}
-	}
-	
-	if {$user_variable(auto_show)} {change_state_toolbar $chatid $toolFrame show} 
-	
-	bind $chatwin <<ChattoolbarState>> \
-	[double% [list [namespace current]::change_state_toolbar $chatid $toolFrame]]
-	bind $input_win <<ChattoolbarState>> \
-	[double% [list [namespace current]::change_state_toolbar $chatid $toolFrame]]
-}
-
-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 \
-			-before [winfo parent $chatwin].csw
-		lappend stored_variable(activate_chats) $chatid
-	} else {
-		pack forget $toolFrame
-		set stored_variable(activate_chats) [lreplace \
-			$stored_variable(activate_chats) $activex $activex]
-	}
-}
-
-proc chattoolbar::get_sorted_ids {} {
-variable stored_variable
-variable iconTable
-	
-	set m [llength $iconTable(id_list)]
-	foreach id $iconTable(id_list) {
-		set idx [lsearch -index 1 $stored_variable(sort_index) $id]
-		if {$idx >= 0} {
-			set ind [lindex $stored_variable(sort_index) $idx 0]
-			set map($ind) [lindex $stored_variable(sort_index) $idx 1]
-		} else { set map([incr m]) $id }
-	}
-	
-	foreach id [lsort -integer [array names map]] {
-	lappend result $map($id)
-	}
-	
-	return $result
-}
-
-proc chattoolbar::get_sorted_ids_temp {} {
-variable temp_variable
-variable iconTable
-	
-	set m [llength $iconTable(id_list)]
-	foreach id $iconTable(id_list) {
-		set idx [lsearch -index 1 $temp_variable(sort_index) $id]
-		if {$idx >= 0} {
-			set ind [lindex $temp_variable(sort_index) $idx 0]
-			set map($ind) [lindex $temp_variable(sort_index) $idx 1]
-		} else { set map([incr m]) $id }
-	}
-	
-	foreach id [lsort -integer [array names map]] {
-	lappend result $map($id)
-	}
-	
-	return $result
-}
-
-proc chattoolbar::get_button_state {id} {
-variable stored_variable
-
-	set idx [lsearch -index 1 $stored_variable(button_state) $id]
-	if {$idx >= 0} {
-		return [lindex $stored_variable(button_state) $idx 0]
-	} else {return 1}
-}
-
-proc chattoolbar::state_toolbar_button {args} {
-variable user_variable 
-	
-	switch -- $user_variable(toolbar_button) {
-		1 add_toolbar_button 
-		0 delete_toolbar_button
-	}
-}
-
-proc chattoolbar::add_toolbar_button {} {
-variable stored_variable
-
-	catch {.mainframe gettoolbar 0} toolbar
-	set bbox $toolbar.bbox
-	
-	if {[winfo exist $toolbar.bbox] && ![ButtonBox::exist $toolbar.bbox $stored_variable(toolbar_btn_index)]} {
-		set stored_variable(toolbar_btn_index) [ifacetk::add_toolbar_button \
-			plugins/chattoolbar/toolbar \
-			[namespace current]::configure_buttons \
-			[::msgcat::mc "Configure ChatToolBar"]]
-	}
-}
-
-proc chattoolbar::delete_toolbar_button {} {
-variable stored_variable
-	
-	catch {.mainframe gettoolbar 0} toolbar
-	set bbox $toolbar.bbox
-	
-	if {[winfo exist $toolbar.bbox] && \
-		[ButtonBox::exist $toolbar.bbox $stored_variable(toolbar_btn_index)]} {
-			ButtonBox::delete $toolbar.bbox $stored_variable(toolbar_btn_index)
-			set toolbar_button(index) -1
-	}
-}
-
-proc ::ButtonBox::exist {path index} {
-    variable $path
-    upvar 0  $path data
-	
-	return [expr {[lsearch -exact $data(buttons) $index] > 0}]	
-}
-
-proc ::ButtonBox::delete { path idx } {
-    variable $path
-    upvar 0  $path data
-
-    set i [lsearch -exact $data(buttons) $idx]
-    set data(buttons) [lreplace $data(buttons) $i $i]
-    destroy $path.b$idx
-}
-
-proc chattoolbar::configure_buttons {} {
-variable state
-variable stored_variable
-variable temp_variable
-variable iconTable
-variable spacing
-variable user_variable
-
-	set w .chattoolbar_manager
-	
-	if {[winfo exists $w]} return
-	
-	set temp_variable(sort_index) $stored_variable(sort_index)
-	set spacing $user_variable(spacing)
-	foreach id $iconTable(id_list) {
-	set state($id) [get_button_state $id]
-	}
-	
-	add_win $w -title [::msgcat::mc "Chattoolbar manager"] \
-	    -tabtitle [::msgcat::mc "Chattoolbar setting"] \
-		-raisecmd [list focus $w]
-	
-	set scw [ScrolledWindow $w.sw]
-	
-	set text [text $w.buttonlist -wrap word \
-		-background [$w cget -background] \
-		-cursor arrow]
-		
-	set apply [button $w.apply \
-		-text [::msgcat::mc "Apply"] \
-		-command [namespace current]::apply]
-	
-	$scw setwidget $text	
-	
-	redraw_buttons_on_manager
-	
-	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
-}
-
-proc chattoolbar::apply {} {
-variable stored_variable
-variable temp_variable
-variable state
-variable spacing
-variable user_variable
-
-	set stored_variable(sort_index) $temp_variable(sort_index)
-	set user_variable(spacing) $spacing
-	
-	foreach ob [array names state] {
-		set idx [lsearch -index 1 $stored_variable(button_state) $ob]
-		if {$idx >= 0} {
-		set stored_variable(button_state) [lreplace $stored_variable(button_state) \
-			$idx $idx [list $state($ob) $ob]]
-		} else {lappend stored_variable(button_state) [list $state($ob) $ob]}
-	}
-	
-	redraw_all_chats
-}
-
-proc chattoolbar::redraw_buttons_on_manager { } {
-variable iconTable
-variable state
-variable spacing
-variable user_variable
-
-	set text .chattoolbar_manager.buttonlist
-
-	$text configure -state normal
-	$text delete 1.0 end
-
-	ButtonBox $text.bbox -spacing $spacing
-	label $text.spacing_text -text [::msgcat::mc "Spacing between buttons"]
-	spinbox $text.spacing -from 0 -to 10 -width 5 \
-		-textvariable [namespace current]::spacing \
-		-command [namespace current]::redraw_buttons_on_manager \
-		-validate key \
-		-vcmd {string is integer %P} 
-		
-	normalize_sort_temp
-	foreach id [get_sorted_ids_temp] {
-		set check [checkbutton $text.check_$id \
-			-image plugins/chattoolbar/$id \
-			-variable [namespace current]::state($id)]
-		
-		button $text.check_${id}_up -image plugins/chattoolbar/up \
-			-command [list [namespace current]::button_move - $id] \
-			-relief flat -background [.chattoolbar_manager cget -background]
-			
-		button $text.check_${id}_down -image plugins/chattoolbar/down \
-			-command [list [namespace current]::button_move + $id] \
-			-relief flat -background [.chattoolbar_manager cget -background]
-		
-		$text window create end -window $text.check_${id}_up
-		$text window create end -window $text.check_${id}_down
-		$text window create end -window $check
-		$text insert end \t$iconTable(text,$id)\n
-		
-		if {$state($id)} {
-		$text.bbox add -image plugins/chattoolbar/$id \
-			-highlightthickness 1 \
-			-takefocus 0 -relief link \
-			-bd $::tk_borderwidth -padx 2 \
-			-pady 3 \
-			-helptext $iconTable(text,$id) \
-			-justify left
-		}
-		
-		bindscroll $check $text
-	}
-	
-	$text insert end \n\n
-	$text window create end -window $text.bbox
-	$text insert end \n
-	$text window create end -window $text.spacing_text
-	$text window create end -window $text.spacing
-	
-}
-
-proc chattoolbar::button_move {to id} {
-variable temp_variable
-		
-	set blen [llength $temp_variable(sort_index)]
-	
-	set idx [lsearch -index 1 $temp_variable(sort_index) $id]
-	set idval [lindex $temp_variable(sort_index) $idx]
-	lassign $idval sind sid
-	
-	set lidx [expr $idx $to 1]
-	set lidval [lindex $temp_variable(sort_index) $lidx]
-	lassign $lidval lsind lsid
-
-	if {$lidx < 0 || $lidx > [expr {$blen - 1}]} return
-	
-	set temp_variable(sort_index) [lreplace $temp_variable(sort_index) \
-		$idx $idx [list $lsind $sid]]
-	set temp_variable(sort_index) [lreplace $temp_variable(sort_index) \
-		$lidx $lidx [list $sind $lsid]]
-	
-	redraw_buttons_on_manager
-}
-
-proc chattoolbar::normalize_sort_temp {} {
-variable temp_variable
-	foreach id [get_sorted_ids_temp] {
-	lappend temp_list [list [incr ix] $id]
-	}
-	set temp_variable(sort_index) $temp_list
-}
-
-proc chattoolbar::redraw_all_chats {args} {
-	foreach chatid [chat::opened] {
-	setup_toolbar $chatid {}
-	}
+# $Id$
+# Chattoolbar - plugin for Tkabber.
+# Written by Renji <webrenji at gmail.com>
+# See README for details.
+
+package require msgcat
+package require Img
+
+event add <<ChattoolbarState>> <Control-b> <Control-B> <Control-Egrave> <Control-egrave>
+
+namespace eval chattoolbar {
+variable user_variable
+variable stored_variable
+variable iconTable
+
+	::msgcat::mcload [file join [file dirname [info script]] msgs]
+	source [file join [file dirname [info script]] icon-table.tcl]
+	
+	custom::defgroup Plugins [::msgcat::mc "Plugins options."] -group Tkabber	
+	custom::defgroup ChatToolbar [::msgcat::mc "ChatToolbar options."] -group Plugins	
+	
+	custom::defvar user_variable(toolbar_button) 1 \
+		[::msgcat::mc "Create button on toolbar."] \
+		-group ChatToolbar -type boolean \
+		-command [namespace current]::state_toolbar_button
+	custom::defvar user_variable(chat_active) 1 \
+		[::msgcat::mc "Enable for chats."] \
+		-group ChatToolbar -type boolean \
+		-command [namespace current]::redraw_all_chats
+	custom::defvar user_variable(groupchat_active) 1 \
+		[::msgcat::mc "Enable for groupchats."] \
+		-group ChatToolbar -type boolean \
+		-command [namespace current]::redraw_all_chats
+	custom::defvar user_variable(auto_show) 1 \
+		[::msgcat::mc "Automatically open the toolbar at the entrance to the room."] \
+		-group ChatToolbar -type boolean 
+	custom::defvar user_variable(spacing) 1 \
+		[::msgcat::mc "Distance between the buttons."] \
+		-group ChatToolbar -type integer \
+		-command [namespace current]::redraw_all_chats
+	
+	custom::defvar stored_variable(activate_chats) {} {} \
+	-group Hidden -type string 
+	custom::defvar stored_variable(sort_index) {} {} \
+	-group Hidden -type string 
+	custom::defvar stored_variable(button_state) {} {} \
+	-group Hidden -type string 
+	custom::defvar stored_variable(toolbar_btn_index) -1 {} \
+	-group Hidden -type string 	
+	
+	foreach id $iconTable(id_list) {
+	image create photo plugins/chattoolbar/$id \
+		-data $iconTable(icon,$id)
+	}
+
+	image create photo plugins/chattoolbar/toolbar \
+	-data $iconTable(toolbar)
+	
+	image create photo plugins/chattoolbar/up \
+	-data $iconTable(up_arrow)
+	image create photo plugins/chattoolbar/down \
+	-data $iconTable(down_arrow)
+	
+	hook::add open_chat_post_hook [namespace current]::setup_toolbar
+	hook::add finload_hook [namespace current]::add_toolbar_button
+	hook::add finload_hook [namespace current]::add_services_menu
+}
+
+proc chattoolbar::add_services_menu {} {
+	[.mainframe getmenu services] insert \
+		[::msgcat::mc "Plugins"] \
+		separator
+		
+	[.mainframe getmenu services] insert \
+		[::msgcat::mc "Plugins"] command \
+		-label [::msgcat::mc "ChatToolbar options."] \
+		-command [namespace current]::configure_buttons
+}
+		
+proc chattoolbar::setup_toolbar {chatid type} {
+variable stored_variable
+variable user_variable
+variable iconTable
+
+	if {[chat::is_groupchat $chatid] && !$user_variable(groupchat_active)} {
+	return
+	} elseif {![chat::is_groupchat $chatid] && !$user_variable(chat_active)} {
+	return
+	}
+	set chatwin [chat::chat_win $chatid]
+	set input_win [chat::input_win $chatid]
+	
+	catch {destroy [winfo parent $chatwin].toolbar.bbox}
+	catch {destroy [winfo parent $chatwin].toolbar}
+	
+	set toolFrame [frame [winfo parent $chatwin].toolbar]
+	set bbox [ButtonBox $toolFrame.bbox -spacing $user_variable(spacing)]	
+	pack $bbox -side left -padx 1m
+
+	foreach id [get_sorted_ids] {
+		if {[get_button_state $id]} {
+		$bbox add -image plugins/chattoolbar/$id \
+		-highlightthickness 1 \
+		-takefocus 0 -relief link \
+		-bd $::tk_borderwidth -padx 2 \
+		-pady 3 -command [list [namespace current]::button_$id $chatid] \
+		-helptext $iconTable(text,$id) -justify left
+		}
+	}
+	
+	if {$user_variable(auto_show)} {change_state_toolbar $chatid $toolFrame show} 
+	
+	bind $chatwin <<ChattoolbarState>> \
+	[double% [list [namespace current]::change_state_toolbar $chatid $toolFrame]]
+	bind $input_win <<ChattoolbarState>> \
+	[double% [list [namespace current]::change_state_toolbar $chatid $toolFrame]]
+}
+
+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 \
+			-before [winfo parent $chatwin].csw
+		lappend stored_variable(activate_chats) $chatid
+	} else {
+		pack forget $toolFrame
+		set stored_variable(activate_chats) [lreplace \
+			$stored_variable(activate_chats) $activex $activex]
+	}
+}
+
+proc chattoolbar::get_sorted_ids {} {
+variable stored_variable
+variable iconTable
+	
+	set m [llength $iconTable(id_list)]
+	foreach id $iconTable(id_list) {
+		set idx [lsearch -index 1 $stored_variable(sort_index) $id]
+		if {$idx >= 0} {
+			set ind [lindex $stored_variable(sort_index) $idx 0]
+			set map($ind) [lindex $stored_variable(sort_index) $idx 1]
+		} else { set map([incr m]) $id }
+	}
+	
+	foreach id [lsort -integer [array names map]] {
+	lappend result $map($id)
+	}
+	
+	return $result
+}
+
+proc chattoolbar::get_sorted_ids_temp {} {
+variable temp_variable
+variable iconTable
+	
+	set m [llength $iconTable(id_list)]
+	foreach id $iconTable(id_list) {
+		set idx [lsearch -index 1 $temp_variable(sort_index) $id]
+		if {$idx >= 0} {
+			set ind [lindex $temp_variable(sort_index) $idx 0]
+			set map($ind) [lindex $temp_variable(sort_index) $idx 1]
+		} else { set map([incr m]) $id }
+	}
+	
+	foreach id [lsort -integer [array names map]] {
+	lappend result $map($id)
+	}
+	
+	return $result
+}
+
+proc chattoolbar::get_button_state {id} {
+variable stored_variable
+
+	set idx [lsearch -index 1 $stored_variable(button_state) $id]
+	if {$idx >= 0} {
+		return [lindex $stored_variable(button_state) $idx 0]
+	} else {return 1}
+}
+
+proc chattoolbar::state_toolbar_button {args} {
+variable user_variable 
+	
+	switch -- $user_variable(toolbar_button) {
+		1 add_toolbar_button 
+		0 delete_toolbar_button
+	}
+}
+
+proc chattoolbar::add_toolbar_button {} {
+variable stored_variable
+
+	catch {.mainframe gettoolbar 0} toolbar
+	set bbox $toolbar.bbox
+	
+	if {[winfo exist $toolbar.bbox] && ![ButtonBox::exist $toolbar.bbox $stored_variable(toolbar_btn_index)]} {
+		set stored_variable(toolbar_btn_index) [ifacetk::add_toolbar_button \
+			plugins/chattoolbar/toolbar \
+			[namespace current]::configure_buttons \
+			[::msgcat::mc "Configure ChatToolBar"]]
+	}
+}
+
+proc chattoolbar::delete_toolbar_button {} {
+variable stored_variable
+	
+	catch {.mainframe gettoolbar 0} toolbar
+	set bbox $toolbar.bbox
+	
+	if {[winfo exist $toolbar.bbox] && \
+		[ButtonBox::exist $toolbar.bbox $stored_variable(toolbar_btn_index)]} {
+			ButtonBox::delete $toolbar.bbox $stored_variable(toolbar_btn_index)
+			set toolbar_button(index) -1
+	}
+}
+
+proc ::ButtonBox::exist {path index} {
+    variable $path
+    upvar 0  $path data
+	
+	return [expr {[lsearch -exact $data(buttons) $index] > 0}]	
+}
+
+proc ::ButtonBox::delete { path idx } {
+    variable $path
+    upvar 0  $path data
+
+    set i [lsearch -exact $data(buttons) $idx]
+    set data(buttons) [lreplace $data(buttons) $i $i]
+    destroy $path.b$idx
+}
+
+proc chattoolbar::configure_buttons {} {
+variable state
+variable stored_variable
+variable temp_variable
+variable iconTable
+variable spacing
+variable user_variable
+
+	set w .chattoolbar_manager
+	
+	if {[winfo exists $w]} return
+	
+	set temp_variable(sort_index) $stored_variable(sort_index)
+	set spacing $user_variable(spacing)
+	foreach id $iconTable(id_list) {
+	set state($id) [get_button_state $id]
+	}
+	
+	add_win $w -title [::msgcat::mc "Chattoolbar manager"] \
+	    -tabtitle [::msgcat::mc "Chattoolbar setting"] \
+		-raisecmd [list focus $w]
+	
+	set scw [ScrolledWindow $w.sw]
+	
+	set text [text $w.buttonlist -wrap word \
+		-background [$w cget -background] \
+		-cursor arrow]
+		
+	set apply [button $w.apply \
+		-text [::msgcat::mc "Apply"] \
+		-command [namespace current]::apply]
+	
+	$scw setwidget $text	
+	
+	redraw_buttons_on_manager
+	
+	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
+}
+
+proc chattoolbar::apply {} {
+variable stored_variable
+variable temp_variable
+variable state
+variable spacing
+variable user_variable
+
+	set stored_variable(sort_index) $temp_variable(sort_index)
+	set user_variable(spacing) $spacing
+	
+	foreach ob [array names state] {
+		set idx [lsearch -index 1 $stored_variable(button_state) $ob]
+		if {$idx >= 0} {
+		set stored_variable(button_state) [lreplace $stored_variable(button_state) \
+			$idx $idx [list $state($ob) $ob]]
+		} else {lappend stored_variable(button_state) [list $state($ob) $ob]}
+	}
+	
+	redraw_all_chats
+}
+
+proc chattoolbar::redraw_buttons_on_manager { } {
+variable iconTable
+variable state
+variable spacing
+variable user_variable
+
+	set text .chattoolbar_manager.buttonlist
+
+	$text configure -state normal
+	$text delete 1.0 end
+
+	ButtonBox $text.bbox -spacing $spacing
+	label $text.spacing_text -text [::msgcat::mc "Spacing between buttons"]
+	spinbox $text.spacing -from 0 -to 10 -width 5 \
+		-textvariable [namespace current]::spacing \
+		-command [namespace current]::redraw_buttons_on_manager \
+		-validate key \
+		-vcmd {string is integer %P} 
+		
+	normalize_sort_temp
+	foreach id [get_sorted_ids_temp] {
+		set check [checkbutton $text.check_$id \
+			-image plugins/chattoolbar/$id \
+			-variable [namespace current]::state($id)]
+		
+		button $text.check_${id}_up -image plugins/chattoolbar/up \
+			-command [list [namespace current]::button_move - $id] \
+			-relief flat -background [.chattoolbar_manager cget -background]
+			
+		button $text.check_${id}_down -image plugins/chattoolbar/down \
+			-command [list [namespace current]::button_move + $id] \
+			-relief flat -background [.chattoolbar_manager cget -background]
+		
+		$text window create end -window $text.check_${id}_up
+		$text window create end -window $text.check_${id}_down
+		$text window create end -window $check
+		$text insert end \t$iconTable(text,$id)\n
+		
+		if {$state($id)} {
+		$text.bbox add -image plugins/chattoolbar/$id \
+			-highlightthickness 1 \
+			-takefocus 0 -relief link \
+			-bd $::tk_borderwidth -padx 2 \
+			-pady 3 \
+			-helptext $iconTable(text,$id) \
+			-justify left
+		}
+		
+		bindscroll $check $text
+	}
+	
+	$text insert end \n\n
+	$text window create end -window $text.bbox
+	$text insert end \n
+	$text window create end -window $text.spacing_text
+	$text window create end -window $text.spacing
+	
+}
+
+proc chattoolbar::button_move {to id} {
+variable temp_variable
+		
+	set blen [llength $temp_variable(sort_index)]
+	
+	set idx [lsearch -index 1 $temp_variable(sort_index) $id]
+	set idval [lindex $temp_variable(sort_index) $idx]
+	lassign $idval sind sid
+	
+	set lidx [expr $idx $to 1]
+	set lidval [lindex $temp_variable(sort_index) $lidx]
+	lassign $lidval lsind lsid
+
+	if {$lidx < 0 || $lidx > [expr {$blen - 1}]} return
+	
+	set temp_variable(sort_index) [lreplace $temp_variable(sort_index) \
+		$idx $idx [list $lsind $sid]]
+	set temp_variable(sort_index) [lreplace $temp_variable(sort_index) \
+		$lidx $lidx [list $sind $lsid]]
+	
+	redraw_buttons_on_manager
+}
+
+proc chattoolbar::normalize_sort_temp {} {
+variable temp_variable
+	foreach id [get_sorted_ids_temp] {
+	lappend temp_list [list [incr ix] $id]
+	}
+	set temp_variable(sort_index) $temp_list
+}
+
+proc chattoolbar::redraw_all_chats {args} {
+	foreach chatid [chat::opened] {
+	setup_toolbar $chatid {}
+	}
 }
\ No newline at end of file


Property changes on: trunk/plugins/chattoolbar/chattoolbar.tcl
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Modified: trunk/plugins/chattoolbar/icon-table.tcl
===================================================================
--- trunk/plugins/chattoolbar/icon-table.tcl	2011-01-23 11:40:26 UTC (rev 465)
+++ trunk/plugins/chattoolbar/icon-table.tcl	2011-01-28 13:01:18 UTC (rev 466)
@@ -1,405 +1,405 @@
-# Icons table
-
-variable iconTable
-
-# index of iconTable array.
-
-set iconTable(id_list) [list disco copy paste smile configure_room custom_presence vcard change_nick history join_conference add_user rejoin clear topic juick_cmds notes]
-
-# REJOIN ID ___________________________
-
-set iconTable(icon,rejoin) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAACH0lEQVR42pSTwUsUUBDGf2/dXXW1cMXEZCvKpQiCIKJLsNilP0G8CCor3oT6Dzx69SilaZ66eO/oQeoUUZbQwT0EdjE1w9335s28DpurUkEODHP6vpn55huXUuK8sfl8Zs5Mn6rGw+x5gJ+Xnnwx03L+0gDbtU16M/nYIpidnU1mxnGqaqtO3klkMPJ9A3RfL2NqpO0PiHhaBKpKqVQCwDl3pqb0keL9h4DD/9xFxZOSIRLJVOYdlXmHqgKw2pgmkXDOtVJVMVUa+1+RowNMAskUEU/m9ATHHVfr02cIYgyYChoDFgMWPcmMEBpkgQSwMTjHRh0e3X1Md+dFlt9Umbiw2CSPgRQjJgGNAZIjmRGl0ZxgoHiZ8uAt7pUftBQfqYyxdDiJcw753VnFk6ROf7FGSpEQTq3wtxipjLH4YwKRgMaIBk9X5x69Pbvk2urI8QT/ilfrL6n2LCPSwKJHxbP/vY1arQ8fcidn/La3A3s7QFOD02DnHCF4LAomHhVh12fBDJFAFnAAQ+/G0/DwMM/fjwMwVVxpeSFKo6lBFDR6nMtiZsQYTowUY2ydsdrz4oyZgvgmWDwmAeeMlJoEmfWZxPpMahFMFVfIZNrO+ECkuUKheIVC7zVyhSKkhGoku7CwkLa2togxsra29scfmBmjN4749PY17R1d5DsK5PLtpGSYKe5/3vlZ9Wq/ahxSlduq8aaZljLZ/KiKP/g1AM5qbQlMGLUUAAAAAElFTkSuQmCC
-}
-
-set iconTable(text,rejoin) [::msgcat::mc "Rejoin room"]
-
-proc button_rejoin {chatid} {
-	set jid [chat::get_jid $chatid]
-	set xlib [chat::get_xlib $chatid]
-
-	if {![chat::is_groupchat $chatid]} {
-		return
-    }
-	
-	if {[catch {get_our_groupchat_nick $chatid} nick]} {
-		set nick [get_group_nick $xlib $jid]
-	}
-	
-	set password ""	
-	if {[info exist ::muc::muc_password($chatid)]} {
-		set password $::muc::muc_password($chatid)
-	}
-	
-	muc::leave_group $chatid ""
-	muc::join_group $xlib $jid $nick $password
-}
-
-# VCARD ID ___________________________
-
-set iconTable(icon,vcard) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAV5JREFUeNrEky9Pw0AYxp+DpQkJHQhS1oSiSZgppprP0BrIpklRq+BDoOqYwHXVzKBQJFUNogM8AjNL2DL6v9zdsobRQTImeM1d7p7nd+977x0pigKrxBpWjJrjOFd0NP/o79ayLDPb7TaWLYUQgl6vZ9bSNEUYhhiNRksBRFEE83JAFEUc8DbJcX3/jjgtcHZcx464/iNAEIQpIEkS0DIQxzHunkP4LxEX3A7GONU2+NzzvApA13Uw7xzgYJeS6aFpDhw2wNdYaJpWATBPCcjznIsbm4C8RfCRAPvbDJpxse/7FYBhGFMAMzLa4DWG80AwnlaAi36Ck6MC6h6gqurCDJi3LKH/hNLMYkKzv3mkpUgxgiAoWzcLRVHm7+DSqM+dMBwO+Ui30Ww2Icvy4jtgrWBk13XLzVarBUmSKml/1ZimydtIOp3O7Cl3bds+tyzrt6f9XdMl//4bPwUYANB+yxQGS9MJAAAAAElFTkSuQmCC
-}
-
-set iconTable(text,vcard) [::msgcat::mc "Vcard info"]
-
-proc button_vcard {chatid} {
-	set xlib [chat::get_xlib $chatid]
-	set jid [chat::get_jid $chatid]
-	::userinfo::open $xlib [::xmpp::jid::stripResource $jid]
-}
-
-
-# ___________________________
-set iconTable(icon,history) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAG3SURBVHjapFPBSgJRFD3WLALbjDomiBYWVESLmIqMkSyiTVCbFn1BLfydXNQPFLRuE5IIUhBMrSQhkjAEzanZ5EIdtXffzDgOZBuF49z7zjuHM/fN8/R6PYzyE04vVHqmZFk+Zk/FWs8zXDGkrT7F4OJVVeW8wP6ykiQlD+aB0KTJVn+gvH1DKdRxRv2SBMz63Hy5LCn1ev1ojPXJaDSKoBe4zqjIqCVUPnXEI8BuzBRQTWvE0R7aSxrSCp1OBwSjO47Dbbn/bkYXrnp5WgQIVm/rBMMw0G63ucFNToUoihyLEdFl8PKhQ9dN7G/JpoZpBSo4uhPYSzgJ2gMJqJ4LM8Ow2O9tHTdotVowOsDdvZNgJjSQgHHvVSfBzqbMNdyAilazyV0TG8MThIMih92ThrQ8QZMSsMWHRyfBVMA9g5rmJIivy1zjJLAM1laHn4LfJ3LYva3rD7H7zxf9F+caIuEy94rKV4OTYb8XC+wYV2IB3j+XNBTZMQ7yfQM6y1qthmJRR6Nhbih6vXhic7gNmAaapvF3H+RpTqT1yCfnWbZWsC5P3kqoWJcnZfXpIfySZ9Tr/CvAAFL4JRqBf1s8AAAAAElFTkSuQmCC
-}
-
-set iconTable(text,history) [::msgcat::mc "Chat history"]
-
-proc button_history {chatid} {
-	set jid [chat::get_jid $chatid]
-	logger::show_log [::xmpp::jid::stripResource $jid]
-}
-
-# ___________________________
-set iconTable(icon,configure_room) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOxSURBVHjaYuzpWcQgLS3OwMDwX5Cdne2EpqaS9L9/f/+/ffvxxbNnryZ+/vx9/u/ff74yMjLAwY8fvxlMTbUYrKz0GAACiOnHj18MDx48Zfj589eXb99+zvv+/TuXpqYij42NgYqJidZkFhbmXqDhrIxAE0CGwDAMAAQAQQC+/wNERFAF9/f4/vHx8/4HBwXF3Nzl7/39/DwbGxUHExMQAAICADT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at::mc "Configure room"]
-
-proc button_configure_room {chatid} {
-	muc::request_config $chatid
-}
-
-# ___________________________
-set iconTable(icon,topic) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUlJREFUeNqMUztOw0AQ3bUXSIPwEQxNSiLRpCMSEqIC03ECJLpwgtg3MAUFVDkCuI9IOiiQ0lIBN1hait28DbNoZO1aGen5M96ZefNmLAXs9PKmstbeGmN2Rdg0UM6axzvmS4Ct9OT8eoJghx0Rtx5wdtA/0p8f72/kk0CqcBmTY+6qRBLUwIC+cxZWgoGllxEoLkLROHNMBZxlOPfjGSRiM1uy5wFnkJBAzkpXCdhrR1PFtjnmxrUw6ej9i2n0RPcCmKKDetY8VClUXUBdT63XSpABV8CQnl3CV/KN9vvDtRAhwXxw2eq5ID2mLoEVSodEnBM0a81VLqDFM/D955fCiO1MxWRnI5WxM1amYtMx8hYPPTNpjVYdBy/YFuahKUrxW6vI6PJ44P/PVb8091UowZhmnrMtLNnCLfliyQ76nsFa/VirKwEGAPl8ceh31ThgAAAAAElFTkSuQmCC
-}
-
-set iconTable(text,topic) [::msgcat::mc "Change subject"]
-
-proc button_topic {chatid} {
-	if {![chat::is_groupchat $chatid]} {
-	return
-	}
-	
-	set node [::xmpp::jid::node [chat::get_jid $chatid]]
-	
-	if {[winfo exist [set w ._subject_[ifacetk::nbpage $node]]]} {
-	return
-	}
-
-	add_win $w -title [::msgcat::mc "Change subject"] \
-	    -tabtitle [::msgcat::mc "%s subject" $node] \
-	    -raisecmd [list focus $w]
-		
-	set scw [ScrolledWindow $w.sw]
-	set text [text $w.subject -wrap word]
-		
-	$scw setwidget $text
-		
-	set btn [button $w.apply \
-		-text [::msgcat::mc "Save subject"] \
-		-command [list [namespace current]::button_topic:send_new_subject $chatid $text $w]]
-		
-	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
-}
-
-proc button_topic:send_new_subject {chatid text w} {
-    set chatwin [chat::winid $chatid]
-    set xlib [chat::get_xlib $chatid]
-    set jid [chat::get_jid $chatid]
-	set subject [$text get 1.0 "end - 1 chars"]
-
-    message::send_msg $xlib $jid -type groupchat -subject $subject
-	destroy_win $w
-}
-
-# ___________________________
-set iconTable(icon,clear) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArJJREFUeNqkk11Ik1EYx//Hzc85dc2crulc05k5dDmbmFo5i6ZLiiiEiC5KyIu6iC4CkYrwopsCoW+yiwIJNCPcUDPQojTSyaJUyo9YmSU6v7Z0c+/2dg4uCEIKfOH3PofnPM9z/uec5xCe57GeT3izKgSsBKvDIGR1gtnTDTz26wnMuatzAYpnmEeYECZ/AHU+H2pD/mORApp3j0HHO2kh05IHdTvKDundy6gT/iM5zWLjs+vvXDnJJFhu1Eh/LiPZYNylb3rQYuP8ayuIo/FnqN07Ojp2u+1NNLxTUyivunhQrCWTjx+9sE3MoDYQQDtTEEqJpcRTkmiiIUIUm5eaU6gbrMxWWa0WlJaa0NbhRYlyBPuOnatY4a5a+QA87EyE9HchQiTZHi6KEUWKpeKNyekyiUwR73OtCF0TTpQZotBieQKj0QxrxxJKVWMwHjhh7mi+v0AX6w6hMjrdC3PeDEN5kVytz/HMBxLHe4eFruk5RCkkmB36iopcFyyWJhQXm9E6mIRFxyI4DoQCgSmHOHps/HxPV1+miIdcFBsNWboCAnpX3+3jkKgTwbk9yIxbQuNzOzSafFSevdxYmIYGuo3Pv2+hPVdLlp3OgfNbCrRlIwNDEPICpGSnwT0zD97jR5wyAcezFmCormym8beo/FesZQSsYxbdgFpOHPYh3tn3+l1mfqFOvmlrKiaHHeC8HGIUUsx9nETT04cv9cm41v+FdKdsAN5/ow33+95UCQRKuociLSmhXVaj0RTsCdADUusyME2T27s6e6n/0qwHz1o/EKz5BJRSgt0qmI5kob/t+mH+7qk8/qgOb42bYZKJ/45nClgziSgxFBYSyXw6ObZlSFHNFvo0g3r7D3RR/wrFS/EFx34SLBJGCQ/a0KCPaQwE8VO4oP0Tnqz3Of8SYAAnOhsd7tLKFAAAAABJRU5ErkJggg==
-}
-
-set iconTable(text,clear) [::msgcat::mc "Clear chat window"]
-
-proc button_clear {chatid} {
-	plugins::clear::clear_chat_win $chatid
-}
-
-# ___________________________
-set iconTable(icon,custom_presence) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAflJREFUeNpi/P//PwM6aFkdpQikMoE4HIiZgXg9EE+vCV12DV0tI7oBdUuC5ZiYmB+aqzkxqEjqMDAyMjLcf3mD4fiN3Qx//v7Wa4pZexlZPRO6id+/fc/Uk7NkEOUTZHj8+hzDw1dnGPi5OBmMFO3AcujqWdAFvn7+ksDJzsxw+9lZuNirD08ZhHhlwXJAbhYhAxjuPr3E8J/xD4r4m4+vwXLEuGDBrfu3KgSFuVHEP777ApJbTIwB0+/evFchJMHLwCPACQxEoNjHHwxvnn9m+Pf373SCBpjZW5sBDTn+4ukzy3tXnjGAYklYTPS/qpb6SX4hQVD0XsAajZXz/PiBVLuChHqmvqIlg7SIIlzR////GJ68uc9w6f4Jhocvb4FckduetOkvigt+fP/ebqxul6mjZMDw9uMDhnN3LiFsAUJuTmEGS017BnZmzsxLd08wwGID7IKMbps0RSn1maY6lgxPXl9lwAfkxfQZDp7bw/Ds9YO4GaVHFoNd8P3rt0wVWQ2Gqw+OMBACl+4fYNBSMGC4++AaKFHBDdB9/PYqw5fv7xiIAf//XQPpMYCHATCJfnz86r4QExNR+hk+fPoE1gM3ABiA0x/dfVotLMXDwMjEiFfzv3//Gd49+wLWgxKN9tH8vdAszEnAAaD0PP3g0o9lIA5AgAEA1OPkeDeIXrEAAAAASUVORK5CYII=
-}
-
-set iconTable(text,custom_presence) [::msgcat::mc "Send custom presence"]
-
-proc button_custom_presence {chatid} {
-set jid [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] {
-		destroy $m
-    }
-	
-    set m [menu $m -tearoff 0]
-	
-    $m add command -label [::msgcat::mc "Available"] \
-			-command [list send_custom_presence $xlib $jid available]
-    $m add command -label [::msgcat::mc "Free to chat"] \
-		    -command [list send_custom_presence $xlib $jid chat]
-    $m add command -label [::msgcat::mc "Away"] \
-		    -command [list send_custom_presence $xlib $jid away]
-    $m add command -label [::msgcat::mc "Extended away"] \
-		    -command [list send_custom_presence $xlib $jid xa]
-    $m add command -label [::msgcat::mc "Do not disturb"] \
-		    -command [list send_custom_presence $xlib $jid dnd]
-
-		   
-	tk_popup $m [winfo pointerx .] [winfo pointery .]
-}
-
-# ___________________________
-set iconTable(icon,paste) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgpJREFUeNp8k7+L1EAUx79JZv21oqhwgoiFIgp6rXuCIIj/gCDYbSFskUOwkrOwWFgx2IiVQRcstpA7tLIRLARBOU44EKwEr7LwcsiBdxE3mZmM7002biaoD94mm/m+z3znzYxnjEE9RqPRI3qEk79xt9udx3/CW7w996fg58EOsr2n0Ov17OBwOMTO9DPamyuVPr4WLbvAZ7fOmV/rH21GUWTSNDVJktjkd/5WjbOWHddTaF0g/foO441POLpnNwaDgTPB2SMZvq/G2DUzC9Y2QyhVoKBUUuPCsW2bzVDSKzXqbwAqVFpDSgXUGvry23l82Dztqg88wKv+WxbFS/2LtheCC7UsIHMXsLxxEtGNOajCgJ2zfUXjBb3ff7oSXr3zBi/uXponADlQigDSAWgCZ1mKteQHcrKeKwNJsBOH92Hhegf3Hr8Pryy8hq9ybdefZ9JJBgYBsCPw0RKcHoTv4cv6FsbZNm52Z1kTCrauFAEaS7AAnwpbHgz8ydeyiWvJlnXCGmcJ9VMps5wAQIt+jC2cQjyaKyA3rLFNZAfsxAGMcytqBZWDKYQ2tQSQxm6jpibZbawF02kFELT2MqYQ/sLurAM+HLxFh453XMCqhO+VjYOYXBxbXNinIILtARXHz58Mw+YJk+2+Bczsb6OY7L+uzkTBk5aN9prXuYozlx/Wr/W/Iv4twAB6XV9giUsGiQAAAABJRU5ErkJggg==
-}
-
-set iconTable(text,paste) [::msgcat::mc "Paste"]
-
-proc button_paste {chatid} {
-	set win [chat::input_win $chatid]
-	event generate $win <<Paste>>
-}
-
-# ___________________________
-set iconTable(icon,copy) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAB3RJTUUH1gIFCQUziNtYHAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAAB1UExURfHv4nN7pXN7rXt7rcbW/87W/73W/73O/7XO/3uErcbn/6XW/5zO/73G/3uEtXuMta3W/4SUxs7n/9bv/4Sczt7v/4SUvef3//////f//+/3/87e/4Sl1nOEtYyl3oyt3oSt3tbn/4y174y15/f39+/395S955vnmCkAAAABdFJOUwBA5thmAAAAjElEQVR42k2M6xqCIBBEQaGUtQyBuCRpab3/I+bCJ3b+zdmZJWSZkUgKi3Pr+onfIibvnAsxls4Ythxe70NYa6f575E2AE+c+RBHFFIphTMfbH50HwC0xWwel2oTvRBCm0wSVwEgFSSSaDnncsgkUVNKe3HDQpcESbNMEa3Ae3c0asYZO52bZhd0pyI/IQgMa2EAg3cAAAAASUVORK5CYII=
-}
-
-set iconTable(text,copy) [::msgcat::mc "Copy"]
-
-proc button_copy {chatid} {
-	set win [chat::input_win $chatid]
-	event generate $win <<Copy>>
-}
-
-# ___________________________
-set iconTable(icon,smile) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf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5ErkJggg==
-}
-
-set iconTable(text,smile) [::msgcat::mc "Choise smile"]
-
-proc button_smile {chatid} {
-	set way ::plugins::emoticons
-	if {[info exist ${way}::options(show_emoticons)] && [set ${way}::options(show_emoticons)] && \
-		[info exist ${way}::options(theme)] && [string length [set ${way}::options(theme)]] > 0} {
-			event generate [chat::input_win $chatid] <<EmoticonsMenu>>
-	} 
-}
-
-# ___________________________
-set iconTable(icon,add_user) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArBJREFUeNqkk21IU2EUx//P3av3bm7OdL4tMi0VSispx7IGvZB+MAj8EBREfsjQInv5INi3DP1QEBi9WBgkQWGQEaRERIKaX8LUzLSsrDFXNLc5t927u3tv904YpVBCB855ngPn+T3nf3geIkkS/sfUSjhWmhpPZBRREbLTloI2My2s5wQJ/ggV/BhQtfiiYpskirxcgt63c38CknWLiVy/IZ3hb1oYvoAlBBq1FgwkXQrLNbOg/SYj3bG04zhgjSG62IEolCalriowZuUgwvGYmpwCxwsIhaJJudnWSod9SwfHcssBNM3Hk1CQY9NLq7CrqgpB1zjI8z6otVrwWguEmT4UZOoQjZLlgC5NA2Ly1mZ47dtn0/F6JlkjmCw4UF0NFWMBYgu4deWd++JwGTRiCHeXAvqC5QClBsNZv1u7H3jOmAy2tEIHFL3c/E903+/g26e3fpoQzaBE7XIATYWVEZoDbNpxYfuNjK9cLwbv3Qal1UNPGxEua1O7Bt4fStHOvZAgjv0ugSi3mCq69DxHtdRUlpw6UptPemZjmPVGEQsTCCzBWqkHXtdjhDk/5kPzoUDI2/q0ZaRZAVBKcFommk7v8Dc4K1aTh5OAy6OSZdOIhpMgerohRp9gj3Mb6g7Wo8xexCRbpQv2E1mXEoDrxZ3na+1eDLwag38BYOV3EvFLcRfnOrGpsAQCJaAkcy8EwsO+0aEcq08Awkzem+nREXwZnoHk56BLJdCZCZg0Al9wFhpiwP6ik3HNZ3e3Iy+9WNnqE0MULPmHdZFvTiHyI//lo6GazGy9SZQ0yoAQi/gw7h7EiLsfjXvvoPXZUehV8afLJob4N5O1NufkmpocxeVYl7EZHzzDGBzth+tz4PLQVfc5spLfKENa5aVOdqPsQdmvyYcbV9TBv+yXAAMAvmshRLn6akUAAAAASUVORK5CYII=
-}
-
-set iconTable(text,add_user) [::msgcat::mc "Add new user..."]
-
-proc button_add_user {chatid} {
-	eval [list message::send_subscribe_dialog {}]
-}
-
-# ___________________________
-set iconTable(icon,change_nick) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABF1BMVEX////ap0nami/QlCjGhyLv75bkyG/QjSjQmkLv6Hzv4pbaoTzGgDzv21Xv4mnv4omdZhzGgCjv4lzv20/ktE+nZhzGlDzv20namjydZiLv6ILarknQoUnGjS/7yJ7y0LLy0KjqyKjqyJ7qt3/qrnXZrn/Qt57QrpPQnWvQeyPInXXIeyPIcy3IcyPAv7y3t7Kmpqimpp6mc0Kee1aec0yeakKWlZOWYi2WWSONjImNYjiNWS2FhImFhH+FUSOFSA98e398e3V8USN8SCN8SBl8QA90c3V0UTh0SC10QA9ramtrYmBrQBljWVZjUUxjNw9bYmBbWWBbWVZbQBlbNxlSWVZSUVZSNw9KUUxKSExKSEI5QDg5NzilcsfAAAAAAXRSTlMAQObYZgAAALlJREFUGJVjYMAKfF1dPf39EHxvZ3N7c89gX7iAu4WnnaedTzhcwN/DxMrfKQQh4KKmpKSlqu4CF7BWVFRQUFQ0hwtEm8rJyysYxUC5jEzMZkHGxpFmEZFgPgsrG7tZkIFBmE0AWICDk4uTlTtIXy80MsghACjAw8vHx88UGBkZFhDgpazLwCAgKCQsJMLsFeHmZRumrANUIiooJs4rwRRmaxsZpakBsUdSTEo6KioqBu4OBkkZWRgTAKgwHTUVe3Y/AAAAAElFTkSuQmCC
-}
-
-set iconTable(text,change_nick) [::msgcat::mc "Change nick"]
-
-proc button_change_nick {chatid} {
-	if {![chat::is_groupchat $chatid]} {
-		return
-	}
-	
-	if {[winfo exist .change_nick]} {
-	focus .change_nick
-	return
-	}
-	
-	toplevel .change_nick
-	wm title .change_nick [::msgcat::mc "Change nick"]
-	pack [label .change_nick.lab -text [::msgcat::mc "Change nick"]]
-	pack [entry .change_nick.nick]
-	pack [button .change_nick.ok -text OK -command \
-		[list [namespace current]::button_change_nick:new_nick $chatid]] \
-	[button .change_nick.cancel -text Cancel -command \
-	[list destroy .change_nick]] \
-		-side left -fill x -padx 3 -pady 3 -expand 1
-	focus .change_nick.nick
-}
-
-proc button_change_nick:new_nick {chatid} {
-	muc::change_nick $chatid [.change_nick.nick get]
-	destroy .change_nick
-}
-# ___________________________
-set iconTable(icon,disco) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjUlEQVR4nMWTS2sTYRSGn5nMZCadNJeJ1tqLLWmsloJKa6GCRcGFLqyle7Eg4sJf4NadP0MXLgQX4l4Qu9GNije0WtokdYxJ08nkMvPNTC5urFjr3gNnc3jfh8O5wP8O6e/C2StXY+bY8duhlro2PJge9z2X128+Ui+XKofM+CNdCu6uPr5f2NVH/jQPTUxlJhcuPzk6O7+Sm5tPLcyfpJcexY8YlL6Xjc/v3s1Jemwpk0o+t0vF0j7A3OLKg8GZ85cWzp9hYsTENDRqkTghGvWGoCU8Ko1aWo9q56Jd8cBr1oW8ax6bPn1haHpmeTibZTwd5ZAEXR/MPhlJVUlnTNIDh5GjBhU3nEqMTt4C+A04kDtxPZZIMprWaXfBlaABOKKHaHm0HIe+wQHU7DECWcUnugig7AI6famTOw0X23Z4GUp09DiyLFH6UcMqFPGEwHMcgq0CiBaSkcruAbSaDfVLvogiazhdnYSZQY5INOwa1sYG3dCj30yTKetUu21kRVX2AILv+fVyvT1pWzaxeIpYIomiqgRCIJp1cpNHiGgR1GCMcOcbPa9u7ZmBb1sP5VqZsFkl2a9BKKiVK/gtl6iikEka9PfaSE6VmARK21vds8bAddYGRiaWXdc/eGr2BFNTOQzDQIqoKKpGrbJN/tN7Wj8KGJrqlNde3fDdZvU3oNPptKW2+8IcGl9qOk68X1c4fDCB6/k49ja2tYFtbZKM68IpfLhZKa4/23dIolUv9bzaWlSPzXbanUx+I49V2EQ4FeTQRZeCkr359o719cM9oPevX0gCR2RZnjkwkr2oJQdyUkQxZHq+37CL1a2vTwNfvAQ2gTLQ2/dMv7rSf2UfoAIdwAU8wAfCXfFPffsXfMRKZIsAAAAASUVORK5CYII=
-}
-
-set iconTable(text,disco) [::msgcat::mc "Disco"]
-
-proc button_disco {chatid} {
-	eval [list disco::browser::open_win "" ""]
-}
-# ___________________________
-set iconTable(icon,join_conference) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALcSURBVDjLjZJpSNNxHMb/VhTUi3pjVFoyj+wyPDG1sDUTE7ES1zCPuXRbZjZrSk63qVPzKNuc+ncmHmPOeU3nkYkEmnjhlVdaBPoiddGbMDEoj6clZEYlvnhe/fh8+P4eHgIAsVWE/kdY4wVWC7NqE0yXUZZLeebFvs7mu3+9bwnzvE1pMyrK6lzFYWxOYaSFbFuCYqaxfK7OEfOtbHzty8a81g1zmqOYKLD4vC0B6b8/Wz/SioVuEssjSiz2kJh93YL2FLuZbQn8vG9wJssfrH0ZrcXqVB2WJnTQd8ghCbmo/aeAQ7Vi5bMuLciDqSBDacsRDJtB+cPI73otHx8akqFvFKFLcRdn2adbnGLP7PtDwHSzpOWzPFZlgVRsTomUh9zCVGTmiZD4JBYNb8qR1i6Bjdi6zJZ/fO+GQMqw73oWcQ11SWGYrBBCzadDHkyDguuB0hEhotSuYJfaIX0gGjVvixGti4JLhBO5IchjWNS8b9f8VZgmngrpcBzClY5IbroJhuIE4nq5YJGhmCZ9/18YT30B91TnwFU6gFVsC2E9HdUDOYipuYrL0kMIkDIwX+TzW7DDIUeQJ4jaKCxS5QzdMAntUN46WDkgg+xlDJS9Wbit9oRT+p61riIf9jps5FYZ7scfWuz4CDyq1kJUokGY4b8/4adtPGS2RiKthYOkJhYkz7lQdKYgqOw8rBKJFYLiraDTec1LjVOrSJ0E2P1ASAcQWHQSVf0yqA0LVPZkoaQ7wyC5g4JOCThqL1BExCcTAWFLjKU6rgzW5oJfrwezFWDq1hCoWcP1AnNcyTEFTXoQbo8PIKTUFeSrJNxSecJMROgPC4hT6zuYyXGfr027jwBxHzhtAOuF4QIdENwIBDUDjIxpiPnpsE/dBaaSBrMEYtYAW28s8Z2K69Ii8Yt3ppfrHKMHQBWPGTIOqnAU7vFDsPCqmsmNCU+yFBt9O5awE8YCgrJ5vT8AXgaV02he+4MAAAAASUVORK5CYII=
-}
-
-set iconTable(text,join_conference) [::msgcat::mc "Join conference"]
-
-proc button_join_conference {chatid} {
-	join_group_dialog ""
-}
-
-# ___________________________
-set iconTable(icon,juick_cmds) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAGtJREFUOMtjYKAl2J/DcGV/DsMOfGpYCJjRwsDA8IFhwMD+HIYT+3MYllHiBXMGBgZxfAqYiHAII6UGMIwawPCfLAP25zAIQJl/SE4H+3MYVjAwMBhDuY/IcQEXAwODHAMDw10GBoZKmiZ3AOklESKhVPrCAAAAAElFTkSuQmCC
-}
-
-set iconTable(text,juick_cmds) [::msgcat::mc "Juick commands"]
-
-proc button_juick_cmds {chatid} {
-	set jid [chat::get_jid $chatid]
-	if {![string equal $jid "juick at juick.com/Juick"]} {
-	return
-	}
-	
-	set m .juick_cmds_popup
-	
-    if [winfo exists $m] {
-	destroy $m
-    }
-	
-    set m [menu $m -tearoff 0]
-	
-	$m add command -label [::msgcat::mc "Show last messages from your feed"] \
-	-command [list [namespace current]::juick_add $chatid {#} 1]
-	$m add command -label [::msgcat::mc "Show last messages from public timeline"] \
-	-command [list [namespace current]::juick_add $chatid {#+} 1]
-	$m add command -label [::msgcat::mc "Show recomendations and popular personal blogs"] \
-	-command [list [namespace current]::juick_add $chatid {@} 1]
-	$m add command -label [::msgcat::mc "Show your tags"] \
-	-command [list [namespace current]::juick_add $chatid {*} 1]
-	$m add command -label [::msgcat::mc "Show last 10 messages with tag"] \
-	-command [list [namespace current]::juick_add $chatid {*tag}]
-	$m add command -label [::msgcat::mc "Show user's info"] \
-	-command [list [namespace current]::juick_add $chatid {@username}]
-	$m add command -label [::msgcat::mc "Show user's info and last 10 messages"] \
-	-command [list [namespace current]::juick_add $chatid {@username+}]
-	$m add command -label [::msgcat::mc "Search posts"] \
-	-command [list [namespace current]::juick_add $chatid {? blah}]
-	$m add command -label [::msgcat::mc "Delete last message"] \
-	-command [list [namespace current]::juick_add $chatid {D L} 1]
-	$m add command -label [::msgcat::mc "Show your subscriptions"] \
-	-command [list [namespace current]::juick_add $chatid {S} 1]
-	$m add command -label [::msgcat::mc "Subscribe to message replies"] \
-	-command [list [namespace current]::juick_add $chatid {S #1234}]
-	$m add command -label [::msgcat::mc "Show your blacklist"] \
-	-command [list [namespace current]::juick_add $chatid {BL} 1]
-	$m add command -label [::msgcat::mc "Show your \"white list\""] \
-	-command [list [namespace current]::juick_add $chatid {WL} 1]
-	$m add command -label [::msgcat::mc "Send invite to jabber user"] \
-	-command [list [namespace current]::juick_add $chatid {INVITE user1 at example.org}]
-	$m add command -label [::msgcat::mc "PING"] \
-	-command [list [namespace current]::juick_add $chatid {PING} 1]
-	$m add command -label [::msgcat::mc "Help"] \
-	-command [list [namespace current]::juick_add $chatid {HELP} 1]
-	
-	tk_popup $m [winfo pointerx .] [winfo pointery .]
-}	
-
-proc juick_add {chatid text {send 0}} {
-	set cw [chat::winid $chatid]
-	set iw [chat::input_win $chatid]
-	$iw delete 1.0 end
-	$iw insert end $text
-	if {$send} {chat::send_message $cw $chatid chat}
-}
-
-# ___________________________
-set iconTable(icon,notes) {
-iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCA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/lxnOinLlUfvo/evz5S1fatgYBmsTsRRO7UUVRyHAsjQJaLIjIoYiAax58RDtP3Afwc+jjWG3FzigwAAAABJRU5ErkJggg==
-}
-
-set iconTable(text,notes) [::msgcat::mc "Edit notes"]
-
-proc button_notes {chatid} {
-	variable notes
-	
-	custom::defvar notes($chatid) {} {} \
-	-type string -group Hidden
-	
-	if {[winfo exist .notes]} return
-	
-	toplevel .notes
-	
-	foreach {option value} [wm attributes .notes] {
-		if {[string equal $option "-topmost"]} {
-		wm attributes .notes -topmost 1
-		}
-	}
-	
-	wm title .notes [::msgcat::mc "Edit notes"]
-	
-	text .notes.win -font $::default_Roster_font \
-		-yscrollcommand [list .notes.scroll set] \
-		-wrap word
-	scrollbar .notes.scroll -orient vertical \
-		-command [list .notes.win yview]
-	button .notes.ok -text [::msgcat::mc "Save"] \
-		-command [list [namespace current]::save_notes $chatid]
-	button .notes.cancel -text [::msgcat::mc "Cancel"] \
-		-command {destroy .notes}
-	
-	pack .notes.win -fill both -expand 1
-	pack .notes.scroll -fill y -side right -in .notes.win
-	
-	pack .notes.cancel .notes.ok -padx 3 \
-	-pady 3 -side right
-	
-	.notes.win insert end $notes($chatid)
-	
-	wm geometry .notes 350x350
-}
-
-proc save_notes {chatid} {
-	variable notes
-	set notes($chatid) [.notes.win get 1.0 "end - 1 chars"]
-	destroy .notes
-}
-
-# Toolbar icon 
-set iconTable(toolbar) {
-iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1FB9ELCQ0KFPeDtBUAAAPpSURBVHjarZZtaFtlFMd/SbM2tdO4ZhWpNe3eqCvYri1MiJR1rU6lzpFhQfSLU9xAhckgK2N2iizqENnqy2C6bnYwB841DOxgXW03lXQljV0ohaotsQ0L2CZp0qZLlyb38YPPLbchffnggYd7uc+5//+55/zPeW4Wy5sAPpTXWSDA/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DCR/YAAAAJcEhZcwAACvAAAArwAUKsNJgAAAAEZ0FNQQAAsY8L/GEFAAAB2UlEQVR42sVSTWgTQRh9O7Ozu9ndkJaUgBWz/hyCICJ481Lw1FL8A6nQQz36d/HmyaN468VTQfEgIgitiD0IRSylFUSkVmgsVqXWDS0Ymy5pYprdmXEiFtsyB3PywTDw8d7jfW8G+N8wtNOTj+u2w8wk5iAGF8Kggm/UJWaGvN1UU6fff7g7NXTuCN5+2cBqlCBcr6E8+x5cw9UamCrX8vefKIY1QEowKWBS/LuBxRg6HIaMY0IoccwF1ijRbqtPwChch8JXh4MibgpYKlZdw/1je5vg/GcPvXO/SzIIgWsSeCqBb5lwbQpjq+5T4x4uTCreMPlrMHiGwSo9Cwqb1WM33ohCPoOUZcC3TXW3zAxkcx3oHBwX6RSq2Gw8Qc8BuvMZL5UyaVmaunnx+FEqY5SjBlaiGE0uEScS3CBYCz9g+l1jNqkEPXhRqG5bQWFkb1St7eu/9WDuWyIIVO/wUwxpx0LaZRDlj3hV5EuJLPRviXcatPBwTxgl+b47Txcr3V0uOj0bGd8GqSziZVH+aNoH+zAarGhK3Ia7XfNhlD17b+JrI59zQNc/4fk8r0f00GncDxZ20/VfuYWr5YET2YVHnNjy9WowgJHcGNrG5eXruLJ0rX1hG/gFsY6kWq0OsmEAAAAASUVORK5CYII=
+# Icons table
+
+variable iconTable
+
+# index of iconTable array.
+
+set iconTable(id_list) [list disco copy paste smile configure_room custom_presence vcard change_nick history join_conference add_user rejoin clear topic juick_cmds notes]
+
+# REJOIN ID ___________________________
+
+set iconTable(icon,rejoin) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAACH0lEQVR42pSTwUsUUBDGf2/dXXW1cMXEZCvKpQiCIKJLsNilP0G8CCor3oT6Dzx69SilaZ66eO/oQeoUUZbQwT0EdjE1w9335s28DpurUkEODHP6vpn55huXUuK8sfl8Zs5Mn6rGw+x5gJ+Xnnwx03L+0gDbtU16M/nYIpidnU1mxnGqaqtO3klkMPJ9A3RfL2NqpO0PiHhaBKpKqVQCwDl3pqb0keL9h4DD/9xFxZOSIRLJVOYdlXmHqgKw2pgmkXDOtVJVMVUa+1+RowNMAskUEU/m9ATHHVfr02cIYgyYChoDFgMWPcmMEBpkgQSwMTjHRh0e3X1Md+dFlt9Umbiw2CSPgRQjJgGNAZIjmRGl0ZxgoHiZ8uAt7pUftBQfqYyxdDiJcw753VnFk6ROf7FGSpEQTq3wtxipjLH4YwKRgMaIBk9X5x69Pbvk2urI8QT/ilfrL6n2LCPSwKJHxbP/vY1arQ8fcidn/La3A3s7QFOD02DnHCF4LAomHhVh12fBDJFAFnAAQ+/G0/DwMM/fjwMwVVxpeSFKo6lBFDR6nMtiZsQYTowUY2ydsdrz4oyZgvgmWDwmAeeMlJoEmfWZxPpMahFMFVfIZNrO+ECkuUKheIVC7zVyhSKkhGoku7CwkLa2togxsra29scfmBmjN4749PY17R1d5DsK5PLtpGSYKe5/3vlZ9Wq/ahxSlduq8aaZljLZ/KiKP/g1AM5qbQlMGLUUAAAAAElFTkSuQmCC
+}
+
+set iconTable(text,rejoin) [::msgcat::mc "Rejoin room"]
+
+proc button_rejoin {chatid} {
+	set jid [chat::get_jid $chatid]
+	set xlib [chat::get_xlib $chatid]
+
+	if {![chat::is_groupchat $chatid]} {
+		return
+    }
+	
+	if {[catch {get_our_groupchat_nick $chatid} nick]} {
+		set nick [get_group_nick $xlib $jid]
+	}
+	
+	set password ""	
+	if {[info exist ::muc::muc_password($chatid)]} {
+		set password $::muc::muc_password($chatid)
+	}
+	
+	muc::leave_group $chatid ""
+	muc::join_group $xlib $jid $nick $password
+}
+
+# VCARD ID ___________________________
+
+set iconTable(icon,vcard) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAV5JREFUeNrEky9Pw0AYxp+DpQkJHQhS1oSiSZgppprP0BrIpklRq+BDoOqYwHXVzKBQJFUNogM8AjNL2DL6v9zdsobRQTImeM1d7p7nd+977x0pigKrxBpWjJrjOFd0NP/o79ayLDPb7TaWLYUQgl6vZ9bSNEUYhhiNRksBRFEE83JAFEUc8DbJcX3/jjgtcHZcx464/iNAEIQpIEkS0DIQxzHunkP4LxEX3A7GONU2+NzzvApA13Uw7xzgYJeS6aFpDhw2wNdYaJpWATBPCcjznIsbm4C8RfCRAPvbDJpxse/7FYBhGFMAMzLa4DWG80AwnlaAi36Ck6MC6h6gqurCDJi3LKH/hNLMYkKzv3mkpUgxgiAoWzcLRVHm7+DSqM+dMBwO+Ui30Ww2Icvy4jtgrWBk13XLzVarBUmSKml/1ZimydtIOp3O7Cl3bds+tyzrt6f9XdMl//4bPwUYANB+yxQGS9MJAAAAAElFTkSuQmCC
+}
+
+set iconTable(text,vcard) [::msgcat::mc "Vcard info"]
+
+proc button_vcard {chatid} {
+	set xlib [chat::get_xlib $chatid]
+	set jid [chat::get_jid $chatid]
+	::userinfo::open $xlib [::xmpp::jid::stripResource $jid]
+}
+
+
+# ___________________________
+set iconTable(icon,history) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAG3SURBVHjapFPBSgJRFD3WLALbjDomiBYWVESLmIqMkSyiTVCbFn1BLfydXNQPFLRuE5IIUhBMrSQhkjAEzanZ5EIdtXffzDgOZBuF49z7zjuHM/fN8/R6PYzyE04vVHqmZFk+Zk/FWs8zXDGkrT7F4OJVVeW8wP6ykiQlD+aB0KTJVn+gvH1DKdRxRv2SBMz63Hy5LCn1ev1ojPXJaDSKoBe4zqjIqCVUPnXEI8BuzBRQTWvE0R7aSxrSCp1OBwSjO47Dbbn/bkYXrnp5WgQIVm/rBMMw0G63ucFNToUoihyLEdFl8PKhQ9dN7G/JpoZpBSo4uhPYSzgJ2gMJqJ4LM8Ow2O9tHTdotVowOsDdvZNgJjSQgHHvVSfBzqbMNdyAilazyV0TG8MThIMih92ThrQ8QZMSsMWHRyfBVMA9g5rmJIivy1zjJLAM1laHn4LfJ3LYva3rD7H7zxf9F+caIuEy94rKV4OTYb8XC+wYV2IB3j+XNBTZMQ7yfQM6y1qthmJRR6Nhbih6vXhic7gNmAaapvF3H+RpTqT1yCfnWbZWsC5P3kqoWJcnZfXpIfySZ9Tr/CvAAFL4JRqBf1s8AAAAAElFTkSuQmCC
+}
+
+set iconTable(text,history) [::msgcat::mc "Chat history"]
+
+proc button_history {chatid} {
+	set jid [chat::get_jid $chatid]
+	logger::show_log [::xmpp::jid::stripResource $jid]
+}
+
+# ___________________________
+set iconTable(icon,configure_room) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOxSURBVHjaYuzpWcQgLS3OwMDwX5Cdne2EpqaS9L9/f/+/ffvxxbNnryZ+/vx9/u/ff74yMjLAwY8fvxlMTbUYrKz0GAACiOnHj18MDx48Zfj589eXb99+zvv+/TuXpqYij42NgYqJidZkFhbmXqDhrIxAE0CGwDAMAAQAQQC+/wNERFAF9/f4/vHx8/4HBwXF3Nzl7/39/DwbGxUHExMQAAICADTW1t/W+Pj61Pn5/AD7+/sA8vL1ABcXEgAjIxwAAogJaMhyoJmmnz9/Zbh69Q7D06cvJp05c+3khw+fwTbIyUkx8PBwev748YP5169fDN++/2RgY2NjkJISA8sDBBCTjIx4sKys+Mpfv37r/v37l4GDg73a2trQhpeXG+it32BFQG/Ivv/0k/vr1+8Mnz5+YeDl5WTQ0VECywEEEAsbG/M3V1dbRWCgrXjx4s1BZ2ezTHV1BYaPH78CNbIwvHv3geHxs/fPhf7c/OTMu4vhE9AFHF+1gVrDwQYABBDLzZsPH1hZ6Wt5e9tqvX79TktFRZbh/fuPQKl/wMBiZnj9+j3Dl2//xD059+oIM3248o/xDwMbw2d4IAIEELOYmOaf//8ZfDU05BlERAQYvn37xfDv339gYP1lePToBcOHLwwM8px3lCQYj/v+/fXvz/fv/08xcgkxyNoms4KCACAAAEEAvv8DKCg5zdjY3v3q6u86//8ABPb2+ADq6u0A9/f4AAYJEAAD7MYAGeWRABn45Q8AEQdJ8/YG9PLp6cfx6Nj/AQQJ/wKIMTS0lOHLly9ADT+9OTk57Hl5uTS+fv35QkhM0jDMQcBE5tUkBqnf9xhEgNZ942RleMTI++fubebir19/TPr87S8DQACxgPzByMjEwMrKshUYyls/ffrG+Y+R6bvYv73m/y/e3Kak9VGIl50L7F/u/wwMykw/WP7+5+y7cpWNgY2dYRJAADFra1uDE8e/f/8YgF5g+M/I9keC8wNDkOzpp18+//vGxsPmKqHGyszAz87AAKSY//5nEOX6xfSPidnj+WvGlwABxMKAA/xnYGT49ZdpypEzDGy//jP0mLqxMjK8+8HA8OALA+Of/wy6wr8ZHwtyNwIEEE4DwFHEzMAATFt9+44w/Pn5/UefjepfZgYOYOJ9/5uBCZjIuJn+CgEEEF4DYIYAvTZp1xEGhp/P/vc5W7EwM7D/Z3j/koHhyiPmSwABRNAAcHoHWvqPEWjILU6Gey9/1AnxMLDfe89+/e0PphyAAAMA72F4qGAYYSYAAAAASUVORK5CYII=
+}
+
+set iconTable(text,configure_room) [::msgcat::mc "Configure room"]
+
+proc button_configure_room {chatid} {
+	muc::request_config $chatid
+}
+
+# ___________________________
+set iconTable(icon,topic) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUlJREFUeNqMUztOw0AQ3bUXSIPwEQxNSiLRpCMSEqIC03ECJLpwgtg3MAUFVDkCuI9IOiiQ0lIBN1hait28DbNoZO1aGen5M96ZefNmLAXs9PKmstbeGmN2Rdg0UM6axzvmS4Ct9OT8eoJghx0Rtx5wdtA/0p8f72/kk0CqcBmTY+6qRBLUwIC+cxZWgoGllxEoLkLROHNMBZxlOPfjGSRiM1uy5wFnkJBAzkpXCdhrR1PFtjnmxrUw6ej9i2n0RPcCmKKDetY8VClUXUBdT63XSpABV8CQnl3CV/KN9vvDtRAhwXxw2eq5ID2mLoEVSodEnBM0a81VLqDFM/D955fCiO1MxWRnI5WxM1amYtMx8hYPPTNpjVYdBy/YFuahKUrxW6vI6PJ44P/PVb8091UowZhmnrMtLNnCLfliyQ76nsFa/VirKwEGAPl8ceh31ThgAAAAAElFTkSuQmCC
+}
+
+set iconTable(text,topic) [::msgcat::mc "Change subject"]
+
+proc button_topic {chatid} {
+	if {![chat::is_groupchat $chatid]} {
+	return
+	}
+	
+	set node [::xmpp::jid::node [chat::get_jid $chatid]]
+	
+	if {[winfo exist [set w ._subject_[ifacetk::nbpage $node]]]} {
+	return
+	}
+
+	add_win $w -title [::msgcat::mc "Change subject"] \
+	    -tabtitle [::msgcat::mc "%s subject" $node] \
+	    -raisecmd [list focus $w]
+		
+	set scw [ScrolledWindow $w.sw]
+	set text [text $w.subject -wrap word]
+		
+	$scw setwidget $text
+		
+	set btn [button $w.apply \
+		-text [::msgcat::mc "Save subject"] \
+		-command [list [namespace current]::button_topic:send_new_subject $chatid $text $w]]
+		
+	set sw [chat::winid $chatid].status.subject
+	$text insert end [$sw get]
+	
+	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} {
+    set chatwin [chat::winid $chatid]
+    set xlib [chat::get_xlib $chatid]
+    set jid [chat::get_jid $chatid]
+	set subject [$text get 1.0 "end - 1 chars"]
+
+    message::send_msg $xlib $jid -type groupchat -subject $subject
+	destroy_win $w
+}
+
+# ___________________________
+set iconTable(icon,clear) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArJJREFUeNqkk11Ik1EYx//Hzc85dc2crulc05k5dDmbmFo5i6ZLiiiEiC5KyIu6iC4CkYrwopsCoW+yiwIJNCPcUDPQojTSyaJUyo9YmSU6v7Z0c+/2dg4uCEIKfOH3PofnPM9z/uec5xCe57GeT3izKgSsBKvDIGR1gtnTDTz26wnMuatzAYpnmEeYECZ/AHU+H2pD/mORApp3j0HHO2kh05IHdTvKDundy6gT/iM5zWLjs+vvXDnJJFhu1Eh/LiPZYNylb3rQYuP8ayuIo/FnqN07Ojp2u+1NNLxTUyivunhQrCWTjx+9sE3MoDYQQDtTEEqJpcRTkmiiIUIUm5eaU6gbrMxWWa0WlJaa0NbhRYlyBPuOnatY4a5a+QA87EyE9HchQiTZHi6KEUWKpeKNyekyiUwR73OtCF0TTpQZotBieQKj0QxrxxJKVWMwHjhh7mi+v0AX6w6hMjrdC3PeDEN5kVytz/HMBxLHe4eFruk5RCkkmB36iopcFyyWJhQXm9E6mIRFxyI4DoQCgSmHOHps/HxPV1+miIdcFBsNWboCAnpX3+3jkKgTwbk9yIxbQuNzOzSafFSevdxYmIYGuo3Pv2+hPVdLlp3OgfNbCrRlIwNDEPICpGSnwT0zD97jR5wyAcezFmCormym8beo/FesZQSsYxbdgFpOHPYh3tn3+l1mfqFOvmlrKiaHHeC8HGIUUsx9nETT04cv9cm41v+FdKdsAN5/ow33+95UCQRKuociLSmhXVaj0RTsCdADUusyME2T27s6e6n/0qwHz1o/EKz5BJRSgt0qmI5kob/t+mH+7qk8/qgOb42bYZKJ/45nClgziSgxFBYSyXw6ObZlSFHNFvo0g3r7D3RR/wrFS/EFx34SLBJGCQ/a0KCPaQwE8VO4oP0Tnqz3Of8SYAAnOhsd7tLKFAAAAABJRU5ErkJggg==
+}
+
+set iconTable(text,clear) [::msgcat::mc "Clear chat window"]
+
+proc button_clear {chatid} {
+	plugins::clear::clear_chat_win $chatid
+}
+
+# ___________________________
+set iconTable(icon,custom_presence) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAflJREFUeNpi/P//PwM6aFkdpQikMoE4HIiZgXg9EE+vCV12DV0tI7oBdUuC5ZiYmB+aqzkxqEjqMDAyMjLcf3mD4fiN3Qx//v7Wa4pZexlZPRO6id+/fc/Uk7NkEOUTZHj8+hzDw1dnGPi5OBmMFO3AcujqWdAFvn7+ksDJzsxw+9lZuNirD08ZhHhlwXJAbhYhAxjuPr3E8J/xD4r4m4+vwXLEuGDBrfu3KgSFuVHEP777ApJbTIwB0+/evFchJMHLwCPACQxEoNjHHwxvnn9m+Pf373SCBpjZW5sBDTn+4ukzy3tXnjGAYklYTPS/qpb6SX4hQVD0XsAajZXz/PiBVLuChHqmvqIlg7SIIlzR////GJ68uc9w6f4Jhocvb4FckduetOkvigt+fP/ebqxul6mjZMDw9uMDhnN3LiFsAUJuTmEGS017BnZmzsxLd08wwGID7IKMbps0RSn1maY6lgxPXl9lwAfkxfQZDp7bw/Ds9YO4GaVHFoNd8P3rt0wVWQ2Gqw+OMBACl+4fYNBSMGC4++AaKFHBDdB9/PYqw5fv7xiIAf//XQPpMYCHATCJfnz86r4QExNR+hk+fPoE1gM3ABiA0x/dfVotLMXDwMjEiFfzv3//Gd49+wLWgxKN9tH8vdAszEnAAaD0PP3g0o9lIA5AgAEA1OPkeDeIXrEAAAAASUVORK5CYII=
+}
+
+set iconTable(text,custom_presence) [::msgcat::mc "Send custom presence"]
+
+proc button_custom_presence {chatid} {
+	set jid [::xmpp::jid::stripResource \
+		[chat::get_jid $chatid]]
+	set xlib [chat::get_xlib $chatid]
+	
+	set m .custom_presence_popup
+	
+    if [winfo exists $m] {
+		destroy $m
+    }
+	
+    set m [menu $m -tearoff 0]
+	
+    $m add command -label [::msgcat::mc "Available"] \
+			-command [list send_custom_presence $xlib $jid available]
+    $m add command -label [::msgcat::mc "Free to chat"] \
+		    -command [list send_custom_presence $xlib $jid chat]
+    $m add command -label [::msgcat::mc "Away"] \
+		    -command [list send_custom_presence $xlib $jid away]
+    $m add command -label [::msgcat::mc "Extended away"] \
+		    -command [list send_custom_presence $xlib $jid xa]
+    $m add command -label [::msgcat::mc "Do not disturb"] \
+		    -command [list send_custom_presence $xlib $jid dnd]
+
+		   
+	tk_popup $m [winfo pointerx .] [winfo pointery .]
+}
+
+# ___________________________
+set iconTable(icon,paste) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgpJREFUeNp8k7+L1EAUx79JZv21oqhwgoiFIgp6rXuCIIj/gCDYbSFskUOwkrOwWFgx2IiVQRcstpA7tLIRLARBOU44EKwEr7LwcsiBdxE3mZmM7002biaoD94mm/m+z3znzYxnjEE9RqPRI3qEk79xt9udx3/CW7w996fg58EOsr2n0Ov17OBwOMTO9DPamyuVPr4WLbvAZ7fOmV/rH21GUWTSNDVJktjkd/5WjbOWHddTaF0g/foO441POLpnNwaDgTPB2SMZvq/G2DUzC9Y2QyhVoKBUUuPCsW2bzVDSKzXqbwAqVFpDSgXUGvry23l82Dztqg88wKv+WxbFS/2LtheCC7UsIHMXsLxxEtGNOajCgJ2zfUXjBb3ff7oSXr3zBi/uXponADlQigDSAWgCZ1mKteQHcrKeKwNJsBOH92Hhegf3Hr8Pryy8hq9ybdefZ9JJBgYBsCPw0RKcHoTv4cv6FsbZNm52Z1kTCrauFAEaS7AAnwpbHgz8ydeyiWvJlnXCGmcJ9VMps5wAQIt+jC2cQjyaKyA3rLFNZAfsxAGMcytqBZWDKYQ2tQSQxm6jpibZbawF02kFELT2MqYQ/sLurAM+HLxFh453XMCqhO+VjYOYXBxbXNinIILtARXHz58Mw+YJk+2+Bczsb6OY7L+uzkTBk5aN9prXuYozlx/Wr/W/Iv4twAB6XV9giUsGiQAAAABJRU5ErkJggg==
+}
+
+set iconTable(text,paste) [::msgcat::mc "Paste"]
+
+proc button_paste {chatid} {
+	set win [chat::input_win $chatid]
+	event generate $win <<Paste>>
+}
+
+# ___________________________
+set iconTable(icon,copy) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAB3RJTUUH1gIFCQUziNtYHAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAAB1UExURfHv4nN7pXN7rXt7rcbW/87W/73W/73O/7XO/3uErcbn/6XW/5zO/73G/3uEtXuMta3W/4SUxs7n/9bv/4Sczt7v/4SUvef3//////f//+/3/87e/4Sl1nOEtYyl3oyt3oSt3tbn/4y174y15/f39+/395S955vnmCkAAAABdFJOUwBA5thmAAAAjElEQVR42k2M6xqCIBBEQaGUtQyBuCRpab3/I+bCJ3b+zdmZJWSZkUgKi3Pr+onfIibvnAsxls4Ythxe70NYa6f575E2AE+c+RBHFFIphTMfbH50HwC0xWwel2oTvRBCm0wSVwEgFSSSaDnncsgkUVNKe3HDQpcESbNMEa3Ae3c0asYZO52bZhd0pyI/IQgMa2EAg3cAAAAASUVORK5CYII=
+}
+
+set iconTable(text,copy) [::msgcat::mc "Copy"]
+
+proc button_copy {chatid} {
+	set win [chat::input_win $chatid]
+	event generate $win <<Copy>>
+}
+
+# ___________________________
+set iconTable(icon,smile) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAwNJREFUOI1tk99vU2UYxz/ve87p2rVr67DtbFcGCGqIxV+RoOECo9GoV/y4wgWWGBMvtzv8J9RLEyDIjBcqw5AQE5cQTYgzukQSgZlNYGtLRwft2rU9tD3nvO/rBT+C6PfqeZLP8716PoLH0pjfibSjUjgjeRlKj4GFCWpF7VXLiRfn9OO8/ehy+yfQXu0Da/C5KSe+Z5cV2e4gbFS/4getXy/X54qfaa/ydWof5sGNeDBULxCTduzUYPbwwYHkK0LQAePeQ8QQ2KP0W0vGLX36vfZqR0fepPOwoPIjSDvyXXzLxKHQYAqhN8AvgZ271x5UwMmDncVXSZqLn5zVfuNQ7m2MLP0AWnM4PPzaQSc0AP4a2p3n5IlZuo1f6DbmOHF8FuXOo/vL2FSJZif2a8U4gFQKiRWfisTzAv8ORrlUN9Kc+kZzbTXD9VsZvvxWc6uRBuVietcIJ3YIEcpOrpxH2lozaodiLwjTxRgFQvLU2E6mjm3imUIOIWDyWJbc1hF0ewmwEKqJE91R6HdW82LpLHuTqc0XE5ldQAAyhJAOhFIQNACJCGUxQRfEIMZvoToLtNf/Mhvr9X22VggduASdBdzeAInhJNpKIvprIGxAo91FTLAOXoVW0yUa9jFGohXYSlH0PO2jW46w81y9tMDzhTBaPnG/ADAKSze4unCX3LanEdZNPF8FSlGUWnPTbXt/IiPEIi7V3rvMnOmzsrhCp36DTv0GK0vLzMz0WO2+x1C0C1YEt92/ojVlAXBpmvF0Pj89nAoLYru58HOYi+dn0SoAQFoWe99/h7fe6EPnd9ZrPXO7VJp46QjTAuCP0wikc2bzs9sPDCXCyKECrthNebkFQH5LnCjz6M5l2s2eKS/+fc5o/8DLRzEPX3n+JDFhOaczW7ftT49mhBUKI5wkCIHxmii/x53ymqkuXz9nlH/k1Q9p/8sFgN+OI7RhPBSJT8af3FSIxBM2CHrtZrBRq1/x7rY+F4Kv9nz0PzI9mrkvkAbyGMbuU0UB5dc/5j86/wMWOFy7mPTPEgAAAABJRU5ErkJggg==
+}
+
+set iconTable(text,smile) [::msgcat::mc "Choise smile"]
+
+proc button_smile {chatid} {
+	set way ::plugins::emoticons
+	if {[info exist ${way}::options(show_emoticons)] && [set ${way}::options(show_emoticons)] && \
+		[info exist ${way}::options(theme)] && [string length [set ${way}::options(theme)]] > 0} {
+			event generate [chat::input_win $chatid] <<EmoticonsMenu>>
+	} 
+}
+
+# ___________________________
+set iconTable(icon,add_user) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArBJREFUeNqkk21IU2EUx//P3av3bm7OdL4tMi0VSispx7IGvZB+MAj8EBREfsjQInv5INi3DP1QEBi9WBgkQWGQEaRERIKaX8LUzLSsrDFXNLc5t927u3tv904YpVBCB855ngPn+T3nf3geIkkS/sfUSjhWmhpPZBRREbLTloI2My2s5wQJ/ggV/BhQtfiiYpskirxcgt63c38CknWLiVy/IZ3hb1oYvoAlBBq1FgwkXQrLNbOg/SYj3bG04zhgjSG62IEolCalriowZuUgwvGYmpwCxwsIhaJJudnWSod9SwfHcssBNM3Hk1CQY9NLq7CrqgpB1zjI8z6otVrwWguEmT4UZOoQjZLlgC5NA2Ly1mZ47dtn0/F6JlkjmCw4UF0NFWMBYgu4deWd++JwGTRiCHeXAvqC5QClBsNZv1u7H3jOmAy2tEIHFL3c/E903+/g26e3fpoQzaBE7XIATYWVEZoDbNpxYfuNjK9cLwbv3Qal1UNPGxEua1O7Bt4fStHOvZAgjv0ugSi3mCq69DxHtdRUlpw6UptPemZjmPVGEQsTCCzBWqkHXtdjhDk/5kPzoUDI2/q0ZaRZAVBKcFommk7v8Dc4K1aTh5OAy6OSZdOIhpMgerohRp9gj3Mb6g7Wo8xexCRbpQv2E1mXEoDrxZ3na+1eDLwag38BYOV3EvFLcRfnOrGpsAQCJaAkcy8EwsO+0aEcq08Awkzem+nREXwZnoHk56BLJdCZCZg0Al9wFhpiwP6ik3HNZ3e3Iy+9WNnqE0MULPmHdZFvTiHyI//lo6GazGy9SZQ0yoAQi/gw7h7EiLsfjXvvoPXZUehV8afLJob4N5O1NufkmpocxeVYl7EZHzzDGBzth+tz4PLQVfc5spLfKENa5aVOdqPsQdmvyYcbV9TBv+yXAAMAvmshRLn6akUAAAAASUVORK5CYII=
+}
+
+set iconTable(text,add_user) [::msgcat::mc "Add new user..."]
+
+proc button_add_user {chatid} {
+	eval [list message::send_subscribe_dialog {}]
+}
+
+# ___________________________
+set iconTable(icon,change_nick) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABF1BMVEX////ap0nami/QlCjGhyLv75bkyG/QjSjQmkLv6Hzv4pbaoTzGgDzv21Xv4mnv4omdZhzGgCjv4lzv20/ktE+nZhzGlDzv20namjydZiLv6ILarknQoUnGjS/7yJ7y0LLy0KjqyKjqyJ7qt3/qrnXZrn/Qt57QrpPQnWvQeyPInXXIeyPIcy3IcyPAv7y3t7Kmpqimpp6mc0Kee1aec0yeakKWlZOWYi2WWSONjImNYjiNWS2FhImFhH+FUSOFSA98e398e3V8USN8SCN8SBl8QA90c3V0UTh0SC10QA9ramtrYmBrQBljWVZjUUxjNw9bYmBbWWBbWVZbQBlbNxlSWVZSUVZSNw9KUUxKSExKSEI5QDg5NzilcsfAAAAAAXRSTlMAQObYZgAAALlJREFUGJVjYMAKfF1dPf39EHxvZ3N7c89gX7iAu4WnnaedTzhcwN/DxMrfKQQh4KKmpKSlqu4CF7BWVFRQUFQ0hwtEm8rJyysYxUC5jEzMZkHGxpFmEZFgPgsrG7tZkIFBmE0AWICDk4uTlTtIXy80MsghACjAw8vHx88UGBkZFhDgpazLwCAgKCQsJMLsFeHmZRumrANUIiooJs4rwRRmaxsZpakBsUdSTEo6KioqBu4OBkkZWRgTAKgwHTUVe3Y/AAAAAElFTkSuQmCC
+}
+
+set iconTable(text,change_nick) [::msgcat::mc "Change nick"]
+
+proc button_change_nick {chatid} {
+	if {![chat::is_groupchat $chatid]} {
+		return
+	}
+	
+	if {[winfo exist .change_nick]} {
+	focus .change_nick
+	return
+	}
+	
+	toplevel .change_nick
+	wm title .change_nick [::msgcat::mc "Change nick"]
+	pack [label .change_nick.lab -text [::msgcat::mc "Change nick"]]
+	pack [entry .change_nick.nick]
+	pack [button .change_nick.ok -text OK -command \
+		[list [namespace current]::button_change_nick:new_nick $chatid]] \
+	[button .change_nick.cancel -text Cancel -command \
+	[list destroy .change_nick]] \
+		-side left -fill x -padx 3 -pady 3 -expand 1
+	focus .change_nick.nick
+}
+
+proc button_change_nick:new_nick {chatid} {
+	muc::change_nick $chatid [.change_nick.nick get]
+	destroy .change_nick
+}
+# ___________________________
+set iconTable(icon,disco) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjUlEQVR4nMWTS2sTYRSGn5nMZCadNJeJ1tqLLWmsloJKa6GCRcGFLqyle7Eg4sJf4NadP0MXLgQX4l4Qu9GNije0WtokdYxJ08nkMvPNTC5urFjr3gNnc3jfh8O5wP8O6e/C2StXY+bY8duhlro2PJge9z2X128+Ui+XKofM+CNdCu6uPr5f2NVH/jQPTUxlJhcuPzk6O7+Sm5tPLcyfpJcexY8YlL6Xjc/v3s1Jemwpk0o+t0vF0j7A3OLKg8GZ85cWzp9hYsTENDRqkTghGvWGoCU8Ko1aWo9q56Jd8cBr1oW8ax6bPn1haHpmeTibZTwd5ZAEXR/MPhlJVUlnTNIDh5GjBhU3nEqMTt4C+A04kDtxPZZIMprWaXfBlaABOKKHaHm0HIe+wQHU7DECWcUnugig7AI6famTOw0X23Z4GUp09DiyLFH6UcMqFPGEwHMcgq0CiBaSkcruAbSaDfVLvogiazhdnYSZQY5INOwa1sYG3dCj30yTKetUu21kRVX2AILv+fVyvT1pWzaxeIpYIomiqgRCIJp1cpNHiGgR1GCMcOcbPa9u7ZmBb1sP5VqZsFkl2a9BKKiVK/gtl6iikEka9PfaSE6VmARK21vds8bAddYGRiaWXdc/eGr2BFNTOQzDQIqoKKpGrbJN/tN7Wj8KGJrqlNde3fDdZvU3oNPptKW2+8IcGl9qOk68X1c4fDCB6/k49ja2tYFtbZKM68IpfLhZKa4/23dIolUv9bzaWlSPzXbanUx+I49V2EQ4FeTQRZeCkr359o719cM9oPevX0gCR2RZnjkwkr2oJQdyUkQxZHq+37CL1a2vTwNfvAQ2gTLQ2/dMv7rSf2UfoAIdwAU8wAfCXfFPffsXfMRKZIsAAAAASUVORK5CYII=
+}
+
+set iconTable(text,disco) [::msgcat::mc "Disco"]
+
+proc button_disco {chatid} {
+	eval [list disco::browser::open_win "" ""]
+}
+# ___________________________
+set iconTable(icon,join_conference) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALcSURBVDjLjZJpSNNxHMb/VhTUi3pjVFoyj+wyPDG1sDUTE7ES1zCPuXRbZjZrSk63qVPzKNuc+ncmHmPOeU3nkYkEmnjhlVdaBPoiddGbMDEoj6clZEYlvnhe/fh8+P4eHgIAsVWE/kdY4wVWC7NqE0yXUZZLeebFvs7mu3+9bwnzvE1pMyrK6lzFYWxOYaSFbFuCYqaxfK7OEfOtbHzty8a81g1zmqOYKLD4vC0B6b8/Wz/SioVuEssjSiz2kJh93YL2FLuZbQn8vG9wJssfrH0ZrcXqVB2WJnTQd8ghCbmo/aeAQ7Vi5bMuLciDqSBDacsRDJtB+cPI73otHx8akqFvFKFLcRdn2adbnGLP7PtDwHSzpOWzPFZlgVRsTomUh9zCVGTmiZD4JBYNb8qR1i6Bjdi6zJZ/fO+GQMqw73oWcQ11SWGYrBBCzadDHkyDguuB0hEhotSuYJfaIX0gGjVvixGti4JLhBO5IchjWNS8b9f8VZgmngrpcBzClY5IbroJhuIE4nq5YJGhmCZ9/18YT30B91TnwFU6gFVsC2E9HdUDOYipuYrL0kMIkDIwX+TzW7DDIUeQJ4jaKCxS5QzdMAntUN46WDkgg+xlDJS9Wbit9oRT+p61riIf9jps5FYZ7scfWuz4CDyq1kJUokGY4b8/4adtPGS2RiKthYOkJhYkz7lQdKYgqOw8rBKJFYLiraDTec1LjVOrSJ0E2P1ASAcQWHQSVf0yqA0LVPZkoaQ7wyC5g4JOCThqL1BExCcTAWFLjKU6rgzW5oJfrwezFWDq1hCoWcP1AnNcyTEFTXoQbo8PIKTUFeSrJNxSecJMROgPC4hT6zuYyXGfr027jwBxHzhtAOuF4QIdENwIBDUDjIxpiPnpsE/dBaaSBrMEYtYAW28s8Z2K69Ii8Yt3ppfrHKMHQBWPGTIOqnAU7vFDsPCqmsmNCU+yFBt9O5awE8YCgrJ5vT8AXgaV02he+4MAAAAASUVORK5CYII=
+}
+
+set iconTable(text,join_conference) [::msgcat::mc "Join conference"]
+
+proc button_join_conference {chatid} {
+	join_group_dialog ""
+}
+
+# ___________________________
+set iconTable(icon,juick_cmds) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAGtJREFUOMtjYKAl2J/DcGV/DsMOfGpYCJjRwsDA8IFhwMD+HIYT+3MYllHiBXMGBgZxfAqYiHAII6UGMIwawPCfLAP25zAIQJl/SE4H+3MYVjAwMBhDuY/IcQEXAwODHAMDw10GBoZKmiZ3AOklESKhVPrCAAAAAElFTkSuQmCC
+}
+
+set iconTable(text,juick_cmds) [::msgcat::mc "Juick commands"]
+
+proc button_juick_cmds {chatid} {
+	set jid [chat::get_jid $chatid]
+	if {![string equal $jid "juick at juick.com/Juick"]} {
+	return
+	}
+	
+	set m .juick_cmds_popup
+	
+    if [winfo exists $m] {
+	destroy $m
+    }
+	
+    set m [menu $m -tearoff 0]
+	
+	$m add command -label [::msgcat::mc "Show last messages from your feed"] \
+	-command [list [namespace current]::juick_add $chatid {#} 1]
+	$m add command -label [::msgcat::mc "Show last messages from public timeline"] \
+	-command [list [namespace current]::juick_add $chatid {#+} 1]
+	$m add command -label [::msgcat::mc "Show recomendations and popular personal blogs"] \
+	-command [list [namespace current]::juick_add $chatid {@} 1]
+	$m add command -label [::msgcat::mc "Show your tags"] \
+	-command [list [namespace current]::juick_add $chatid {*} 1]
+	$m add command -label [::msgcat::mc "Show last 10 messages with tag"] \
+	-command [list [namespace current]::juick_add $chatid {*tag}]
+	$m add command -label [::msgcat::mc "Show user's info"] \
+	-command [list [namespace current]::juick_add $chatid {@username}]
+	$m add command -label [::msgcat::mc "Show user's info and last 10 messages"] \
+	-command [list [namespace current]::juick_add $chatid {@username+}]
+	$m add command -label [::msgcat::mc "Search posts"] \
+	-command [list [namespace current]::juick_add $chatid {? blah}]
+	$m add command -label [::msgcat::mc "Delete last message"] \
+	-command [list [namespace current]::juick_add $chatid {D L} 1]
+	$m add command -label [::msgcat::mc "Show your subscriptions"] \
+	-command [list [namespace current]::juick_add $chatid {S} 1]
+	$m add command -label [::msgcat::mc "Subscribe to message replies"] \
+	-command [list [namespace current]::juick_add $chatid {S #1234}]
+	$m add command -label [::msgcat::mc "Show your blacklist"] \
+	-command [list [namespace current]::juick_add $chatid {BL} 1]
+	$m add command -label [::msgcat::mc "Show your \"white list\""] \
+	-command [list [namespace current]::juick_add $chatid {WL} 1]
+	$m add command -label [::msgcat::mc "Send invite to jabber user"] \
+	-command [list [namespace current]::juick_add $chatid {INVITE user1 at example.org}]
+	$m add command -label [::msgcat::mc "PING"] \
+	-command [list [namespace current]::juick_add $chatid {PING} 1]
+	$m add command -label [::msgcat::mc "Help"] \
+	-command [list [namespace current]::juick_add $chatid {HELP} 1]
+	
+	tk_popup $m [winfo pointerx .] [winfo pointery .]
+}	
+
+proc juick_add {chatid text {send 0}} {
+	set cw [chat::winid $chatid]
+	set iw [chat::input_win $chatid]
+	$iw delete 1.0 end
+	$iw insert end $text
+	if {$send} {chat::send_message $cw $chatid chat}
+}
+
+# ___________________________
+set iconTable(icon,notes) {
+iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAB3RJTUUH2AQPDSoOH1HwCAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAAMdSURBVHjadVNZaBNRFD2zJBNT00wWJ4uNbRrS1JbQVq0bKq1S1KoIrR+CuEvVYpH+KSh+iCgIin6IKLgggiL1R/yoOyJaV2oXtYrWtqlpjGkz2abJpBNfAm6oFy685dxz77nvPgr/sA0MM9MuCHcohun75vPVnQWi+I/R/zq0GQ23mrZv4+0azZwpRUViq15/+H8E1O+bC6eaKhSFfTx2oUMjTNLSnoQEV00N9p88qZQdalwNJTNI6+XB5p3Xwz9i2N8JJjLUmvqGtVrjhoM4smARynkTvnR2Qm030TOqq26I4THEomFcPrMxIsWjQyq1+u4fBAxLN1ptHsgyBcfc2bh6sx35ZhPe2ByYV7OJIFLEE1nPB8TyY7tXun5KuHZ+a6XJVvyqdulOKguMRaIIfgshQWSI0QQuXbyC5ubN0HBpuN0WpEIPsXdHy68KwqK0fsESL5XN8HXkA4wGK5zFJnIzBmRSmD+nEZDJWpkA0mH0PH8AmsKtHMGulmoVp2bWWR1OAiYvllGhu/spBgeGoNPrwdAqWIVJMPB6CFO05O3i6H3xEhzQniOodhfWe8qcFtJGxMI+CAYJgtWMqllFJGM6p10MiugfGIZgNBNYEP3dn/2H2tCVI0jKyW0VFWWkNBHDvn68/yhlGwpFicNhZVBSrIVeT6OynDRR8WH4bTciEm6T0Ax7+viKAovAL+N0eUTjCDzTLcRjJEtWig6hQAwdL4bQPxjDisUCLFPz8PpxF2gF7bk5kBPjW7xeF4uJBN69+4zXPX7w+Sx4Xg3XNC3MFhVqLQbUpieTUlM54p4nvQrD5SoAm6fTbHV6C8mliNISDqXuguxIYeRLBG/7Ahh5NA5/QMLyhTq4HSykwCgCgVTPsQcI5gg4//1PbQfuOexOD+X2Toe5xEN0KrAa07DyLOKigpA/gpQkk8Hn0fusD2kFd/74C+daYUvGsYzMTIMaqHOXTePshTaMx2OYkJOQomNIR0Jweatx/lxnOinLlUfvo/evz5S1fatgYBmsTsRRO7UUVRyHAsjQJaLIjIoYiAax58RDtP3Afwc+jjWG3FzigwAAAABJRU5ErkJggg==
+}
+
+set iconTable(text,notes) [::msgcat::mc "Edit notes"]
+
+proc button_notes {chatid} {
+	variable notes
+	
+	custom::defvar notes($chatid) {} {} \
+	-type string -group Hidden
+	
+	if {[winfo exist .notes]} return
+	
+	toplevel .notes
+	
+	foreach {option value} [wm attributes .notes] {
+		if {[string equal $option "-topmost"]} {
+		wm attributes .notes -topmost 1
+		}
+	}
+	
+	wm title .notes [::msgcat::mc "Edit notes"]
+	
+	text .notes.win -font $::default_Roster_font \
+		-yscrollcommand [list .notes.scroll set] \
+		-wrap word
+	scrollbar .notes.scroll -orient vertical \
+		-command [list .notes.win yview]
+	button .notes.ok -text [::msgcat::mc "Save"] \
+		-command [list [namespace current]::save_notes $chatid]
+	button .notes.cancel -text [::msgcat::mc "Cancel"] \
+		-command {destroy .notes}
+	
+	pack .notes.win -fill both -expand 1
+	pack .notes.scroll -fill y -side right -in .notes.win
+	
+	pack .notes.cancel .notes.ok -padx 3 \
+	-pady 3 -side right
+	
+	.notes.win insert end $notes($chatid)
+	
+	wm geometry .notes 350x350
+}
+
+proc save_notes {chatid} {
+	variable notes
+	set notes($chatid) [.notes.win get 1.0 "end - 1 chars"]
+	destroy .notes
+}
+
+# Toolbar icon 
+set iconTable(toolbar) {
+iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1FB9ELCQ0KFPeDtBUAAAPpSURBVHjarZZtaFtlFMd/SbM2tdO4ZhWpNe3eqCvYri1MiJR1rU6lzpFhQfSLU9xAhckgK2N2iizqENnqy2C6bnYwB841DOxgXW03lXQljV0ohaotsQ0L2CZp0qZLlyb38YPPLbchffnggYd7uc+5//+55/zPeW4Wy5sAPpTXWSDA/2A6IBsQnR2XxR2PS3zqaBaSJFfur/S+Xi7dUg4PACWA6HN1i/7bt0Rnx2WVJGcZEp30OQ0Uy4AysucAjwDlgLjr/1v0ubpVgjLpkxFcCCHsdvsQcA4o1Kc5rAFSQDMQByLl5eWsyy/QAtUDWRnAFSEEHo8Hq9VaBuwDHtISrAHuD3rdFBU9N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d7jfW8G+N8wtNOTj+u2w8wk5iAGF8Kggm/UJWaGvN1UU6fff7g7NXTuCN5+2cBqlCBcr6E8+x5cw9UamCrX8vefKIY1QEowKWBS/LuBxRg6HIaMY0IoccwF1ijRbqtPwChch8JXh4MibgpYKlZdw/1je5vg/GcPvXO/SzIIgWsSeCqBb5lwbQpjq+5T4x4uTCreMPlrMHiGwSo9Cwqb1WM33ohCPoOUZcC3TXW3zAxkcx3oHBwX6RSq2Gw8Qc8BuvMZL5UyaVmaunnx+FEqY5SjBlaiGE0uEScS3CBYCz9g+l1jNqkEPXhRqG5bQWFkb1St7eu/9WDuWyIIVO/wUwxpx0LaZRDlj3hV5EuJLPRviXcatPBwTxgl+b47Txcr3V0uOj0bGd8GqSziZVH+aNoH+zAarGhK3Ia7XfNhlD17b+JrI59zQNc/4fk8r0f00GncDxZ20/VfuYWr5YET2YVHnNjy9WowgJHcGNrG5eXruLJ0rX1hG/gFsY6kWq0OsmEAAAAASUVORK5CYII=
 }
\ No newline at end of file


Property changes on: trunk/plugins/chattoolbar/icon-table.tcl
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: trunk/plugins/chattoolbar/msgs/ru.msg
===================================================================
--- trunk/plugins/chattoolbar/msgs/ru.msg	2011-01-23 11:40:26 UTC (rev 465)
+++ trunk/plugins/chattoolbar/msgs/ru.msg	2011-01-28 13:01:18 UTC (rev 466)
@@ -1,51 +1,51 @@
-::msgcat::mcset ru "ChatToolbar options." "Настройки для ChatToolbar"
-::msgcat::mcset ru "Create button on toolbar." "Создать кнопку для быстрых настроек на панеле."
-::msgcat::mcset ru "Enable for chats." "Активировать для приватных разговоров."
-::msgcat::mcset ru "Enable for groupchats." "Активировать для конференций."
-::msgcat::mcset ru "Automatically open the toolbar at the entrance to the room." "Автоматически открывать панель при входе в комнату."
-::msgcat::mcset ru "Distance between the buttons." "Расстояние между иконками."
-::msgcat::mcset ru "Whether the ChatToolbar plugin is loaded." "Определяет, загружен ли плагин ChatToolbar"
-::msgcat::mcset ru "Chattoolbar manager" "Настройки для ChatToolbar"
-::msgcat::mcset ru "Chattoolbar setting" "Настройки для ChatToolbar"
-::msgcat::mcset ru "Apply" "Применить"
-::msgcat::mcset ru "Rejoin room" "Перезайти"
-::msgcat::mcset ru "Vcard info" "Показать информацию о пользователе"
-::msgcat::mcset ru "Chat history" "История сообщений"
-::msgcat::mcset ru "Configure room" "Конфигурировать комнату"
-::msgcat::mcset ru "Change subject" "Сменить тему"
-::msgcat::mcset ru "Clear chat window" "Очистить окно разговора"
-::msgcat::mcset ru "Send custom presence" "Послать специальное присутствие"
-::msgcat::mcset ru "Available" "Доступен"
-::msgcat::mcset ru "Free to chat" "Свободен для разговора"
-::msgcat::mcset ru "Away" "Отошёл"
-::msgcat::mcset ru "Extended away" "Давно отошёл"
-::msgcat::mcset ru "Do not disturb" "Не беспокоить"
-::msgcat::mcset ru "Paste" "Вставить"
-::msgcat::mcset ru "Copy" "Копировать"
-::msgcat::mcset ru "Choise smile" "Выбрать эмоциконку"
-::msgcat::mcset ru "Add new user..." "Добавить нового пользователя..."
-::msgcat::mcset ru "Change nick" "Сменить псевдоним"
-::msgcat::mcset ru "Disco" "Обзор служб"
-::msgcat::mcset ru "Join conference" "Войти в комнату"
-::msgcat::mcset ru "%s subject" "%s тема"
-::msgcat::mcset ru "Save subject" "Сохранить тему"
-::msgcat::mcset ru "PING" "ПИНГ"
-::msgcat::mcset ru "Show your \"white list\"" "Показать ваш \"белый список\" пользователей"
-::msgcat::mcset ru "Show your blacklist" "Показать ваш \"чёрный список\" пользователей и тегов"
-::msgcat::mcset ru "Subscribe to message replies" "Подписаться на комментарии к этому сообщению"
-::msgcat::mcset ru "Show your subscriptions" "Вывести список всех блогов, на которые вы подписаны"
-::msgcat::mcset ru "Delete last message" "Удалить последнее сообщение"
-::msgcat::mcset ru "Search posts" "Поиск поста"
-::msgcat::mcset ru "Show user's info and last 10 messages" "Показать информацию о пользователе и 10 последних сообщений из его блога"
-::msgcat::mcset ru "Show user's info" "Показать информацию о пользователе"
-::msgcat::mcset ru "Show last 10 messages with tag" "Показать 10 последних сообщений с тегом"
-::msgcat::mcset ru "Show your tags" "Показать список популярных тегов"
-::msgcat::mcset ru "Show recomendations and popular personal blogs" "Показать список популярных персональных блогов"
-::msgcat::mcset ru "Show last messages from public timeline" "Показать последние 10 сообщений из общей ленты"
-::msgcat::mcset ru "Show last messages from your feed" "Показать последние сообщения из вашей личной ленты"
-::msgcat::mcset ru "Help" "Помощь"
-::msgcat::mcset ru "Send invite to jabber user" "Отослать приглашение пользователю Jabber"
-::msgcat::mcset ru "Juick commands" "Команды управления Juick"
-::msgcat::mcset ru "Save" "Сохранить"
-::msgcat::mcset ru "Cancel" "Отмена"
+::msgcat::mcset ru "ChatToolbar options." "Настройки для ChatToolbar"
+::msgcat::mcset ru "Create button on toolbar." "Создать кнопку для быстрых настроек на панеле."
+::msgcat::mcset ru "Enable for chats." "Активировать для приватных разговоров."
+::msgcat::mcset ru "Enable for groupchats." "Активировать для конференций."
+::msgcat::mcset ru "Automatically open the toolbar at the entrance to the room." "Автоматически открывать панель при входе в комнату."
+::msgcat::mcset ru "Distance between the buttons." "Расстояние между иконками."
+::msgcat::mcset ru "Whether the ChatToolbar plugin is loaded." "Определяет, загружен ли плагин ChatToolbar"
+::msgcat::mcset ru "Chattoolbar manager" "Настройки для ChatToolbar"
+::msgcat::mcset ru "Chattoolbar setting" "Настройки для ChatToolbar"
+::msgcat::mcset ru "Apply" "Применить"
+::msgcat::mcset ru "Rejoin room" "Перезайти"
+::msgcat::mcset ru "Vcard info" "Показать информацию о пользователе"
+::msgcat::mcset ru "Chat history" "История сообщений"
+::msgcat::mcset ru "Configure room" "Конфигурировать комнату"
+::msgcat::mcset ru "Change subject" "Сменить тему"
+::msgcat::mcset ru "Clear chat window" "Очистить окно разговора"
+::msgcat::mcset ru "Send custom presence" "Послать специальное присутствие"
+::msgcat::mcset ru "Available" "Доступен"
+::msgcat::mcset ru "Free to chat" "Свободен для разговора"
+::msgcat::mcset ru "Away" "Отошёл"
+::msgcat::mcset ru "Extended away" "Давно отошёл"
+::msgcat::mcset ru "Do not disturb" "Не беспокоить"
+::msgcat::mcset ru "Paste" "Вставить"
+::msgcat::mcset ru "Copy" "Копировать"
+::msgcat::mcset ru "Choise smile" "Выбрать эмоциконку"
+::msgcat::mcset ru "Add new user..." "Добавить нового пользователя..."
+::msgcat::mcset ru "Change nick" "Сменить псевдоним"
+::msgcat::mcset ru "Disco" "Обзор служб"
+::msgcat::mcset ru "Join conference" "Войти в комнату"
+::msgcat::mcset ru "%s subject" "%s тема"
+::msgcat::mcset ru "Save subject" "Сохранить тему"
+::msgcat::mcset ru "PING" "ПИНГ"
+::msgcat::mcset ru "Show your \"white list\"" "Показать ваш \"белый список\" пользователей"
+::msgcat::mcset ru "Show your blacklist" "Показать ваш \"чёрный список\" пользователей и тегов"
+::msgcat::mcset ru "Subscribe to message replies" "Подписаться на комментарии к этому сообщению"
+::msgcat::mcset ru "Show your subscriptions" "Вывести список всех блогов, на которые вы подписаны"
+::msgcat::mcset ru "Delete last message" "Удалить последнее сообщение"
+::msgcat::mcset ru "Search posts" "Поиск поста"
+::msgcat::mcset ru "Show user's info and last 10 messages" "Показать информацию о пользователе и 10 последних сообщений из его блога"
+::msgcat::mcset ru "Show user's info" "Показать информацию о пользователе"
+::msgcat::mcset ru "Show last 10 messages with tag" "Показать 10 последних сообщений с тегом"
+::msgcat::mcset ru "Show your tags" "Показать список популярных тегов"
+::msgcat::mcset ru "Show recomendations and popular personal blogs" "Показать список популярных персональных блогов"
+::msgcat::mcset ru "Show last messages from public timeline" "Показать последние 10 сообщений из общей ленты"
+::msgcat::mcset ru "Show last messages from your feed" "Показать последние сообщения из вашей личной ленты"
+::msgcat::mcset ru "Help" "Помощь"
+::msgcat::mcset ru "Send invite to jabber user" "Отослать приглашение пользователю Jabber"
+::msgcat::mcset ru "Juick commands" "Команды управления Juick"
+::msgcat::mcset ru "Save" "Сохранить"
+::msgcat::mcset ru "Cancel" "Отмена"
 ::msgcat::mcset ru "Edit notes" "Редактировать заметки"
\ No newline at end of file


Property changes on: trunk/plugins/chattoolbar/msgs/ru.msg
___________________________________________________________________
Added: svn:eol-style
   + native



More information about the Tkabber-dev mailing list