summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Victor Duarte Martins <jvictor@mandriva.com>2010-05-11 07:49:24 +0000
committerJoão Victor Duarte Martins <jvictor@mandriva.com>2010-05-11 07:49:24 +0000
commitf409b90b3772150a9a58c55124d162108d2ff4cc (patch)
tree455c7f8f66f9a7c4ba13420e284c2b12d6cedd9c
parent228691cb541a671a1e5657b77bc5dfce0f9d8079 (diff)
downloadmgaonline-f409b90b3772150a9a58c55124d162108d2ff4cc.tar
mgaonline-f409b90b3772150a9a58c55124d162108d2ff4cc.tar.gz
mgaonline-f409b90b3772150a9a58c55124d162108d2ff4cc.tar.bz2
mgaonline-f409b90b3772150a9a58c55124d162108d2ff4cc.tar.xz
mgaonline-f409b90b3772150a9a58c55124d162108d2ff4cc.zip
`cat svn-commit.tmp`
-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);
}
}