diff options
-rw-r--r-- | perl-install/mygtk2.pm | 10 | ||||
-rw-r--r-- | perl-install/ugtk2.pm | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index bfb565170..1e6dbfa87 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -646,6 +646,16 @@ sub _icon_paths() { "/usr/lib/libDrakX/icons", "pixmaps", 'standalone/icons', '/usr/share/rpmdrake/icons'); } +sub main { + my ($window, $o_verif) = @_; + my $destroyed; + $window->signal_connect(destroy => sub { $destroyed = 1 }); + $window->show; + do { Gtk2->main } while (!$destroyed && $o_verif && !$o_verif->()); + may_destroy($window); + flush(); +} + sub sync { my ($window) = @_; $window->show; diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 8537b1cfa..e1787f02a 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -880,8 +880,6 @@ sub new { set_main_window_size($o); gtkpack($::WizardTable, $o->{window}); } - $o->{rwindow}->signal_connect(destroy => sub { $o->{destroyed} = 1 }); - $o; } sub set_main_window_size { @@ -893,12 +891,10 @@ sub set_main_window_size { sub main { my ($o, $o_completed, $o_canceled) = @_; gtkset_mousecursor_normal(); - $o->show; - do { - Gtk2->main; - } while (!$o->{destroyed} && ($o->{retval} ? $o_completed && !$o_completed->() : $o_canceled && !$o_canceled->())); - $o->destroy; + $o->show; + mygtk2::main($o->{rwindow}, + sub { $o->{retval} ? !$o_completed || $o_completed->() : !$o_canceled || $o_canceled->() }); $o->{retval}; } sub show($) { |