From 3662f0bb2980f5ad9c7ac1e5cd52672ad5c20aeb Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 6 Oct 2010 22:59:15 -0400 Subject: [PATCH] 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(-) create mode 100644 monkeysphere-icon.png 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 0000000000000000000000000000000000000000..13b5efc993274d57c6d373fa7cf0b54c09331ee7 GIT binary patch literal 937 zcmV;a16KTrP)Px&V@X6oR5;6JlU+<(bpXZBz5joE+k0;>rMECx_~-`(MkkV4FrwL**^F6O)Wk$x z%-rGf7DgEwkdvC8# zB%r^i^Kf!<9?oH~i+4{RBbiz~B)MD{0=+%Y91Qj%SJqYDZap7cTfh9_$6qM;4`fHY zIeOd+p1=Uk^>e>(cC11a&{Poj`UW#wEQS?skyE5n_O(|$vVU7SPX3@%(L+x_Isn1RipK8f2?I*vy?@#o* zv|g?=L>3prs2Fur${KhyacLA4IBuvGf_;j=lEp8_^{!wt}`V}}6QwqJE@uhP4 zgqx!bvc)QhQ9)majAKC-gFOLwyPP=CP=p+)VIUNM^3$IXLEphn6-!_-D_-e;^1CNn(8ZF{b}ohG_x`qxpwh_cp#H6O-2> zl(Sy1)p0VDD@e6!4ci(EUuz?p8YRsAItj6ofY}YE*ea004$zzhzmbR5uJn;~DG=JcV{n zfzz%dX}X~1i|~59QHJYO0{5(ziv*%v(ABy~(NB$Zr3?BJo?{e}{Y{00000 LNkvXXu0mjf7m2i- literal 0 HcmV?d00001 -- 2.26.2