summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakconnect
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2003-08-17 14:52:56 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2003-08-17 14:52:56 +0000
commit8a7b44844b82c613bc8ca70d2cae3a9a98dd2bb6 (patch)
tree844789ccac50660397bd4fd154229b4c0ea084e1 /perl-install/standalone/drakconnect
parent9abc28df76fc2b017d979979a077f44f2c032c84 (diff)
downloaddrakx-8a7b44844b82c613bc8ca70d2cae3a9a98dd2bb6.tar
drakx-8a7b44844b82c613bc8ca70d2cae3a9a98dd2bb6.tar.gz
drakx-8a7b44844b82c613bc8ca70d2cae3a9a98dd2bb6.tar.bz2
drakx-8a7b44844b82c613bc8ca70d2cae3a9a98dd2bb6.tar.xz
drakx-8a7b44844b82c613bc8ca70d2cae3a9a98dd2bb6.zip
allow hostname change in mcc
perl_checker
Diffstat (limited to 'perl-install/standalone/drakconnect')
-rwxr-xr-xperl-install/standalone/drakconnect49
1 files changed, 44 insertions, 5 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index b261bb876..599cf168c 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -18,7 +18,8 @@
# 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 diagnostics;
use lib qw(/usr/lib/libDrakX);
@@ -185,10 +186,14 @@ $window1->{window}->add(
0, $button_new,
),
),
- 0, gtkpack_(Gtk2::HBox->new(0,0),
- 0, new Gtk2::Label(N("Hostname: ")),
- 0, $label_host = new Gtk2::Label($hostname),
- ),
+ 0, gtkpack_(Gtk2::HBox->new(1,0),
+ 0, gtkpack_(Gtk2::HBox->new(0,0),
+ 0, new Gtk2::Label(N("Hostname: ")),
+ 0, $label_host = new Gtk2::Label($hostname),
+ ),
+ 0, gtksignal_connect(Gtk2::Button->new(N("Configure hostname...")),
+ clicked => \&configure_hostname),
+ ),
0, gtkadd(Gtk2::Frame->new(N("Internet access")),
gtkpack_(gtkset_border_width(Gtk2::VBox->new(0,0), 5),
1, gtkset_border_width(create_packtable({ col_spacings => 5, row_spacings => 5 },
@@ -372,6 +377,40 @@ sub quit_global() {
ugtk2->exit(0);
}
+sub configure_hostname() {
+ my $window = _create_dialog(N("Hostname configuration"), { small => 1 });
+
+ $window->set_border_width(10);
+ $window->vbox->pack_start(new Gtk2::Label(N("Hostname configuration")), 1, 1, 0);
+ $window->vbox->pack_start(my $hbox = new Gtk2::HBox(0,0), 1, 0, 0);
+ $hbox->set_border_width(10);
+ $hbox->pack_start(new Gtk2::Label(N("Hostname")), 0, 1, 0);
+ $hbox->pack_start(my $entry = Gtk2::Entry->new_with_text($netc->{HOSTNAME}), 0, 1, 0);
+
+ $window->action_area->pack_start(gtkpack(Gtk2::HButtonBox->new,
+ gtksignal_connect(Gtk2::Button->new(N("Cancel")),
+ clicked => sub { $window->destroy; Gtk2->main_quit }),
+ ),
+ 1, 1, 0,
+ );
+
+ $window->action_area->pack_start(gtkpack(Gtk2::HButtonBox->new,
+ gtksignal_connect(Gtk2::Button->new(N("Ok")),
+ clicked => sub {
+ $netc->{HOSTNAME} = $entry->get_text || "localhost";
+ network::sethostname($netc);
+ update();
+ $window->destroy; Gtk2->main_quit
+ }),
+ ),
+ 1, 1, 0,
+ );
+
+ $window->show_all;
+ $window->run;
+ return;
+}
+
sub configure_lan() {
my $window = _create_dialog(N("LAN configuration"), { small => 1 });
my @card_tab;