summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakproxy
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakproxy')
-rwxr-xr-xperl-install/standalone/drakproxy107
1 files changed, 107 insertions, 0 deletions
diff --git a/perl-install/standalone/drakproxy b/perl-install/standalone/drakproxy
new file mode 100755
index 000000000..1bd02ac77
--- /dev/null
+++ b/perl-install/standalone/drakproxy
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+
+#
+# DindinX (odin@mandrakesoft.com)
+#
+# Copyright 2001 MandrakeSoft
+#
+# This software may be freely redistributed under the terms of the GNU
+# public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+use lib qw(/usr/lib/libDrakX);
+
+use common qw(:common :system :file);
+use interactive;
+use standalone;
+use log;
+use c;
+# use netconnect;
+# use detect_devices;
+
+$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
+
+local $_ = join '', @ARGV;
+
+/-h/ and die "usage: drakproxy [--version]\n";
+/-version/ and die 'version: drakproxy 1.0 2001/05/22 dindinx'."\n";
+$::isEmbedded or $::isWizard = 1;
+$::Wizard_pix_up = "wiz_drakgw.png"; # FIXME
+$::Wizard_title = _("Proxy handling");
+
+my $in = interactive::vnew('su', 'default');
+
+pur_gtk_mode() if $::isEmbedded && ref($in) =~ /gtk/;
+
+begin:
+
+$::Wizard_no_previous = 1;
+
+$in->ask_okcancel(_("Proxy configuration"), _("blabla proxy"), 1) or quit_global($in, 0);
+
+my $url = $in->ask_from_entry($url, _("foo"), _("url"));
+print STDERR $url, "\n";
+
+undef $::Wizard_no_previous;
+
+log::l("[drakproxy] Installation complete, exiting\n");
+quit_global($in, 0);
+
+sub quit_global {
+ my ($in, $exitcode) = @_;
+ $in->exit($exitcode);
+ goto begin
+}
+
+sub pur_gtk_mode
+{
+ 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(_("Proxy configuration"));
+ $window1->border_width(10);
+ 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(
+_("Welcome to the Proxy Connection utility!
+
+Click on Configure to launch the setup wizard."));
+ $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/drakgw --wizard");
+ });
+ $bbox1->add($button_conf);
+ my $button_cancel = new Gtk::Button _("Cancel");
+ $button_cancel->signal_connect ( clicked => sub {
+ kill(USR1, $::CCPID);
+ });
+ $bbox1->add($button_cancel);
+ $window1->show_all();
+ Gtk->main_iteration while Gtk->events_pending;
+ $::isEmbedded and kill USR2, $::CCPID;
+ Gtk->main;
+ Gtk->exit(0);
+
+}
+
+#-------------------------------------------------
+#- $Log$
+#- Revision 1.1 2001/06/11 15:22:41 odin
+#- first import of drakproxy
+#-
+#-