[network-manager-netbook/MplPanelClient: 2/7] Connect automatically ethernet connections whenever they become valid.
- From: Tambet Ingo <tambeti src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [network-manager-netbook/MplPanelClient: 2/7] Connect automatically ethernet connections whenever they become valid.
- Date: Wed, 9 Sep 2009 13:13:20 +0000 (UTC)
commit 0dc79e3c65b1f03c7d8bb3cedaf1aabdbcbd7157
Author: Tambet Ingo <tambet gmail com>
Date: Tue Sep 8 10:45:08 2009 +0300
Connect automatically ethernet connections whenever they become valid.
src/nmn-ethernet-handler.c | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/src/nmn-ethernet-handler.c b/src/nmn-ethernet-handler.c
index 6e98115..7a77e60 100644
--- a/src/nmn-ethernet-handler.c
+++ b/src/nmn-ethernet-handler.c
@@ -70,9 +70,21 @@ connection_added (NmnDeviceHandler *handler,
static void
state_changed (NmnDeviceHandler *handler, gboolean active)
{
- if (active)
+ if (active) {
+ GSList *list;
+ GSList *iter;
+
nmn_device_handler_add_items (handler);
- else
+
+ /* When ethernet is enabled, it means we really want it enabled */
+ list = nmn_device_handler_get_items (handler);
+ for (iter = list; iter; iter = iter->next) {
+ NmnNetworkItem *item = NMN_NETWORK_ITEM (iter->data);
+
+ if (nmn_network_item_get_status (item) == NMN_NETWORK_ITEM_STATUS_DISCONNECTED)
+ nmn_network_item_connect_request (item);
+ }
+ } else
nmn_device_handler_remove_items (handler);
}
@@ -89,23 +101,7 @@ ethernet_toggled (NmnNMData *nm_data,
gboolean active,
gpointer user_data)
{
- NmnDeviceHandler *handler = NMN_DEVICE_HANDLER (user_data);
-
- state_changed (handler, active);
-
- /* When ethernet is enabled, it means we really want it enabled */
- if (active) {
- GSList *list;
- GSList *iter;
-
- list = nmn_device_handler_get_items (handler);
- for (iter = list; iter; iter = iter->next) {
- NmnNetworkItem *item = NMN_NETWORK_ITEM (iter->data);
-
- if (nmn_network_item_get_status (item) == NMN_NETWORK_ITEM_STATUS_DISCONNECTED)
- nmn_network_item_connect_request (item);
- }
- }
+ state_changed (NMN_DEVICE_HANDLER (user_data), active);
}
static GObject*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]