diff options
Diffstat (limited to 'perl-install/share/keymaps_generate')
0 files changed, 0 insertions, 0 deletions
index : drakx | ||
Mageia Installer and base platform for many utilities | Thierry Vignaud [tv] |
summaryrefslogtreecommitdiffstats |
#!/usr/bin/perl
# DrakConnect $Id$
# Copyright (C) 1999-2004 MandrakeSoft
# Damien "Dam's" Krotkine
# Damien "poulpy" Chaumette
# Thierry Vignaud <tvignaud@mandrakesoft.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
use strict;
use lib qw(/usr/lib/libDrakX);
use standalone; #- warning, standalone must be loaded very first, for 'explanations'
use interactive;
use common;
use network::netconnect;
use network::ethernet;
use network::tools;
use network::modem;
use network::network;
use c;
use modules;
use network::isdn;
use network::adsl;
use network::tools;
use MDK::Common::Globals "network", qw($in);
use POSIX ":sys_wait_h";
my ($netcnx, $netc, $intf) = ({}, {}, {});
#my @conx_type = ('modem', 'isdn_internal', 'isdn_external', 'adsl', 'cable', 'lan');
my $in = 'interactive'->vnew('su');
if ($in->isa('interactive::gtk')) {
require ugtk2;
ugtk2->import(qw(:create :dialogs :helpers :wrappers));
}
reread_net_conf();
$::Wizard_title = N("Network & Internet Configuration");
$::Wizard_pix_up = "drakconnect.png";
MDK::Common::Globals::init(in => $in);
local $_ = join '', @ARGV;
/--skip-wizard/ and manage($netc, $intf);
/--add/ and add_intf();
/--del/ and del_intf();
/--old/ and goto old;
if (/--install/) {
$::isInstall = 1;
add_intf()
}
/--internet/ and configure_net($netcnx, $netc, $intf);
# default is to run wizard
add_intf();
old:
my @all_cards;
my $window1 = ugtk2->new('drakconnect');
$window1->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) });
unless ($::isEmbedded) {
$window1->{rwindow}->set_position('center');
$window1->{rwindow}->set_title(N("Network configuration (%d adapters)", scalar @all_cards));
$window1->{rwindow}->set_size_request(-1, -1);
}
$window1->{rwindow}->set_border_width(10);
my $warning_label1;
my ($lan_button, $host_button, $button_apply);
my $hostname = chomp_(`hostname`);
my $int_label = Gtk2::Label->new($netcnx->{type} eq 'lan' ? N("Gateway:") : N("Interface:"));
my $interface_name = Gtk2::Label->new($netcnx->{type} eq 'lan' ? $netc->{GATEWAY} : $netcnx->{NET_INTERFACE});
my $isconnected = -1;
my $int_connect = Gtk2::Button->new(N("Wait please"));
$int_connect->set_sensitive(0);
$int_connect->signal_connect(clicked => sub {
if (!$isconnected) {
if (cat_($network::tools::connect_prog) =~ m|/usr/bin/kppp| && -e '/usr/bin/kppp') {
run_program::run("/usr/bin/kppp &");
} else {
connect_backend();
}
} else {
disconnect_backend();
}
});
my $tree_model = Gtk2::TreeStore->new("Gtk2::Gdk::Pixbuf", map { "Glib::String" } 2..6);
my $list = Gtk2::TreeView->new_with_model($tree_model);
$list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererPixbuf->new, 'pixbuf' => 0));
each_index {
$list->append_column(my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i + 1));
$col->set_sort_column_id($::i);
} (N("Interface"), N("IP address"), N("Protocol"), N("Driver"), N("State"));
$list->signal_connect(button_press_event => sub {
my (undef, $event) = @_;
my (undef, $iter) = $list->get_selection->get_selected;
return unless $iter;
configure_lan() if $event->type eq '2button-press';
});
update_list();
my ($label_host, $int_state);
$window1->{window}->add(
gtkpack_(Gtk2::VBox->new(0,10),
0, gtkpack(Gtk2::HBox->new,
Gtk2::Label->new(N("Hostname: ")),
$label_host = Gtk2::Label->new($hostname),
$host_button = gtksignal_connect(Gtk2::Button->new(N("Configure hostname...")),
clicked => sub {
local ($::isWizard, $::Wizard_finished) = (1, 1);
eval { # For wizcancel
configureNetworkNet($in, $netc, $intf, map { $_->[0] } @all_cards);
$button_apply->set_sensitive(1);
update();
};
if ($@ =~ /wizcancel/) {}