summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-09 20:14:03 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-09 20:14:03 +0000
commite01abe24d233f3feb3dd7f699bab6371585a745c (patch)
tree715878439a4cd14d177b3bc9620ab04d7fdc1048 /lib
parent3ef96e3561666de5b3d7595ec7c6d5f9a92f6dec (diff)
downloaddrakx-net-e01abe24d233f3feb3dd7f699bab6371585a745c.tar
drakx-net-e01abe24d233f3feb3dd7f699bab6371585a745c.tar.gz
drakx-net-e01abe24d233f3feb3dd7f699bab6371585a745c.tar.bz2
drakx-net-e01abe24d233f3feb3dd7f699bab6371585a745c.tar.xz
drakx-net-e01abe24d233f3feb3dd7f699bab6371585a745c.zip
connect buttons with connection manager actions
Diffstat (limited to 'lib')
-rwxr-xr-xlib/network/netcenter.pm26
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm
index ca2a46c..c9855f1 100755
--- a/lib/network/netcenter.pm
+++ b/lib/network/netcenter.pm
@@ -65,7 +65,7 @@ sub main {
1, gtknew('ScrolledWindow', width => 500, height => 300, child => gtknew('VBox', spacing => 20, children_tight => [
map {
my $cmanager = build_cmanager($in, $net, $w, $pixbufs, $_);
- gtknew('HBox', children_tight => [
+ my $box = gtknew('HBox', children_tight => [
gtknew('Image', file => $_->get_type_icon),
gtknew('VBox', spacing => 10, children_tight => [
gtknew('Title2', label => $_->get_description),
@@ -76,11 +76,25 @@ sub main {
gtknew('HBox', children_tight => [
gtknew('VBox', children_tight => [
gtknew('HButtonBox', children_tight => [
- gtkset_image(gtknew('Button'), 'connected'),
- gtkset_image(gtknew('Button'), 'disconnected'),
+ $cmanager->{gui}{buttons}{connect_start} =
+ gtkset_image(gtknew('Button', clicked => sub {
+ network::connection_manager::start_connection($cmanager);
+ }), 'connected'),
+ $cmanager->{gui}{buttons}{connect_stop} =
+ gtkset_image(gtknew('Button', clicked => sub {
+ network::connection_manager::start_connection($cmanager);
+ }), 'disconnected'),
gtkset_image(gtknew('Button'), 'monitor-24'),
- gtkset_image(gtknew('Button'), 'configure-24'),
- ($cmanager->{gui}{show_networks} ? gtkset_image(gtknew('Button'), 'refresh') : ()),
+ $cmanager->{gui}{buttons}{configure} =
+ gtkset_image(gtknew('Button', clicked => sub {
+ network::connection_manager::configure_connection($cmanager);
+ }), 'configure-24'),
+ ($cmanager->{gui}{show_networks} ?
+ $cmanager->{gui}{buttons}{refresh} =
+ gtkset_image(gtknew('Button', clicked => sub {
+ network::connection_manager::update_networks($cmanager);
+ }), 'refresh')
+ : ()),
]),
]),
]),
@@ -88,6 +102,8 @@ sub main {
]),
]),
]);
+ network::connection_manager::update_on_network_change($cmanager);
+ $box;
} @connections,
])),
]),