[Tkabber-dev] r267 - in trunk/plugins/bmucx: . msgs

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Jan 8 06:13:34 MSK 2010


Author: ancestor
Date: 2010-01-08 06:13:34 +0300 (Fri, 08 Jan 2010)
New Revision: 267

Removed:
   trunk/plugins/bmucx/TODO
Modified:
   trunk/plugins/bmucx/bmucx.tcl
   trunk/plugins/bmucx/msgs/ru.msg
Log:
1) bmucx menu was rearranged.
1.1) TODO file was removed due to 1.
1.2) Code refactoring due to 1.



Deleted: trunk/plugins/bmucx/TODO
===================================================================
--- trunk/plugins/bmucx/TODO	2010-01-05 14:07:50 UTC (rev 266)
+++ trunk/plugins/bmucx/TODO	2010-01-08 03:13:34 UTC (rev 267)
@@ -1,7 +0,0 @@
-Rearrange menu:
-
-NOW: Topic Menu	-Block private messages -...
-		-Block public messages -...
-
-TODO: Topic Menu -Blocking messages -Block public messages -...
-				    -Block private messages -...
\ No newline at end of file

Modified: trunk/plugins/bmucx/bmucx.tcl
===================================================================
--- trunk/plugins/bmucx/bmucx.tcl	2010-01-05 14:07:50 UTC (rev 266)
+++ trunk/plugins/bmucx/bmucx.tcl	2010-01-08 03:13:34 UTC (rev 267)
@@ -9,7 +9,7 @@
 	::plugins::register bmucx \
 			    -namespace [namespace current] \
 			    -source [info script] \
-			    -description [::msgcat::mc "Block MUC messages."] \
+			    -description [::msgcat::mc "Blocking MUC messages."] \
 			    -loadcommand [namespace code load] \
 			    -unloadcommand [namespace code unload]
 	return
@@ -28,15 +28,6 @@
 
 ########################################################################################
 
-proc bmucx::refresh_list_priv {} {
-	variable bmuc_list_priv
-	variable moders_list_priv
-	variable members_list_priv
-	set bmuc_list_priv [array get ::blockvar_priv]
-	set moders_list_priv [array get ::blockvar_moders_priv]	
-	set members_list_priv [array get ::blockvar_members_priv]
-}
-
 proc bmucx::refresh_list {} {
 	variable bmuc_list
 	variable moders_list
@@ -46,67 +37,85 @@
 	set members_list [array get ::blockvar_members]
 }
 
-########################################################################################
-
-proc bmucx::load_list_priv {} {
+proc bmucx::refresh_list_priv {} {
 	variable bmuc_list_priv
 	variable moders_list_priv
 	variable members_list_priv
-	array set ::blockvar_priv $bmuc_list_priv
-	array set ::blockvar_moders_priv $moders_list_priv
-	array set ::blockvar_members_priv $members_list_priv
+	set bmuc_list_priv [array get ::blockvar_priv]
+	set moders_list_priv [array get ::blockvar_moders_priv]	
+	set members_list_priv [array get ::blockvar_members_priv]
 }
 
-proc bmucx::load_list {} {
+########################################################################################
+
+proc bmucx::load_bmucx_list {} {
 	variable bmuc_list
 	variable moders_list
 	variable members_list
+	variable bmuc_list_priv
+	variable moders_list_priv
+	variable members_list_priv
+
 	array set ::blockvar $bmuc_list
 	array set ::blockvar_moders $moders_list
 	array set ::blockvar_members $members_list
+	array set ::blockvar_priv $bmuc_list_priv
+	array set ::blockvar_moders_priv $moders_list_priv
+	array set ::blockvar_members_priv $members_list_priv
 }
 
 ########################################################################################
 
-proc bmucx::add_pub_menu {m xlib jid} {
-	set bm [menu $m.bmuc -tearoff 0]
-	$bm add checkbutton -label [::msgcat::mc "On"] \
+proc bmucx::add_bmucx_menu {m xlib jid} {
+	$m add cascade \
+		-menu "$m.men45" -label [::msgcat::mc "Block MUC messages"] 
+	
+	set site_4_0 $m
+	menu $site_4_0.men45 -tearoff 0 
+	
+	$site_4_0.men45 add cascade \
+		-menu "$site_4_0.men45.men46" -label [::msgcat::mc "Public MUC messages"]
+	
+	set site_5_0 $site_4_0.men45
+	menu $site_5_0.men46 -tearoff 0 
+	
+	$site_5_0.men46 add checkbutton -label [::msgcat::mc "On"] \
 		-indicatoron 1 -variable ::blockvar($jid) -offvalue 0 -onvalue 1 \
 		-command [namespace current]::refresh_list
 
 	set mstate normal
 	if {!$::blockvar($jid)} {set mstate disabled}
-	$bm add separator
 
-	$bm add checkbutton -label [::msgcat::mc "Block message from moderators"] \
+	$site_5_0.men46 add separator \
+ 
+	$site_5_0.men46 add checkbutton -label [::msgcat::mc "Block messages from members"] \
+		-indicatoron 1 -variable ::blockvar_members($jid) -offvalue 0 -onvalue 1 \
+		-command [namespace current]::refresh_list -state $mstate
+	$site_5_0.men46 add checkbutton -label [::msgcat::mc "Block messages from moderators"] \
 		-indicatoron 1 -variable ::blockvar_moders($jid) -offvalue 0 -onvalue 1 \
-		-command [namespace current]::refresh_list -state $mstate
-	$bm add checkbutton -label [::msgcat::mc "Block message from members"] \
-		-indicatoron 1 -variable ::blockvar_members($jid) -offvalue 0 -onvalue 1 \
-		-command [namespace current]::refresh_list -state $mstate		
-		
-	$m add cascade -label [::msgcat::mc "Block public messages"] -menu $bm
-	$m add separator
-}
+		-command [namespace current]::refresh_list -state $mstate	
 
-proc bmucx::add_priv_menu {mpr xlib jid} {
-	set bmpr [menu $mpr.bmucpr -tearoff 0]
-	$bmpr add checkbutton -label [::msgcat::mc "On"] \
+	$site_4_0.men45 add cascade \
+		-menu "$site_4_0.men45.men47" -label [::msgcat::mc "Private MUC messages"]
+	
+	set site_5_0 $site_4_0.men45
+	menu $site_5_0.men47 -tearoff 0
+	
+	$site_5_0.men47 add checkbutton -label [::msgcat::mc "On"] \
 		-indicatoron 1 -variable ::blockvar_priv($jid) -offvalue 0 -onvalue 1 \
 		-command [namespace current]::refresh_list_priv
 
 	set mstatepriv normal
 	if {!$::blockvar_priv($jid)} {set mstatepriv disabled}
-	$bmpr add separator
 
-	$bmpr add checkbutton -label [::msgcat::mc "Block message from moderators"] \
+	$site_5_0.men47 add separator \
+
+	$site_5_0.men47 add checkbutton -label [::msgcat::mc "Block messages from members"] \
+		-indicatoron 1 -variable ::blockvar_members_priv($jid) -offvalue 0 -onvalue 1 \
+		-command [namespace current]::refresh_list_priv -state $mstatepriv 
+	$site_5_0.men47 add checkbutton -label [::msgcat::mc "Block messages from moderators"] \
 		-indicatoron 1 -variable ::blockvar_moders_priv($jid) -offvalue 0 -onvalue 1 \
 		-command [namespace current]::refresh_list_priv -state $mstatepriv
-	$bmpr add checkbutton -label [::msgcat::mc "Block message from members"] \
-		-indicatoron 1 -variable ::blockvar_members_priv($jid) -offvalue 0 -onvalue 1 \
-		-command [namespace current]::refresh_list_priv -state $mstatepriv		
-	
-	$mpr add cascade -label [::msgcat::mc "Block private messages"] -menu $bmpr
 }
 
 ########################################################################################
@@ -170,19 +179,15 @@
 ########################################################################################
 
 proc bmucx::load {} {
-	hook::add finload_hook [namespace current]::load_list
-	hook::add finload_hook [namespace current]::load_list_priv
-	hook::add chat_create_conference_menu_hook [namespace current]::add_pub_menu 0
-	hook::add chat_create_conference_menu_hook [namespace current]::add_priv_menu 0
+	hook::add finload_hook [namespace current]::load_bmucx_list
+	hook::add chat_create_conference_menu_hook [namespace current]::add_bmucx_menu 0
 	hook::add process_message_hook [namespace current]::block_pub_messages 40
 	hook::add process_message_hook [namespace current]::block_priv_messages 40
 }
 
 proc bmucx::unload {} {
-	hook::remove finload_hook [namespace current]::load_list
-	hook::remove finload_hook [namespace current]::load_list_priv
-	hook::add chat_create_conference_menu_hook [namespace current]::add_pub_menu 0
-	hook::add chat_create_conference_menu_hook [namespace current]::add_priv_menu 0
+	hook::remove finload_hook [namespace current]::load_bmucx_list
+	hook::add chat_create_conference_menu_hook [namespace current]::add_bmucx_menu 0
 	hook::add process_message_hook [namespace current]::block_pub_messages 40
 	hook::add process_message_hook [namespace current]::block_priv_messages 40
 }
\ No newline at end of file

Modified: trunk/plugins/bmucx/msgs/ru.msg
===================================================================
--- trunk/plugins/bmucx/msgs/ru.msg	2010-01-05 14:07:50 UTC (rev 266)
+++ trunk/plugins/bmucx/msgs/ru.msg	2010-01-08 03:13:34 UTC (rev 267)
@@ -1,6 +1,7 @@
-::msgcat::mcset ru "Block MUC messages." "Блокировка сообщений конференций."
-::msgcat::mcset ru "Block public messages" "Блокировать групповые сообщения"
-::msgcat::mcset ru "Block private messages" "Блокировать приватные сообщения"
-::msgcat::mcset ru "Block message from moderators" "Блокировать сообщения от модераторов"
-::msgcat::mcset ru "Block message from members" "Блокировать сообщения от постоянных участников"
+::msgcat::mcset ru "Blocking MUC messages." "Блокировка сообщений конференций."
+::msgcat::mcset ru "Block MUC messages" "Блокировать сообщения конференции"
+::msgcat::mcset ru "Public MUC messages" "Групповые сообщения"
+::msgcat::mcset ru "Private MUC messages" "Приватные сообщения"
+::msgcat::mcset ru "Block messages from moderators" "Блокировать сообщения от модераторов"
+::msgcat::mcset ru "Block messages from members" "Блокировать сообщения от постоянных участников"
 ::msgcat::mcset ru "On" "Включено"
\ No newline at end of file



More information about the Tkabber-dev mailing list