summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2013-05-07 01:59:19 +0000
committerOlivier Blin <blino@mageia.org>2013-05-07 01:59:19 +0000
commit3925840fb4e0a4a1ef128beb1ab4d339377d25dd (patch)
tree5fd35e8cb3b17fff4e41ffa460cb5f81403a23a1 /lib
parentd2c2107f176ffc269a2b3992b3612c1ee86ceb64 (diff)
downloaddrakx-net-3925840fb4e0a4a1ef128beb1ab4d339377d25dd.tar
drakx-net-3925840fb4e0a4a1ef128beb1ab4d339377d25dd.tar.gz
drakx-net-3925840fb4e0a4a1ef128beb1ab4d339377d25dd.tar.bz2
drakx-net-3925840fb4e0a4a1ef128beb1ab4d339377d25dd.tar.xz
drakx-net-3925840fb4e0a4a1ef128beb1ab4d339377d25dd.zip
connection manager: move more gtk code in specific module
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection_manager.pm12
-rw-r--r--lib/network/connection_manager/gtk.pm16
2 files changed, 16 insertions, 12 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index 9b920a7..fdfe5ca 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -242,21 +242,9 @@ sub toggle_connection {
}
}
-sub select_network {
- my ($cmanager) = @_;
-
- if ($cmanager->{connection}) {
- my ($selected) = $cmanager->{gui}{networks_list}->get_selected_indices;
- $cmanager->{connection}{network} = defined $selected && $cmanager->{gui}{networks_list}{data}[$selected][0];
- }
- $cmanager->update_on_status_change;
-}
-
sub update_networks {
my ($cmanager) = @_;
- @{$cmanager->{gui}{networks_list}{data}} = ();
-
if ($cmanager->{connection}) {
$cmanager->check_setup || $cmanager->setup_connection or return;
diff --git a/lib/network/connection_manager/gtk.pm b/lib/network/connection_manager/gtk.pm
index 7f90d7d..2872839 100644
--- a/lib/network/connection_manager/gtk.pm
+++ b/lib/network/connection_manager/gtk.pm
@@ -37,6 +37,16 @@ sub stop_connection {
gtkset_mousecursor_normal($cmanager->{gui}{w}{window}->window);
}
+sub select_network {
+ my ($cmanager) = @_;
+
+ if ($cmanager->{connection}) {
+ my ($selected) = $cmanager->{gui}{networks_list}->get_selected_indices;
+ $cmanager->{connection}{network} = defined $selected && $cmanager->{gui}{networks_list}{data}[$selected][0];
+ }
+ $cmanager->update_on_status_change;
+}
+
sub create_networks_list {
my ($cmanager) = @_;
@@ -151,6 +161,12 @@ sub filter_networks {
} values %{$connection->{networks}};
}
+sub update_networks {
+ my ($cmanager) = @_;
+ @{$cmanager->{gui}{networks_list}{data}} = ();
+ $cmanager->SUPER::update_networks;
+}
+
sub update_networks_list {
my ($cmanager) = @_;