From 0e3c6485417709cbc2e80149eedea0082054d512 Mon Sep 17 00:00:00 2001 From: damien Date: Fri, 23 Mar 2001 14:10:48 +0000 Subject: updated wrapper to launch tinyfirewall in embedded mode --- perl-install/standalone/tinyfirewall | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'perl-install') diff --git a/perl-install/standalone/tinyfirewall b/perl-install/standalone/tinyfirewall index f527f58df..17a87436b 100755 --- a/perl-install/standalone/tinyfirewall +++ b/perl-install/standalone/tinyfirewall @@ -29,4 +29,60 @@ $::isWizard = "@ARGV" =~ /--wizard/; local $_ = join '', @ARGV; my $in = vnew interactive('su'); + +$::isEmbedded && ref($in) =~ /gtk/ or goto dd; +require Gtk; +init Gtk; + +my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; +$window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); +$window1->set_position(1); +$window1->set_title(_("Firewalling configuration", @all_cards)); +$window1->border_width(10); +$::isEmbedded or $window1->set_usize(500, 400); +my $vbox1 = new Gtk::VBox(0,0); +$window1->add($vbox1); +my $hbox1 = new Gtk::HBox(0,0); +$vbox1->pack_start($hbox1,1,1,0); +my $label1 = new Gtk::Label(""); +$hbox1->pack_start($label1,1,1,0); +my $hbox2 = new Gtk::HBox(0,0); +$vbox1->pack_start($hbox2,1,1,0); + +my $bbox1 = new Gtk::HButtonBox; +$vbox1->pack_start($bbox1,0,0,0); +$bbox1->set_layout(-end); +my $button_conf = new Gtk::Button _("Configure"); +$button_conf->signal_connect ( clicked => sub { + system("/usr/sbin/tinyfirewall --wizard"); + }); +$bbox1->add($button_conf); +my $button_ok = new Gtk::Button _("OK"); +$button_ok->signal_connect ( clicked => sub { + quit_global(); + }); +$bbox1->add($button_ok); +$window1->show_all(); +update(); +Gtk->main_iteration while Gtk->events_pending; +$::isEmbedded and kill USR2, $::CCPID; +Gtk->main; +Gtk->exit(0); + +sub update { +$label1->set(-e "/etc/rc.d/rc3.d/S05bastille-firewall" ? + _("Firewalling + +You already have set up a firewall. +Click on Configure to change or remove the firewall"): + _("Firewalling + +Click on Configure to set up a standard firewall")); +} + +sub quit_global { + $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0); +} + +dd: tinyfirewall::main($in); -- cgit v1.2.1