summaryrefslogtreecommitdiffstats
path: root/perl-install/mygtk2.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-08-22 14:09:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-08-22 14:09:53 +0000
commite6f37b08b1b3bd01f6669a43ec221d01bf956054 (patch)
tree13bfa6e06212ea7738f8026a613b3004a0439575 /perl-install/mygtk2.pm
parente2425d3b80f9154e5e0b44bdc09867adea6c3132 (diff)
downloaddrakx-e6f37b08b1b3bd01f6669a43ec221d01bf956054.tar
drakx-e6f37b08b1b3bd01f6669a43ec221d01bf956054.tar.gz
drakx-e6f37b08b1b3bd01f6669a43ec221d01bf956054.tar.bz2
drakx-e6f37b08b1b3bd01f6669a43ec221d01bf956054.tar.xz
drakx-e6f37b08b1b3bd01f6669a43ec221d01bf956054.zip
- pop wait_messages and ensure same window is used for next wait_messages
(to ensure the background is not greyed,ungreyed,greyed,...)
Diffstat (limited to 'perl-install/mygtk2.pm')
-rw-r--r--perl-install/mygtk2.pm20
1 files changed, 17 insertions, 3 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 657e89d49..d3fc4701e 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -667,6 +667,8 @@ sub _gtk_any_Window {
$w;
}
+my $previous_popped_window;
+
sub _gtk__MagicWindow {
my ($w, $opts) = @_;
@@ -676,6 +678,7 @@ sub _gtk__MagicWindow {
any { !$_->isa('Gtk2::DrawingArea') && $_->visible } $::WizardTable->get_children;
};
+ my $pop_and_reuse = delete $opts->{pop_and_reuse} && $pop_it;
my $sub_child = delete $opts->{child};
my $provided_banner = delete $opts->{banner};
@@ -684,11 +687,22 @@ sub _gtk__MagicWindow {
} else {
$sub_child ||= gtknew('VBox');
}
+ if ($previous_popped_window && !$pop_and_reuse) {
+ $previous_popped_window->destroy;
+ $previous_popped_window = undef;
+ }
+
+ if ($previous_popped_window && $pop_and_reuse) {
+ $w = $previous_popped_window;
+ $w->remove($w->child);
- if ($pop_it) {
+ gtkadd($w, child => $sub_child);
+ %$opts = ();
+ } elsif ($pop_it) {
$opts->{child} = $sub_child;
- $w = _create_Window($opts);
+ $w = _create_Window($opts, pop_and_reuse => $pop_and_reuse);
+ $previous_popped_window = $w if $pop_and_reuse;
} else {
if (!$::WizardWindow) {
@@ -729,7 +743,7 @@ sub _gtk__MagicWindow {
}
bless {
real_window => $w,
- child => $sub_child, pop_it => $pop_it,
+ child => $sub_child, pop_it => $pop_it, pop_and_reuse => $pop_and_reuse,
if_($provided_banner, banner => $provided_banner),
}, 'mygtk2::MagicWindow';
}