_EOD
+sub app_quit {
+ my ($exit_code) = @_;
+
+ Gtk3->main_quit() if Gtk3->main_level() > 0;
+
+ # reap left over zombie processes
+ while ((my $child = waitpid(-1, POSIX::WNOHANG)) > 0) {
+ print "reaped child $child\n";
+ }
+ exit($exit_code);
+}
+
sub detect_country {
print "trying to detect country...\n";
my $cpid = open2(my $TRACEROUTE_FH, undef, "traceroute -N 1 -q 1 -n 8.8.8.8");
die "could not rename VG from '$vg->{pvs}' ($vg_uuid) to '$new_vgname'!\n";
}
} else {
- set_next("_Reboot", sub { exit (0); } );
+ set_next("_Reboot", sub { app_quit(0); } );
display_html("fail.htm");
die "Cancled installation by user, due to already existing volume group '$vgname'\n";
}
$window = Gtk3::Window->new();
$window->set_default_size(1024, 768);
- $window->set_has_resize_grip(0);
+ $window->signal_connect(map => sub { $window->set_resizable(0); });
$window->fullscreen() if !is_test_mode();
$window->set_decorated(0) if !is_test_mode();
+ $window->signal_connect(destroy => sub { Gtk3->main_quit(); });
my $vbox = Gtk3::Box->new('vertical', 0);
# $f1->set_shadow_type ('none');
# $hbox->pack_start ($f1, 1, 1, 0);
- my $sep1 = Gtk3::HSeparator->new();
+ my $sep1 = Gtk3::Separator->new('horizontal');
$vbox->pack_start($sep1, 0, 0, 0);
$cmdbox = Gtk3::Box->new('horizontal', 0);
my $abort = Gtk3::Button->new('_Abort');
$abort->set_can_focus(0);
$cmdbox->pack_start($abort, 0, 0, 10);
- $abort->signal_connect(clicked => sub { exit (-1); });
+ $abort->signal_connect(clicked => sub { app_quit(-1); });
my $vbox2 = Gtk3::Box->new('vertical', 0);
$hbox->add($vbox2);
my $vbox3 = Gtk3::Box->new('vertical', 0);
$vbox2->pack_start($vbox3, 0, 0, 0);
- my $sep2 = Gtk3::HSeparator->new;
+ my $sep2 = Gtk3::Separator->new('horizontal');
$vbox3->pack_start($sep2, 0, 0, 0);
$inbox = Gtk3::Box->new('horizontal', 0);
$window->add($vbox);
$window->show_all;
- $window->realize();
+ $window->present();
}
sub cleanup_view {
$row++;
- my $sep = Gtk3::HSeparator->new();
+ my $sep = Gtk3::Separator->new('horizontal');
$sep->set_visible(1);
$grid->attach($sep, 0, $row, 2, 1);
$row++;
&$switch_view();
});
- my $sep2 = Gtk3::HSeparator->new();
+ my $sep2 = Gtk3::Separator->new('horizontal');
$sep2->set_visible(1);
$contarea->pack_end($sep2, 1, 1, 10);
$next->set_sensitive(1);
- set_next("_Reboot", sub { exit (0); } );
+ set_next("_Reboot", sub { app_quit(0); } );
if ($err) {
display_html("fail.htm");
$autoreboot_seconds--;
display_html("success.htm");
} else {
- exit(0);
+ app_quit(0);
}
});
}
print "no harddisks found\n";
$initial_error = 1;
display_html("nohds.htm");
- set_next("Reboot", sub { exit(0); } );
+ set_next("Reboot", sub { app_quit(0); } );
} else {
foreach my $hd (@$cached_disks) {
my ($disk, $devname) = @$hd;
print "no network interfaces found\n";
$initial_error = 1;
display_html("nonics.htm");
- set_next("Reboot", sub { exit(0); } );
+ set_next("Reboot", sub { app_quit(0); } );
}
create_intro_view () if !$initial_error;
Gtk3->main;
-# reap left over zombie processes
-while ((my $child = waitpid(-1, POSIX::WNOHANG)) > 0) {
- print "reaped child $child\n";
-}
-
-exit 0;
+app_quit(0);