[Tkabber-dev] r2108 - in trunk/tkabber-plugins: . otr otr/tclotr

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Jan 27 10:54:09 MSK 2014


Author: sergei
Date: 2014-01-27 10:54:09 +0400 (Mon, 27 Jan 2014)
New Revision: 2108

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/key.tcl
   trunk/tkabber-plugins/otr/tclotr/key.tcl
Log:
	* otr/key.tcl: Show dialog if importing DSA key fails.

	* otr/tclotr/otr.key: Fixed typo.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-27 06:25:36 UTC (rev 2107)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-27 06:54:09 UTC (rev 2108)
@@ -8,6 +8,10 @@
 	* otr/key.tcl: Fixed collecting jids from current connections to show
 	  in key management dialog.
 
+	* otr/key.tcl: Show dialog if importing DSA key fails.
+
+	* otr/tclotr/otr.key: Fixed typo.
+
 2014-01-26  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/tclotr/otr.tcl: Fixed refreshing private connection if the

Modified: trunk/tkabber-plugins/otr/key.tcl
===================================================================
--- trunk/tkabber-plugins/otr/key.tcl	2014-01-27 06:25:36 UTC (rev 2107)
+++ trunk/tkabber-plugins/otr/key.tcl	2014-01-27 06:54:09 UTC (rev 2108)
@@ -309,9 +309,19 @@
 				      [list [::msgcat::mc "All files"] *]]]
     if {$filename == ""} return
 
-    if {![file readable $filename]} return
+    if {![file readable $filename]} {
+	MessageDlg .otrfileunreadable -aspect 50000 -icon error \
+	    -message [::msgcat::mc "Can't open the key file \"%s\"" $filename] \
+	    -type user -buttons ok -default 0 -cancel 0
+	return
+    }
 
-    if {[catch {::otr::key::readPEM $filename} key]} return
+    if {[catch {::otr::key::readPEM $filename} key]} {
+	MessageDlg .otrfileunreadable -aspect 50000 -icon error \
+	    -message [::msgcat::mc "Can't import DSAkey from the file \"%s\": %s" $filename $key] \
+	    -type user -buttons ok -default 0 -cancel 0
+	return
+    }
 
     dict set Keys $keyjid $key
     store $Keys

Modified: trunk/tkabber-plugins/otr/tclotr/key.tcl
===================================================================
--- trunk/tkabber-plugins/otr/tclotr/key.tcl	2014-01-27 06:25:36 UTC (rev 2107)
+++ trunk/tkabber-plugins/otr/tclotr/key.tcl	2014-01-27 06:54:09 UTC (rev 2108)
@@ -99,7 +99,7 @@
 #       Error is raised if file can't be read or decoding is failed.
 
 proc ::otr::key::readPEM {filename} {
-    set fd [open $file]
+    set fd [open $filename]
     set data [read $fd]
     close $fd
     decodePEM $data



More information about the Tkabber-dev mailing list