summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@redhat.com>2014-11-18 12:11:46 -0500
committerDan Winship <danw@redhat.com>2014-11-19 10:03:57 -0500
commit8473bb310dd92bb5de8df5b637806a1dcb5f3053 (patch)
tree8408c5ce251fd202bf4e0d4d134694840ab7bb4f
parent11c1cad8aea02c471123ce84a8abb4ba71725d2f (diff)
downloadNetworkManager-8473bb310dd92bb5de8df5b637806a1dcb5f3053.tar.gz
tui: refresh the "nmtui connect" list when connections are added/removed
We were refreshing the list when the set of available devices changed, or the set of active connections changed, but not when the set of available connections changed. https://bugzilla.gnome.org/show_bug.cgi?id=740333
-rw-r--r--clients/tui/nmt-connect-connection-list.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c
index bd54af22cd..0805806639 100644
--- a/clients/tui/nmt-connect-connection-list.c
+++ b/clients/tui/nmt-connect-connection-list.c
@@ -544,17 +544,9 @@ nmt_connect_connection_list_rebuild (NmtConnectConnectionList *list)
}
static void
-rebuild_on_acs_changed (GObject *object,
- GParamSpec *spec,
- gpointer list)
-{
- nmt_connect_connection_list_rebuild (list);
-}
-
-static void
-rebuild_on_devices_changed (NMClient *client,
- NMDevice *device,
- gpointer list)
+rebuild_on_property_changed (GObject *object,
+ GParamSpec *spec,
+ gpointer list)
{
nmt_connect_connection_list_rebuild (list);
}
@@ -565,11 +557,11 @@ nmt_connect_connection_list_constructed (GObject *object)
NmtConnectConnectionList *list = NMT_CONNECT_CONNECTION_LIST (object);
g_signal_connect (nm_client, "notify::" NM_CLIENT_ACTIVE_CONNECTIONS,
- G_CALLBACK (rebuild_on_acs_changed), list);
- g_signal_connect (nm_client, "device-added",
- G_CALLBACK (rebuild_on_devices_changed), list);
- g_signal_connect (nm_client, "device-removed",
- G_CALLBACK (rebuild_on_devices_changed), list);
+ G_CALLBACK (rebuild_on_property_changed), list);
+ g_signal_connect (nm_client, "notify::" NM_CLIENT_CONNECTIONS,
+ G_CALLBACK (rebuild_on_property_changed), list);
+ g_signal_connect (nm_client, "notify::" NM_CLIENT_DEVICES,
+ G_CALLBACK (rebuild_on_property_changed), list);
nmt_connect_connection_list_rebuild (list);
@@ -583,8 +575,7 @@ nmt_connect_connection_list_finalize (GObject *object)
g_slist_free_full (priv->nmt_devices, (GDestroyNotify) nmt_connect_device_free);
- g_signal_handlers_disconnect_by_func (nm_client, G_CALLBACK (rebuild_on_acs_changed), object);
- g_signal_handlers_disconnect_by_func (nm_client, G_CALLBACK (rebuild_on_devices_changed), object);
+ g_signal_handlers_disconnect_by_func (nm_client, G_CALLBACK (rebuild_on_property_changed), object);
G_OBJECT_CLASS (nmt_connect_connection_list_parent_class)->finalize (object);
}