summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-12-03 14:46:03 +0000
committerThierry Vignaud <tv@mandriva.org>2008-12-03 14:46:03 +0000
commit7036fc32ad07f350075de3c00cff9f8d26420214 (patch)
treef75d33a0853b1bf5b57158dbb17caf901b7d236f
parentd98548f475fef0715063ec2fe870ea92acbda647 (diff)
downloadmgaonline-7036fc32ad07f350075de3c00cff9f8d26420214.tar
mgaonline-7036fc32ad07f350075de3c00cff9f8d26420214.tar.gz
mgaonline-7036fc32ad07f350075de3c00cff9f8d26420214.tar.bz2
mgaonline-7036fc32ad07f350075de3c00cff9f8d26420214.tar.xz
mgaonline-7036fc32ad07f350075de3c00cff9f8d26420214.zip
(really_prepare_add_restricted) old prepare_add_restricted() got renamed
(prepare_add_restricted) moved from mdkapplet-restricted-helper into mdkapplet so that we can explain what is restricted media before actually asking for root privileges
-rw-r--r--NEWS3
-rwxr-xr-xmdkapplet23
-rwxr-xr-xmdkapplet-restricted-helper22
3 files changed, 26 insertions, 22 deletions
diff --git a/NEWS b/NEWS
index 8e848252..b6149204 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- mdkapplet
+ o explain what is restricted media before actually asking for root
+ privileges
- mdkapplet-restricted-helper
o fix banners' titles
o rephrase some strings (explaining what are restricted media)
diff --git a/mdkapplet b/mdkapplet
index 5d05e48c..bdae414a 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -702,6 +702,27 @@ sub is_restricted_media_configured {
@restricted_media > 2 && (grep { /Restricted Updates/ } @names) && (grep { /Restricted/ && !/Updates/ } @names);
}
-sub prepare_add_restricted() {
+sub really_prepare_add_restricted() {
$mdv_update_pid = run_program::raw({ detach => 1 }, 'mdkapplet-restricted-helper');
}
+
+sub prepare_add_restricted() {
+ my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_RESTRICTED});
+ return if $warn_me;
+ my $w = new_portable_dialog(N("New medium available"));
+ my $res =
+ fill_n_run_portable_dialog(
+ $w,
+ [
+ get_banner(N("New medium available")),
+ gtknew('Label_Left', text =>
+ N("You use '%s' distribution and therefore have privileged access to additional software.",
+ N("Mandriva PowerPack")) . "\n\n" .
+ N("Do you want to install this additional software repository?"), @common),
+ gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me),
+ create_okcancel($w, N("Next"), N("Cancel")),
+ ]);
+ setVar('DO_NOT_ASK_FOR_RESTRICTED', bool2text($warn_me));
+ $local_config{DO_NOT_ASK_FOR_RESTRICTED} = bool2text($warn_me);
+ $res ? really_prepare_add_restricted() : 0;
+}
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper
index 15df62b1..7835fd92 100755
--- a/mdkapplet-restricted-helper
+++ b/mdkapplet-restricted-helper
@@ -48,30 +48,10 @@ foreach my $opt (@ARGV) {
}
}
-prepare_add_restricted();
+get_restricted_authentication();
ugtk2::exit(0);
-sub prepare_add_restricted() {
- my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_RESTRICTED});
- return if $warn_me;
- my $w = new_portable_dialog(N("New medium available"));
- my $res =
- fill_n_run_portable_dialog(
- $w,
- [
- get_banner(N("New medium available")),
- gtknew('Label_Left', text =>
- N("You use '%s' distribution and therefore have privileged access to additional software.",
- N("Mandriva PowerPack")) . "\n\n" .
- N("Do you want to install this additional software repository?"), @common),
- gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me),
- create_okcancel($w, N("Next"), N("Cancel")),
- ]);
- setVar('DO_NOT_ASK_FOR_RESTRICTED', bool2text($warn_me));
- $local_config{DO_NOT_ASK_FOR_RESTRICTED} = bool2text($warn_me);
- $res ? get_restricted_authentication() : 0;
-}
sub get_restricted_authentication() {
my $w = ugtk2->new(N("Adding an additional package medium"), width => $width + 20);