aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-04-27 13:55:50 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-04-27 13:55:50 +0000
commitc4be0b292f25a0019aece761543e20e75b7e6e78 (patch)
treec131652fd453c9f93b9ccab08847289cac291d6a
parente28e44e96ecc435476475cddbc67cae735d34064 (diff)
downloadrpmdrake-c4be0b292f25a0019aece761543e20e75b7e6e78.tar
rpmdrake-c4be0b292f25a0019aece761543e20e75b7e6e78.tar.gz
rpmdrake-c4be0b292f25a0019aece761543e20e75b7e6e78.tar.bz2
rpmdrake-c4be0b292f25a0019aece761543e20e75b7e6e78.tar.xz
rpmdrake-c4be0b292f25a0019aece761543e20e75b7e6e78.zip
Prompt for credentials in rpmdrake/edit-urpm-media too
-rw-r--r--rpmdrake.pm34
1 files changed, 33 insertions, 1 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 236a05aa..aeecf930 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -24,6 +24,7 @@ package rpmdrake;
use lib qw(/usr/lib/libDrakX);
use standalone; #- warning, standalone must be loaded very first, for 'explanations'
use urpm::download ();
+use urpm::prompt;
use MDK::Common;
use MDK::Common::System;
@@ -93,6 +94,37 @@ our $branded = -f '/etc/sysconfig/oem'
and our %distrib = MDK::Common::System::distrib();
our $myname_update = $rpmdrake::branded ? N("Software Update") : N("Mandrakelinux Update");
+@rpmdrake::prompt::ISA = 'urpm::prompt';
+
+sub rpmdrake::prompt::prompt {
+ my ($self) = @_;
+ my @answers;
+ my $d = ugtk2->new("", grab => 1, transient => 1);
+ $d->{rwindow}->set_position('center_on_parent');
+ gtkadd(
+ $d->{window},
+ gtkpack(
+ Gtk2::VBox->new(0, 5),
+ Gtk2::WrappedLabel->new($self->{title}),
+ (map { gtkpack(
+ Gtk2::HBox->new(0, 5),
+ Gtk2::Label->new($self->{prompts}[$_]),
+ $answers[$i] = gtkentry(),
+ ) } 0 .. $#{$self->{prompts}}),
+ gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub { Gtk2->main_quit }),
+ ),
+ );
+ $d->main;
+ map { $_->get_text } @answers;
+}
+
+$urpm::download::PROMPT_PROXY = new rpmdrake::prompt(
+ N("Please enter your credentials for accessing proxy\n"),
+ [ N("User name:"), N("Password:") ],
+ undef,
+ [ 0, 1 ],
+);
+
sub translate {
my ($s) = @_;
my $r = '';
@@ -655,7 +687,7 @@ sub update_sources_interactive {
Gtk2::Label->new(N("Select the media you wish to update:")),
(
@buttons = map {
- Gtk2::CheckButton->new_with_label($_->{name})
+ Gtk2::CheckButton->new_with_label($_->{name});
} grep { ! $_->{ignore} } @{$urpm->{media}}
),
Gtk2::HSeparator->new,