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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Feb 1 18:28:24 MSK 2009


Author: sergei
Date: 2009-02-01 18:28:23 +0300 (Sun, 01 Feb 2009)
New Revision: 1635

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/chats.tcl
   trunk/tkabber/gpgme.tcl
   trunk/tkabber/ifacetk/systray.tcl
   trunk/tkabber/joingrdialog.tcl
   trunk/tkabber/msgs/ru.msg
Log:
	* ifacetk/systray.tcl: Added an option not to show a systray icon on
	  server messages in groupchats (thanks to Ruslan Rakhmanin).

	* gpgme.tcl, msmg/ru.msg: Show all GPG warnings in a separate window
	  (thanks to Konstantin Khomoutov).

	* chats.tcl, joingrdialog.tcl, muc.tcl: Moved focusing chat window
	  into a separate procedure, normalise room JID before joining (thanks
	  to Konstantin Khomoutov).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-01-28 18:37:08 UTC (rev 1634)
+++ trunk/tkabber/ChangeLog	2009-02-01 15:28:23 UTC (rev 1635)
@@ -1,3 +1,15 @@
+2009-02-01  Sergei Golovan  <sgolovan at nes.ru>
+
+	* ifacetk/systray.tcl: Added an option not to show a systray icon on
+	  server messages in groupchats (thanks to Ruslan Rakhmanin).
+
+	* gpgme.tcl, msmg/ru.msg: Show all GPG warnings in a separate window
+	  (thanks to Konstantin Khomoutov).
+
+	* chats.tcl, joingrdialog.tcl, muc.tcl: Moved focusing chat window
+	  into a separate procedure, normalise room JID before joining (thanks
+	  to Konstantin Khomoutov).
+
 2009-01-28  Sergei Golovan  <sgolovan at nes.ru>
 
 	* ifacetk/iface.tcl: Update main window title when chat tab is closed

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2009-01-28 18:37:08 UTC (rev 1634)
+++ trunk/tkabber/chats.tcl	2009-02-01 15:28:23 UTC (rev 1635)
@@ -584,6 +584,13 @@
 
 ###############################################################################
 
+proc chat::activate {chatid} {
+    raise_win [winid $chatid]
+    focus -force [input_win $chatid]
+}
+
+###############################################################################
+
 # This proc is used by the "richtext widget" to query the option DB for
 # it's attributes which are really maintained by the main chat window
 proc chat::query_optiondb {w option} {

Modified: trunk/tkabber/gpgme.tcl
===================================================================
--- trunk/tkabber/gpgme.tcl	2009-01-28 18:37:08 UTC (rev 1634)
+++ trunk/tkabber/gpgme.tcl	2009-02-01 15:28:23 UTC (rev 1635)
@@ -406,7 +406,6 @@
     variable j2k
     variable s2e
     variable warnings
-    variable gpg_error_id
     variable options
 
     once_only $xlib
@@ -417,11 +416,10 @@
         debugmsg ssj "verify processing error ($xlib): $result ($from)"
 
         if {![info exists warnings(verify-traffic,$xlib)]} {
-
             set warnings(verify-traffic,$xlib) 1
-            after idle [list NonmodalMessageDlg .verify_error[psuffix $xlib] -aspect 50000 -icon error \
-                -message [::msgcat::mc "Error in signature verification software: %s." \
-				       $result]]
+	    hook::run gpg_input_error_hook $xlib $from software \
+		[::msgcat::mc "Error in signature verification software: %s." \
+		    $reason]
         }
 
         set params(reason) $result
@@ -474,10 +472,9 @@
 
         if {![info exists warnings(verify,$from)] && $options(display_sig_warnings)} {
             set warnings(verify,$from) 1
-            incr gpg_error_id
-            after idle [list NonmodalMessageDlg .verify_error$gpg_error_id -aspect 50000 -icon error \
-                -message [::msgcat::mc "%s purportedly signed by %s can't be verified.\n\n%s." \
-				       $what $from $result]]
+	    hook::run gpg_input_error_hook $xlib $from $what \
+                [::msgcat::mc "%s purportedly signed by %s can't be verified: %s." \
+				       $what $from $result]
         }
     }
 
@@ -1517,3 +1514,37 @@
 
 ###############################################################################
 
+proc ::ssj::process_gpg_input_error {xlib from what message} {
+    show_error $message
+}
+
+hook::add gpg_input_error_hook ::ssj::process_gpg_input_error 99
+
+proc ::ssj::show_error {message} {
+  set w .gpg_error
+
+  if {![winfo exists $w]} {
+    Dialog $w -title [::msgcat::mc "GPG error"] \
+      -modal none -transient no \
+      -separator 1 -anchor e -default 0
+    $w add -text [::msgcat::mc "Close"] -command [list destroy $w]
+
+    set f [$w getframe]
+    text $f.text -wrap word -yscrollcommand [list $f.vsb set]
+    scrollbar $f.vsb -orient vertical -command [list $f.text yview]
+    grid $f.text $f.vsb -sticky ns
+    grid $f.text -sticky news
+    grid rowconfigure    $f 0 -weight 1
+    grid columnconfigure $f 0 -weight 1
+
+    $w draw
+  }
+
+  set t [$w getframe].text
+  $t configure -state normal
+  $t insert end [format {[%s]: %s} \
+    [clock format [clock seconds]] $message\n\n]
+  $t configure -state disabled
+}
+
+# vim:ts=8:sw=4:sts=4:noet

Modified: trunk/tkabber/ifacetk/systray.tcl
===================================================================
--- trunk/tkabber/ifacetk/systray.tcl	2009-01-28 18:37:08 UTC (rev 1634)
+++ trunk/tkabber/ifacetk/systray.tcl	2009-02-01 15:28:23 UTC (rev 1635)
@@ -29,6 +29,10 @@
     custom::defvar options(blink) 0 \
 	[::msgcat::mc "Systray icon blinks when there are unread messages."] \
 	-group Systray -type boolean
+
+    custom::defvar options(display_muc_change) 1 \
+	[::msgcat::mc "Change icon on server and enter/exit groupchat messages."] \
+	-group Systray -type boolean
 }
 
 ##########################################################################
@@ -282,7 +286,8 @@
 	}
     }
 
-    if {$hitP == 0} {
+    if {($hitP == 0) || \
+    	(($hitP == 1) && !$options(display_muc_change))} {
 	update $icon ::curuserstatus
 	return
     }

Modified: trunk/tkabber/joingrdialog.tcl
===================================================================
--- trunk/tkabber/joingrdialog.tcl	2009-01-28 18:37:08 UTC (rev 1634)
+++ trunk/tkabber/joingrdialog.tcl	2009-02-01 15:28:23 UTC (rev 1635)
@@ -158,12 +158,10 @@
 	set nick [get_group_nick $jid $gr_nick]
     }
 
-    set cw [chat::winid [chat::chatid $xlib $jid]]
+    set group [xmpp::jid::normalize $jid]
+    muc::join_group $xlib $group $nick $password
 
-    muc::join_group $xlib $jid $nick $password
-
-    raise_win $cw
-    focus -force $cw.input
+    chat::activate [chat::chatid $xlib $group]
 }
 
 proc set_our_groupchat_nick {group nick} {
@@ -215,3 +213,4 @@
 
 ###############################################################################
 
+# vim:ts=8:sw=4:sts=4:noet

Modified: trunk/tkabber/msgs/ru.msg
===================================================================
--- trunk/tkabber/msgs/ru.msg	2009-01-28 18:37:08 UTC (rev 1634)
+++ trunk/tkabber/msgs/ru.msg	2009-02-01 15:28:23 UTC (rev 1635)
@@ -64,8 +64,8 @@
 ::msgcat::mcset ru "%s is paused a reply" "%s остановился, набирая ответ"
 ::msgcat::mcset ru "%s msgs" "%s сообщ."
 ::msgcat::mcset ru "%s plugin" "расширение %s"
-::msgcat::mcset ru "%s purportedly signed by %s can't be verified.\n\n%s."\
-	"То, что %s подписано %s, невозможно проверить.\n\n%s."
+::msgcat::mcset ru "%s purportedly signed by %s can't be verified: %s."\
+	"То, что %s подписано %s, невозможно проверить: %s."
 ::msgcat::mcset ru "%s request from %s" "Запрос %s от %s"
 ::msgcat::mcset ru "%s SSL Certificate Info" "Свойства сертификата SSL\
 	сервера %s"
@@ -1208,6 +1208,7 @@
 ::msgcat::mcset ru "OS:" "ОС:"
 ::msgcat::mcset ru "outcast" "изгой"
 ::msgcat::mcset ru "owner" "владелец"
+::msgcat::mcset ru "GPG error" "Ошибка GPG"
 ::msgcat::mcset ru "Pager:" "Пейджер:"
 ::msgcat::mcset ru "Parent group" "Группа уровнем выше"
 ::msgcat::mcset ru "Parent groups" "Группы уровнем выше"



More information about the Tkabber-dev mailing list