<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
- <signal name="clicked" handler="Crypt::Monkeysphere::MSVA::MarginalUI::on_yesButton_clicked"/>
+ <signal name="clicked" handler="on_yesButton_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
- <signal name="clicked" handler="Crypt::Monkeysphere::MSVA::MarginalUI::on_noButton_clicked" object="no"/>
+ <signal name="clicked" handler="on_noButton_clicked" object="no"/>
</widget>
<packing>
<property name="expand">False</property>
-#!/usr/bin/perl -w
-
#----------------------------------------------------------------------
# marginalUI
#
{ package Crypt::Monkeysphere::MSVA::MarginalUI;
-use strict;
-use warnings;
-
-use Gtk2 '-init'; # auto-initializes Gtk2
-use Gtk2::GladeXML;
+ use strict;
+ use warnings;
-my $glade;
-my $label;
+ my $resp = 0;
-# populate UI from
-$glade = Gtk2::GladeXML->new("Crypt/Monkeysphere/MSVA/MarginalUI.glade");
+ sub prompt {
+ use Gtk2 '-init'; # auto-initializes Gtk2
+ use Gtk2::GladeXML;
-# Connect the signals
-$glade->signal_autoconnect_from_package('main');
+ my $glade;
+ my $label;
-$label = $glade->get_widget('messageLabel');
-my $labeltxt = <<'END';
-pub 4096R/E27BAABC 2007-01-08 [expires: 2012-01-07]
-uid [ full ] Jameson Graef Rollins <jrollins@finestructure.net>
-uid [ full ] Jameson Graef Rollins <jrollins@phys.columbia.edu>
-uid [ full ] Jameson Graef Rollins <jrollins@fifthhorseman.net>
-uid [ full ] Jameson Graef Rollins <jrollins@astro.columbia.edu>
-uid [ full ] Jameson Rollins <jrollins@fifthhorseman.net>
-uid [ full ] Jameson Graef Rollins <jameson.rollins@ligo.org>
-uid [ full ] [jpeg image of size 4097]
-uid [marginal] Jameson Rollins <jrollins@finestructure.net>
-sub 4096R/1321E689 2007-01-09 [expires: 2012-01-08]
-sub 2048R/4414A10A 2008-06-18 [expires: 2013-06-17]
+ # populate UI from
+ $glade = Gtk2::GladeXML->new("Crypt/Monkeysphere/MSVA/MarginalUI.glade");
-Do you trust this dude?
-END
-$label->set_text($labeltxt);
+ # Connect the signals
+ $glade->signal_autoconnect_from_package('Crypt::Monkeysphere::MSVA::MarginalUI');
+ $label = $glade->get_widget('messageLabel');
-# Start it up
-Gtk2->main;
+ my $labeltxt = shift;
+ $label->set_text($labeltxt);
-exit 0;
+ # Start it up
+ Gtk2->main;
-sub on_yesButton_clicked {
- exit 0;
-}
-sub on_noButton_clicked {
- exit 1;
-}
+ return $resp;
+ }
-1;
+ sub on_yesButton_clicked {
+ $resp = 1;
+ Gtk2->main_quit;
+ }
+ sub on_noButton_clicked {
+ Gtk2->main_quit;
+ }
+ 1;
}
$certifier_list,
);
msvalog('info', "%s\n", $msg);
+ my $resp = Crypt::Monkeysphere::MSVA::MarginalUI::prompt($msg);
+ msvalog('info', "response: %s\n", $resp);
+ if ($resp) {
+ $ret->{valid} = JSON::true;
+ $ret->{message} = sprintf('Manually validated "%s" through the OpenPGP Web of Trust.', $uid);
+ }
}
# FIXME: not doing anything with @marginal_certifiers
# -- that'd be yet more queries to gpg :(