[Pkg-privacy-commits] [msva-perl] 150/356: more cleanup on prompt info

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository msva-perl.

commit 3662f0bb2980f5ad9c7ac1e5cd52672ad5c20aeb
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Wed Oct 6 22:59:15 2010 -0400

    more cleanup on prompt info
---
 Crypt/Monkeysphere/MSVA/MarginalUI.pm |  34 ++++++++++++++++++++++++++--------
 monkeysphere-icon.png                 | Bin 0 -> 937 bytes
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/Crypt/Monkeysphere/MSVA/MarginalUI.pm b/Crypt/Monkeysphere/MSVA/MarginalUI.pm
index 843ff27..12a7bb3 100755
--- a/Crypt/Monkeysphere/MSVA/MarginalUI.pm
+++ b/Crypt/Monkeysphere/MSVA/MarginalUI.pm
@@ -94,23 +94,33 @@
           # We now know the list of fully/ultimately-valid
           # certifiers, and a separate list of marginally-valid
           # certifiers.
-          if ($#valid_certifiers == -1) {
+          if ($#valid_certifiers < -1) {
             msvalog('info', "No valid certifiers, so no marginal UI\n");
           } else {
             my $certifier_list = join("\n", map { sprintf("[%s] %s", $_->{key_id}, $_->{user_id}) } @valid_certifiers);
-            my $msg = sprintf("The matching key for [%s] is not %svalid.\n----------\nhost: %s\nkey fingerprint: 0x%.40s\nvalidity: %s\n----------\nThe certificate is certified by the following people:\n\n%s\n\nWould you like to temporarily accept this certification?",
+            my $msg = sprintf("The matching key for [%s] is not %svalid.
+----------
+The certificate is certified by:
+
+%s
+
+Would you like to temporarily accept this certification?",
                               $uid,
                               ('m' == $keyfpr->{val} ? 'fully ' : ''),
-			      $uid,
-                              $keyfpr->{fpr}->as_hex_string,
-			      $keyfpr->{val},
                               $certifier_list,
                              );
+            my $tip = sprintf("Peer: %s
+Key fingerprint: 0x%.40s
+GnuPG calculated validity: %s",
+			      $uid,
+                              $keyfpr->{fpr}->as_hex_string,
+			      $keyfpr->{val});
             # FIXME: what about revoked certifications?
             # FIXME: what about expired certifications?
             # FIXME: what about certifications ostensibly made in the future?
             msvalog('info', "%s\n", $msg);
-            my $resp = prompt($msg);
+            msvalog('verbose', "%s\n", $tip);
+            my $resp = prompt($uid, $msg, $tip);
             if ($resp) {
               return $resp;
             }
@@ -124,11 +134,13 @@
   }
 
   sub prompt {
+    my $peer = shift;
     my $labeltxt = shift;
+    my $tip = shift;
 
     Gtk2->init();
     # create a new dialog with some buttons - one stock, one not.
-    my $dialog = Gtk2::Dialog->new('Monkeysphere validation agent',
+    my $dialog = Gtk2::Dialog->new(sprintf('Monkeysphere validation agent [%s]', $peer),
 				    undef,
 				    [],
 				    'gtk-no' => 'cancel',
@@ -140,10 +152,16 @@
     # make the text in the dialog box selectable
     $label->set('selectable', 1);
     $label->show();
+    my $tooltips = Gtk2::Tooltips->new();
+    $tooltips->set_tip($label, $tip);
     $dialog->get_content_area()->add($label);
     my $resp = 0;
 
-    $dialog->set_default_response ('cancel');
+    my $icon_file = '/usr/share/pixmaps/monkeysphere-icon.png';
+
+    $dialog->set_default_icon_from_file($icon_file)
+      if (-r $icon_file);
+    $dialog->set_default_response('cancel');
 
     my $response = $dialog->run();
     if ($response eq 'ok') {
diff --git a/monkeysphere-icon.png b/monkeysphere-icon.png
new file mode 100644
index 0000000..13b5efc
Binary files /dev/null and b/monkeysphere-icon.png differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git



More information about the Pkg-privacy-commits mailing list