[Tkabber-dev] r1727 - in trunk/tkabber-plugins: . ejabberd/msgs floatingcontact/msgs floatinglog/msgs georoster/msgs openurl/msgs whiteboard

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Mar 14 00:23:41 MSK 2009


Author: sergei
Date: 2009-03-14 00:23:41 +0300 (Sat, 14 Mar 2009)
New Revision: 1727

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/ejabberd/msgs/de.msg
   trunk/tkabber-plugins/floatingcontact/msgs/de.msg
   trunk/tkabber-plugins/floatinglog/msgs/de.msg
   trunk/tkabber-plugins/georoster/msgs/de.msg
   trunk/tkabber-plugins/openurl/msgs/de.msg
   trunk/tkabber-plugins/whiteboard/whiteboard.tcl
Log:
	* whiteboard/whiteboard.tcl: Made whiteboard plugin unloadable.

	* ejabberd/msgs/de.msg, floatingcontact/msgs/de.msg,
	  floatinglog/msgs/de.msg, georoster/msgs/de.msg, openurl/msgs/de.msg:
	  Updated German translation (thanks to Roger Sondermann).


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/ChangeLog	2009-03-13 21:23:41 UTC (rev 1727)
@@ -16,6 +16,12 @@
 	* cyrillize/cyrillize.tcl: Fixed reading recoding table on the package
 	  loading.
 
+	* whiteboard/whiteboard.tcl: Made whiteboard plugin unloadable.
+
+	* ejabberd/msgs/de.msg, floatingcontact/msgs/de.msg,
+	  floatinglog/msgs/de.msg, georoster/msgs/de.msg, openurl/msgs/de.msg:
+	  Updated German translation (thanks to Roger Sondermann).
+
 2009-03-12  Sergei Golovan <sgolovan at nes.ru>
 
 	* whiteboard/svgrender.tcl, whiteboard/whiteboard.tcl: Switched to

Modified: trunk/tkabber-plugins/ejabberd/msgs/de.msg
===================================================================
--- trunk/tkabber-plugins/ejabberd/msgs/de.msg	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/ejabberd/msgs/de.msg	2009-03-13 21:23:41 UTC (rev 1727)
@@ -1,6 +1,6 @@
 
 # German messages file
-# Roger Sondermann 30.12.2007
+# Roger Sondermann 13.03.2009
 
 ::msgcat::mcset de "%s administration"          "%s Administrierung"
 ::msgcat::mcset de "Access rules:"              "Zugriffs-Regeln:"
@@ -31,3 +31,4 @@
 ::msgcat::mcset de "Stopped nodes:"             "Angehaltene Knoten:"
 ::msgcat::mcset de "Welcome message body:"      "Text der 'Willkommen'-Nachricht:"
 ::msgcat::mcset de "Welcome message subject:"   "Subjekt der 'Willkommen'-Nachricht:"
+::msgcat::mcset de "Whether the Ejabberd plugin is loaded." "ejabberd-Plugin laden."

Modified: trunk/tkabber-plugins/floatingcontact/msgs/de.msg
===================================================================
--- trunk/tkabber-plugins/floatingcontact/msgs/de.msg	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/floatingcontact/msgs/de.msg	2009-03-13 21:23:41 UTC (rev 1727)
@@ -1,6 +1,7 @@
 
 # German messages file
-# Roger Sondermann 25.10.2008
+# Roger Sondermann 13.03.2009
 
-::msgcat::mcset de "Floating contact"       "Schwebender Kontakt"
-::msgcat::mcset de "Stored floating JIDs."  "Gespeicherte Schwebende Kontakte."
+::msgcat::mcset de "Floating contact"       "'Floating Contact'"
+::msgcat::mcset de "Stored floating JIDs."  "Gespeicherte 'Floating Contacts'."
+::msgcat::mcset de "Whether the Floating Contact plugin is loaded." "'Floating Contact'-Plugin laden."

Modified: trunk/tkabber-plugins/floatinglog/msgs/de.msg
===================================================================
--- trunk/tkabber-plugins/floatinglog/msgs/de.msg	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/floatinglog/msgs/de.msg	2009-03-13 21:23:41 UTC (rev 1727)
@@ -1,6 +1,6 @@
 
 # German messages file
-# Roger Sondermann 25.10.2008
+# Roger Sondermann 13.03.2009
 
 ::msgcat::mcset de "%s request from %s"                         "%s-Anfrage von %s"
 ::msgcat::mcset de "Delay before message hide (in seconds)."    "Verzögerung bevor das 'Floating Log'-Fenster verborgen wird (in Sekunden)."
@@ -25,6 +25,7 @@
 ::msgcat::mcset de "Show other messages."                       "Andere Nachrichten anzeigen."
 ::msgcat::mcset de "Show when Tkabber is active."               "Bei aktivem Tkabber-Fenster anzeigen."
 ::msgcat::mcset de "Use simple view scheme."                    "Einfache Art der Anzeige benutzen."
+::msgcat::mcset de "Whether the Floating Log plugin is loaded." "'Floating Log'-Plugin laden."
 ::msgcat::mcset de "Window opacity (in percent)."               "Transparenz des Fensters (in Prozent)."
 ::msgcat::mcset de "Window position."                           "Position des Fensters."
 ::msgcat::mcset de "Window width."                              "Breite des Fensters."

Modified: trunk/tkabber-plugins/georoster/msgs/de.msg
===================================================================
--- trunk/tkabber-plugins/georoster/msgs/de.msg	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/georoster/msgs/de.msg	2009-03-13 21:23:41 UTC (rev 1727)
@@ -1,6 +1,6 @@
 
 # German messages file
-# Roger Sondermann 11.06.2007
+# Roger Sondermann 13.03.2009
 
 ::msgcat::mcset de "Automatically look at vCard to find users coordinates." "Für die Koordinaten des Benutzers automatisch in seine Visitenkarte schauen."
 ::msgcat::mcset de "Automatically open Georoster window."                   "Das Georoster-Fenster automatisch öffnen."
@@ -16,3 +16,4 @@
 ::msgcat::mcset de "Show only city markers"                                 "Markierungen anzeigen"
 ::msgcat::mcset de "Specify how to show cities at the map."                 "Angeben, wie Städte auf der Karte angezeigt werden sollen."
 ::msgcat::mcset de "Store"                                                  "Speichern"
+::msgcat::mcset de "Whether the Georoster plugin is loaded."                "Georoster-Plugin laden."

Modified: trunk/tkabber-plugins/openurl/msgs/de.msg
===================================================================
--- trunk/tkabber-plugins/openurl/msgs/de.msg	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/openurl/msgs/de.msg	2009-03-13 21:23:41 UTC (rev 1727)
@@ -1,9 +1,12 @@
 
 # German messages file
-# Roger Sondermann 25.10.2008
+# Roger Sondermann 13.03.2009
 
-::msgcat::mcset de "Open URL plugin options."       "Optionen für das 'Open URL'-Plugin."
-::msgcat::mcset de "Open URL with"                  "Öffne URL mit"
-::msgcat::mcset de "Open URL with %s"               "Öffne URL mit %s"
-::msgcat::mcset de "Plugins options."               "Optionen für Plugins."
-::msgcat::mcset de "Use submenu for browsers list." "Unter-Menü für Browser-Liste benutzen."
+::msgcat::mcset de "A binary name or a full path to user defined browser. Use its full path if can't be autodetected.\n\nExample:\n  ~/bin/hv3/hv3-linux" "Binärer Name oder vollständiger Pfad zu einem benutzerdefinierten Browser. Den vollständigen Pfad benutzen, wenn der Browser nicht automatisch erkannt werden kann.\n\nBeispiele:\n  ~/usr/bin/firefox\n  c:/programme/firefox/firefox.exe"
+::msgcat::mcset de "Open URL plugin options."               "Optionen für das 'Open URL'-Plugin."
+::msgcat::mcset de "Open URL with"                          "Öffne URL mit"
+::msgcat::mcset de "Open URL with %s"                       "Öffne URL mit %s"
+::msgcat::mcset de "Plugins options."                       "Optionen für Plugins."
+::msgcat::mcset de "Whether the Open URL plugin is loaded." "'Open URL'-Plugin laden."
+::msgcat::mcset de "Use submenu for browsers list."         "Unter-Menü für Browser-Liste benutzen."
+::msgcat::mcset de "User defined browser name.\n\nExamples:\n  HV3\n  Google Chrome" "Benutzerdefinierter Browser-Name.\n\nBeispiele:\n  Google Chrome\n  Mozilla Firefox"

Modified: trunk/tkabber-plugins/whiteboard/whiteboard.tcl
===================================================================
--- trunk/tkabber-plugins/whiteboard/whiteboard.tcl	2009-03-13 21:21:26 UTC (rev 1726)
+++ trunk/tkabber-plugins/whiteboard/whiteboard.tcl	2009-03-13 21:23:41 UTC (rev 1727)
@@ -1,32 +1,71 @@
 # $Id$
 
-uplevel #0 [list source [file join [file dirname [info script]] svgrender.tcl]]
-
 package require msgcat
-package require base64
-catch {package require Img}
 
-::msgcat::mcload [file join [file dirname [info script]] msgs]
+namespace eval wb {
+    ::msgcat::mcload [file join [file dirname [info script]] msgs]
 
-namespace eval wb {
+    if {![::plugins::is_registered whiteboard]} {
+	::plugins::register whiteboard \
+			    -namespace [namespace current] \
+			    -source [info script] \
+			    -description [::msgcat::mc "Whether the Whiteboard plugin is loaded."] \
+			    -loadcommand [namespace code load] \
+			    -unloadcommand [namespace code unload]
+	return
+    }
+
     set id_base [pid]	;# used in proc create_id
 }
 
+proc wb::load {} {
+    hook::add chat_create_user_menu_hook \
+	      [namespace current]::add_whiteboard_menu_item 47
+    hook::add chat_create_conference_menu_hook \
+	      [namespace current]::add_whiteboard_menu_item 47
+    hook::add roster_jid_popup_menu_hook \
+	      [namespace current]::add_whiteboard_menu_item 47
+
+    hook::add draw_message_hook [namespace current]::handle_wb 1
+
+    # TODO: Add menu items to all existing chats
+}
+
+proc wb::unload {} {
+    # TODO: Remove menu items from all existing chats
+
+    hook::remove chat_create_user_menu_hook \
+		 [namespace current]::add_whiteboard_menu_item 47
+    hook::remove chat_create_conference_menu_hook \
+		 [namespace current]::add_whiteboard_menu_item 47
+    hook::remove roster_jid_popup_menu_hook \
+		 [namespace current]::add_whiteboard_menu_item 47
+
+    hook::remove draw_message_hook [namespace current]::handle_wb 1
+
+    variable chats
+    foreach chatid $chats {
+	destroy_win [win_id whiteboard $chatid]
+    }
+
+    namespace delete ::svg
+
+    foreach var [info vars [namespace current]::*] {
+	catch {unset $var}
+    }
+}
+
+package require base64
+catch {package require Img}
+
+uplevel #0 [list source [file join [file dirname [info script]] svgrender.tcl]]
+
 proc wb::add_whiteboard_menu_item {m xlib jid} {
     $m add command -label [::msgcat::mc "Whiteboard"] \
 	-command [list [namespace current]::open_wb $xlib $jid -raise 1]
 }
 
-hook::add chat_create_user_menu_hook \
-    [namespace current]::wb::add_whiteboard_menu_item 47
-hook::add chat_create_conference_menu_hook \
-    [namespace current]::wb::add_whiteboard_menu_item 47
-hook::add roster_jid_popup_menu_hook \
-    [namespace current]::wb::add_whiteboard_menu_item 47
-
 proc wb::open_wb {xlib jid args} {
-    global dofill
-
     set raise 0
     foreach {key val} $args {
 	switch -- $key {
@@ -57,8 +96,9 @@
     pack $sw -side right -fill both -expand yes
     set c [canvas $w.c -background white]
     $sw setwidget $c
-    #pack $c -side right -fill both -expand yes
 
+    bind $c <Destroy> [namespace code [list clean_wb $chatid]]
+
     bindscroll $c
 
     set tb [frame $w.tb]
@@ -133,7 +173,8 @@
     #frame $w.tb.spacer1 -relief sunken -bd 1 -height 2 -highlightthickness 0
     #pack $w.tb.spacer1 -side bottom -anchor w -fill x -pady 1m
 
-    set [namespace current]::text_set_fr($chatid) $w.tb
+    variable text_set_fr
+    set text_set_fr($chatid) $w.tb
     label $w.tb.example_char -text A
     pack $w.tb.example_char -side bottom -fill x
 
@@ -152,7 +193,8 @@
 
     frame $w.tb.fill
 
-    checkbutton $w.tb.dofill -text [::msgcat::mc "Fill"] -variable dofill
+    checkbutton $w.tb.dofill -text [::msgcat::mc "Fill"] \
+	    -variable [namespace current]::dofill
     pack $w.tb.dofill -side left -in $w.tb.fill
 
     canvas $w.tb.fillcolor -background \#FFFFFF -height 5m -width 5m
@@ -205,11 +247,33 @@
 	[list [namespace current]::change_width \
 	     $w.tb.color [namespace current]::width($chatid)]
 
+    variable chats
+    lappend chats $chatid
+
     variable tool
     set tool($chatid) move
     move_bind $c $chatid
 }
 
+proc wb::clean_wb {chatid} {
+    variable width
+    variable tool
+    variable balloon
+    variable text_set_fr
+    variable chats
+    variable text_entered
+
+    if {[set idx [lsearch -exact $chats $chatid]] >= 0} {
+	set chats [lreplace $chats $idx $idx]
+    }
+
+    catch {unset width($chatid)}
+    catch {unset tool($chatid)}
+    catch {unset balloon($chatid)}
+    catch {unset text_set_fr($chatid)}
+    catch {unset text_entered($chatid)}
+}
+
 proc wb::balloon {chatid c action X Y} {
     variable balloon
 
@@ -263,11 +327,13 @@
 }
 
 proc wb::get_text_color {chatid} {
-    [set [namespace current]::text_set_fr($chatid)].example_char cget -foreground
+    variable text_set_fr
+    $text_set_fr($chatid).example_char cget -foreground
 }
 
 proc wb::get_text_font {chatid} {
-    [set [namespace current]::text_set_fr($chatid)].example_char cget -font
+    variable text_set_fr
+    $text_set_fr($chatid).example_char cget -font
 }
 
 proc wb::get_fill_color {chatid} {
@@ -364,7 +430,6 @@
 	}
     }
 }
-hook::add draw_message_hook [namespace current]::wb::handle_wb 1
 
 proc wb::parse_item {chatid from seconds item} {
     set w [win_id whiteboard $chatid]
@@ -622,7 +687,6 @@
     }
 }
 
-
 proc wb::line_b3 {c chatid} {
     variable line
 
@@ -680,7 +744,7 @@
     variable polygon
     variable line1
     variable line2
-    global dofill
+    variable dofill
 
     set x [$c canvasx $x]
     set y [$c canvasy $y]
@@ -730,12 +794,11 @@
     }
 }
 
-
 proc wb::polygon_b3 {c chatid} {
     variable polygon
     variable line1
     variable line2
-    global dofill
+    variable dofill
 
     catch {
 	unset polygon(drawed)
@@ -795,7 +858,7 @@
 
 proc wb::rectangle_b1 {c chatid x y} {
     variable rectangle
-    global dofill
+    variable dofill
 
     set x [$c canvasx $x]
     set y [$c canvasy $y]
@@ -901,7 +964,7 @@
 
 proc wb::circle_b1 {c chatid x y} {
     variable circle
-    global dofill
+    variable dofill
 
     set cx [$c canvasx $x]
     set cy [$c canvasy $y]
@@ -1308,10 +1371,11 @@
 proc wb::text_ok {wt c chatid} {
     variable app_font
     variable text_info
+    variable text_entered
+
     set id [create_id]
+    set text $text_entered($chatid)
 
-    set text [set [namespace current]::text_entered($chatid)]
-
     set attrs [list id $id x $text_info(x) y $text_info(y) \
 		   fill [get_text_color $chatid]]
     set font [get_text_font $chatid]



More information about the Tkabber-dev mailing list