summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-08-29 10:50:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-08-29 10:50:53 +0000
commitc9917cd2dfe27177b7fe9ba1fdd7bf522b230e74 (patch)
treebf8b50893aa0ea7b6890d3951a1eab78e574c82a
parent70f03ac0b9c33dcb846bb7e263f407f385039196 (diff)
downloaddrakx-c9917cd2dfe27177b7fe9ba1fdd7bf522b230e74.tar
drakx-c9917cd2dfe27177b7fe9ba1fdd7bf522b230e74.tar.gz
drakx-c9917cd2dfe27177b7fe9ba1fdd7bf522b230e74.tar.bz2
drakx-c9917cd2dfe27177b7fe9ba1fdd7bf522b230e74.tar.xz
drakx-c9917cd2dfe27177b7fe9ba1fdd7bf522b230e74.zip
create destroy_previous_popped_and_reuse_window() out of _gtk__MagicWindow()
and rename var (to make it more clear)
-rw-r--r--perl-install/mygtk2.pm20
1 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 7d901b622..679027618 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -673,7 +673,14 @@ sub _gtk_any_Window {
$w;
}
-my $previous_popped_window;
+my $previous_popped_and_reuse_window;
+
+sub destroy_previous_popped_and_reuse_window() {
+ $previous_popped_and_reuse_window or return;
+
+ $previous_popped_and_reuse_window->destroy;
+ $previous_popped_and_reuse_window = undef;
+}
sub _gtk__MagicWindow {
my ($w, $opts) = @_;
@@ -693,13 +700,12 @@ sub _gtk__MagicWindow {
} else {
$sub_child ||= gtknew('VBox');
}
- if ($previous_popped_window && !$pop_and_reuse) {
- $previous_popped_window->destroy;
- $previous_popped_window = undef;
+ if (!$pop_and_reuse) {
+ destroy_previous_popped_and_reuse_window();
}
- if ($previous_popped_window && $pop_and_reuse) {
- $w = $previous_popped_window;
+ if ($previous_popped_and_reuse_window && $pop_and_reuse) {
+ $w = $previous_popped_and_reuse_window;
$w->remove($w->child);
gtkadd($w, child => $sub_child);
@@ -708,7 +714,7 @@ sub _gtk__MagicWindow {
$opts->{child} = $sub_child;
$w = _create_Window($opts, pop_and_reuse => $pop_and_reuse);
- $previous_popped_window = $w if $pop_and_reuse;
+ $previous_popped_and_reuse_window = $w if $pop_and_reuse;
} else {
if (!$::WizardWindow) {