diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-01-21 22:01:43 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-01-21 22:01:43 +0100 |
commit | 325cc060e5a4d0b6f34e06c0d3e376369864696d (patch) | |
tree | d3019defc29bdc91905e7477ec24124038ca43d2 | |
parent | f459795f3c8012327976292f4d7ac0b85d75d813 (diff) | |
download | connman-gnome-325cc060e5a4d0b6f34e06c0d3e376369864696d.tar.gz |
Update device status on disconnect
-rw-r--r-- | common/connman-client.c | 4 | ||||
-rw-r--r-- | common/connman-client.h | 1 | ||||
-rw-r--r-- | common/connman-dbus.c | 18 |
3 files changed, 20 insertions, 3 deletions
diff --git a/common/connman-client.c b/common/connman-client.c index fda052d..9d57ddd 100644 --- a/common/connman-client.c +++ b/common/connman-client.c @@ -99,8 +99,8 @@ static void connman_client_init(ConnmanClient *client) G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_UINT); + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, + G_TYPE_STRING); g_object_set_data(G_OBJECT(priv->store), "State", g_strdup("unavailable")); diff --git a/common/connman-client.h b/common/connman-client.h index 6dc9313..d351651 100644 --- a/common/connman-client.h +++ b/common/connman-client.h @@ -91,6 +91,7 @@ enum { CONNMAN_COLUMN_NETWORK, CONNMAN_COLUMN_ADDRESS, CONNMAN_COLUMN_POLICY, + CONNMAN_COLUMN_DEVICE, _CONNMAN_NUM_COLUMNS }; diff --git a/common/connman-dbus.c b/common/connman-dbus.c index de0fe4e..4fdd408 100644 --- a/common/connman-dbus.c +++ b/common/connman-dbus.c @@ -202,10 +202,23 @@ static void property_update(GtkTreeStore *store, const GValue *value, for (list = old_list; list; list = list->next) { gchar *path = list->data; GtkTreeIter iter; + gchar *device = NULL; + + if (get_iter_from_path(store, &iter, path) == TRUE) { + if (g_str_equal(key, "Connections") == TRUE) + gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, + CONNMAN_COLUMN_DEVICE, &device, -1); - if (get_iter_from_path(store, &iter, path) == TRUE) gtk_tree_store_remove(store, &iter); + } + if (get_iter_from_path(store, &iter, device) == TRUE) { + gtk_tree_store_set(store, &iter, + CONNMAN_COLUMN_INRANGE, FALSE, + CONNMAN_COLUMN_ADDRESS, NULL, -1); + } + + g_free(device); g_free(path); } @@ -551,8 +564,11 @@ static void connection_properties(DBusGProxy *proxy, GHashTable *hash, DBG("device %s", device); + gtk_tree_store_set(store, &iter, CONNMAN_COLUMN_DEVICE, device, -1); + if (get_iter_from_path(store, &iter, device) == TRUE) { gtk_tree_store_set(store, &iter, + CONNMAN_COLUMN_DEVICE, device, CONNMAN_COLUMN_INRANGE, TRUE, CONNMAN_COLUMN_ADDRESS, address, -1); } |