summaryrefslogtreecommitdiffstats
path: root/lib/network/drakroam.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-03 14:24:12 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-03 14:24:12 +0000
commitadd2b6439ca2212a939f9f197defc128d8903570 (patch)
treee8618304581fb4e750691083e04d3c3d4d3b574f /lib/network/drakroam.pm
parent3025ca130239b141ef6d39b925f094f36f61fa77 (diff)
downloaddrakx-net-add2b6439ca2212a939f9f197defc128d8903570.tar
drakx-net-add2b6439ca2212a939f9f197defc128d8903570.tar.gz
drakx-net-add2b6439ca2212a939f9f197defc128d8903570.tar.bz2
drakx-net-add2b6439ca2212a939f9f197defc128d8903570.tar.xz
drakx-net-add2b6439ca2212a939f9f197defc128d8903570.zip
do not modify buttons if not present
Diffstat (limited to 'lib/network/drakroam.pm')
-rwxr-xr-xlib/network/drakroam.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/network/drakroam.pm b/lib/network/drakroam.pm
index c124f9d..73dff01 100755
--- a/lib/network/drakroam.pm
+++ b/lib/network/drakroam.pm
@@ -82,7 +82,8 @@ sub select_connection {
sub update_on_connection_change {
my ($droam) = @_;
- $droam->{gui}{buttons}{refresh}->set_sensitive(to_bool($droam->{connection}));
+ $droam->{gui}{buttons}{refresh}->set_sensitive(to_bool($droam->{connection}))
+ if $droam->{gui}{buttons}{refresh};
update_networks($droam);
}
@@ -220,11 +221,15 @@ sub select_network {
sub update_on_network_change {
my ($droam) = @_;
- $droam->{gui}{buttons}{connect}->set_label(toggle_would_disconnect($droam) ? N("Disconnect") : N("Connect"));
- #- always allow to disconnect if connected
- $droam->{gui}{buttons}{connect}->set_sensitive($droam->{connection} && ($droam->{connection}->get_status || $droam->{connection}{network}));
+ if ($droam->{gui}{buttons}{connect}) {
+ $droam->{gui}{buttons}{connect}->set_label(toggle_would_disconnect($droam) ? N("Disconnect") : N("Connect"));
+ #- always allow to disconnect if connected
+ $droam->{gui}{buttons}{connect}->set_sensitive($droam->{connection} && ($droam->{connection}->get_status || $droam->{connection}{network}));
+ }
+
#- allow to configure only if a network is selected
- $droam->{gui}{buttons}{configure}->set_sensitive($droam->{connection} && $droam->{connection}{network});
+ $droam->{gui}{buttons}{configure}->set_sensitive($droam->{connection} && $droam->{connection}{network})
+ if $droam->{gui}{buttons}{configure};
}
sub toggle_would_disconnect {