summaryrefslogtreecommitdiffstats
path: root/mdkapplet-restricted-helper
diff options
context:
space:
mode:
Diffstat (limited to 'mdkapplet-restricted-helper')
-rwxr-xr-xmdkapplet-restricted-helper31
1 files changed, 18 insertions, 13 deletions
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper
index ae45ee77..3a1ab8b5 100755
--- a/mdkapplet-restricted-helper
+++ b/mdkapplet-restricted-helper
@@ -63,20 +63,25 @@ get_restricted_authentication();
ugtk2::exit(0);
+my $email;
sub get_restricted_authentication() {
my $w = ugtk2->new(N("Adding an additional package medium"), width => $width + 20);
my ($password_w, $email_w, $password);
+ my $clicked;
$password_w = gtknew('Entry');
$password_w->set_visibility(0);
- # WARNING: WON'T WORK IF EVER EMBEDDED
- $w->{real_window}->signal_connect(destroy => sub { $password = $password_w->get_text });
+ $email_w = gtknew('Entry', text => $email);
- my $res =
- fill_n_run_portable_dialog(
- $w,
- [
+ $w->{ok_clicked} = sub {
+ $password = $password_w->get_text;
+ $email = $email_w->get_text;
+ $clicked = 1;
+ Gtk2->main_quit;
+ };
+
+ my @widgets = (
get_banner(N("Adding an additional package medium")),
gtknew('Label_Left', text => N("Please fill in your account ID to add an additional package medium"),
@common),
@@ -85,7 +90,7 @@ sub get_restricted_authentication() {
new_link_button('https://my.mandriva.com/info', N("More information on your user account")))
]),
gtknew('Table', col_spacings => 5, row_spacings => 5, children => [
- [ N("Your email"), $email_w = gtknew('Entry') ],
+ [ N("Your email"), $email_w ],
[ N("Your password"), $password_w ],
]),
gtknew('HButtonBox', layout => 'start', children_tight => [
@@ -93,18 +98,18 @@ sub get_restricted_authentication() {
new_link_button('https://my.mandriva.com/reset/password/', N("Forgotten password")))
]),
create_okcancel($w, N("Next"), N("Cancel")),
- ]);
+ );
+
+ fill_n_run_portable_dialog($w, \@widgets);
- my $email = $email_w->get_text;
- if ($res) {
- if ($email && $password) {
+ if ($clicked) {
+ $clicked = 0;
+ if ($mail && $password) {
add_restricted_medium($email, $password);
} else {
interactive->vnew->ask_warn(N("Error"), N("Password and email cannot be empty."));
goto &get_restricted_authentication;
}
- } else {
- ugtk2::exit(0);
}
}