summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-07-28 06:14:26 +0000
committerOlivier Blin <oblin@mandriva.org>2005-07-28 06:14:26 +0000
commit8aec9c45e0276020b6767739e18ef6cdea92b204 (patch)
tree96c349590dbafd78ea894e1421991c2b6bf2293f /perl-install/standalone
parenteaaa34b25786bea4c42430b788e22bc75e463cc3 (diff)
downloaddrakx-8aec9c45e0276020b6767739e18ef6cdea92b204.tar
drakx-8aec9c45e0276020b6767739e18ef6cdea92b204.tar.gz
drakx-8aec9c45e0276020b6767739e18ef6cdea92b204.tar.bz2
drakx-8aec9c45e0276020b6767739e18ef6cdea92b204.tar.xz
drakx-8aec9c45e0276020b6767739e18ef6cdea92b204.zip
simplify error messages
Diffstat (limited to 'perl-install/standalone')
-rw-r--r--perl-install/standalone/drakids27
-rw-r--r--perl-install/standalone/net_applet5
2 files changed, 11 insertions, 21 deletions
diff --git a/perl-install/standalone/drakids b/perl-install/standalone/drakids
index 71c7a1339..8bfcf6704 100644
--- a/perl-install/standalone/drakids
+++ b/perl-install/standalone/drakids
@@ -141,12 +141,11 @@ sub get_selected_blacklist() {
sub unblacklist {
my @addr = @_;
eval { $activefw->unblacklist($_) foreach @addr };
- if ($@) {
- my $error = $@;
- err_dialog(N("Error"), N("Unable to remove from blacklist: %s", $error));
- return;
+ if (!$@) {
+ list_remove_addr($blacklist->{data}, @addr);
+ } else {
+ err_dialog(N("Active Firewall"), N("Unable to contact daemon"));
}
- list_remove_addr($blacklist->{data}, @addr);
}
#- may throw an exception
@@ -171,20 +170,17 @@ sub whitelist {
my @addr = @_;
unblacklist(@addr);
eval { $activefw->whitelist($_) foreach @addr };
- if ($@) {
- my $error = $@;
- err_dialog(N("Error"), N("Unable to move in whitelist: %s", $error));
- }
+ $@ and err_dialog(N("Active Firewall"), N("Unable to contact daemon"));
}
sub unwhitelist {
my @addr = @_;
eval { $activefw->unwhitelist($_) foreach @addr };
- if ($@) {
- my $error = $@;
- err_dialog(N("Error"), N("Unable to remove from whitelist: %s", $error));
+ if (!$@) {
+ list_remove_addr($whitelist->{data}, @addr);
+ } else {
+ err_dialog(N("Active Firewall"), N("Unable to contact daemon"));
}
- list_remove_addr($whitelist->{data}, @addr);
}
sub init_lists() {
@@ -192,10 +188,7 @@ sub init_lists() {
init_blacklist();
init_whitelist();
};
- if ($@) {
- my $error = $@;
- err_dialog(N("Error"), N("Unable to contact the Active Firewall daemon: %s", $error));
- }
+ $@ and err_dialog(N("Active Firewall"), N("Unable to contact daemon"));
}
sub clear_lists() {
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 6a03b85a5..4f90ca3bc 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -159,10 +159,7 @@ sub generate_wireless_menuitem {
$net->{activate} = $net->{menuitem}->signal_connect('activate' => sub {
if (exists $net->{id}) {
eval { $monitor->select_network($net->{id}) };
- if ($@) {
- my $error = $@;
- err_dialog(N("Error"), N("Unable to select wireless network: %s", $error));
- }
+ $@ and err_dialog(N("Active Firewall"), N("Unable to contact daemon"));
} else {
run_drakroam();
}