summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-11-19 14:09:26 +0000
committerThierry Vignaud <tv@mandriva.org>2008-11-19 14:09:26 +0000
commitaae96b3bcb02d678d7db3f175765997959b4edc4 (patch)
treedac6ccff6686003530ec2aaff10fef856540ec09
parent984581fb9c165ea6f05c2602490c290fa52d0722 (diff)
downloadmgaonline-aae96b3bcb02d678d7db3f175765997959b4edc4.tar
mgaonline-aae96b3bcb02d678d7db3f175765997959b4edc4.tar.gz
mgaonline-aae96b3bcb02d678d7db3f175765997959b4edc4.tar.bz2
mgaonline-aae96b3bcb02d678d7db3f175765997959b4edc4.tar.xz
mgaonline-aae96b3bcb02d678d7db3f175765997959b4edc4.zip
(new_portable_dialog,fill_n_run_portable_dialog) split them out of confirm_upgrade()
-rwxr-xr-xmdkapplet35
1 files changed, 22 insertions, 13 deletions
diff --git a/mdkapplet b/mdkapplet
index d1d6b6a7..8239189b 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -353,17 +353,30 @@ sub harvester {
sub configNetwork() { log::explanations(N_("Launching drakconnect\n")); fork_exec("/usr/sbin/drakconnect") }
+sub new_portable_dialog {
+ my ($title) = @_;
+ my $w = ugtk2->new($title, width => $width + 20);
+}
+
+sub fill_n_run_portable_dialog {
+ my ($w, $widgets) = @_;
+
+ # use wizard button order (for both 2008.1 & 2009.0):
+ local $::isWizard = 1;
+ local $w->{pop_it} = 0;
+ local $::isInstall = 1;
+ gtkadd($w->{window}, gtknew('VBox', children_tight => $widgets));
+
+ $w->{ok}->grab_focus;
+ $w->main;
+}
+
sub confirm_upgrade() {
local $mygtk2::left_padding = 0;
- my $w = ugtk2->new(N("New version of Mandriva Linux distribution"), width => $width + 20);
my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE});
- {
- # use wizard button order (for both 2008.1 & 2009.0):
- local $::isWizard = 1;
- local $w->{pop_it} = 0;
- local $::isInstall = 1;
- gtkadd($w->{window},
- gtknew('VBox', children_tight => [
+ my $w = new_portable_dialog(N("New version of Mandriva Linux distribution"));
+ my $res = fill_n_run_portable_dialog($w,
+ [
get_banner(),
gtknew('Label_Left', text => N("A new version of Mandriva Linux distribution has been released."), @common),
gtknew('HButtonBox', layout => 'start', children_tight => [
@@ -373,12 +386,8 @@ sub confirm_upgrade() {
$new_distro->{name} || $new_distro->{version}), @common),
gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me),
create_okcancel($w, N("Next"), N("Cancel")),
- ]),
- );
- }
+ ]);
- $w->{ok}->grab_focus;
- my $res = $w->main;
setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me));
$local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} = bool2text($warn_me);
$res ? really_confirm_upgrade() : 0;