From 030c9aba22596778805c534a74649b68a95aecda Mon Sep 17 00:00:00 2001 From: Damien Chaumette Date: Mon, 16 Feb 2004 17:07:32 +0000 Subject: move check_field's ask_warn() to save_notebook() --- perl-install/standalone/drakconnect | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'perl-install/standalone/drakconnect') diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 2e5afcfb7..abe332abb 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -542,7 +542,7 @@ sub save { my ($netc, $p, $apply_button) = @_; foreach (keys %$p) { - save_notebook($netc, $p->{$_}{intf}, $p->{$_}{gui}) or $in->ask_warn(N("Error"), N("IP address should be in format 1.2.3.4")) and return; + save_notebook($netc, $p->{$_}{intf}, $p->{$_}{gui}) or return; $p->{$_}{intf}{save} ? $p->{$_}{intf}{save}->() : apply($netc, $p->{$_}{intf}); } system("/etc/rc.d/init.d/network restart"); @@ -559,8 +559,10 @@ sub save_notebook { $gui->{intf_bool}{MII_NOT_SUPPORTED} and $intf->{MII_NOT_SUPPORTED} = bool2yesno(!$gui->{intf_bool}{MII_NOT_SUPPORTED}->get_active); $gui->{intf_bool}{HWADDR} and (bool2yesno($gui->{intf_bool}{HWADDR}->get_active) eq 'yes' ? ($intf->{HWADDR} = 'yes') : delete $intf->{HWADDR}); - $intf->{BOOTPROTO} eq 'static' and (check_field($intf, 'IPADDR', 'NETMASK') or return 0); - check_field($netc, 'GATEWAY') or return 0; + if ($intf->{BOOTPROTO} eq 'static') { + check_field($intf, 'IPADDR', 'NETMASK') or $in->ask_warn(N("Error"), N("IP address should be in format 1.2.3.4")) and return 0; + } + check_field($netc, 'GATEWAY') or $in->ask_warn(N("Error"), N("Gateway address should be in format 1.2.3.4")) and return 0; 1; } -- cgit v1.2.1