mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-21 07:30:38 +01:00
2007-09-25 Dan Williams <dcbw@redhat.com>
Ensure that old activation requests are forgotten about; previously hitting Cancel in the password dialog would deactivate whatever device that password was requested for, even if that wasn't the currently activating connection. * src/nm-manager.c src/nm-manager.h - (nm_manager_get_connection_secrets): track the pending call object so it can be canceled later if needed - (nm_manager_cancel_get_connection_secrets): cancel a pending GetSecrets call for a particular connection * src/nm-activation-request.c - (dispose): cancel any outstanding GetSecrets calls on the connection git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2874 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
2366b6c346
commit
6e1c10d31b
4 changed files with 65 additions and 9 deletions
18
ChangeLog
18
ChangeLog
|
|
@ -1,3 +1,21 @@
|
|||
2007-09-25 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Ensure that old activation requests are forgotten about; previously
|
||||
hitting Cancel in the password dialog would deactivate whatever device
|
||||
that password was requested for, even if that wasn't the currently
|
||||
activating connection.
|
||||
|
||||
* src/nm-manager.c
|
||||
src/nm-manager.h
|
||||
- (nm_manager_get_connection_secrets): track the pending call
|
||||
object so it can be canceled later if needed
|
||||
- (nm_manager_cancel_get_connection_secrets): cancel a pending
|
||||
GetSecrets call for a particular connection
|
||||
|
||||
* src/nm-activation-request.c
|
||||
- (dispose): cancel any outstanding GetSecrets calls on the
|
||||
connection
|
||||
|
||||
2007-09-25 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/NetworkManagerPolicy.c
|
||||
|
|
|
|||
|
|
@ -98,8 +98,14 @@ dispose (GObject *object)
|
|||
priv->secrets_updated_id = 0;
|
||||
}
|
||||
|
||||
if (priv->connection)
|
||||
if (priv->connection) {
|
||||
NMManager *manager = nm_manager_get ();
|
||||
|
||||
nm_manager_cancel_get_connection_secrets (manager, priv->connection);
|
||||
g_object_unref (manager);
|
||||
|
||||
g_object_unref (priv->connection);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ enum {
|
|||
};
|
||||
|
||||
#define CONNECTION_PROXY_TAG "dbus-proxy"
|
||||
#define CONNECTION_GET_SECRETS_CALL_TAG "get-secrets-call"
|
||||
|
||||
static void
|
||||
nm_manager_init (NMManager *manager)
|
||||
|
|
@ -1027,6 +1028,8 @@ get_secrets_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
|
|||
g_return_if_fail (info->setting_name);
|
||||
g_return_if_fail (info->device);
|
||||
|
||||
g_object_set_data (G_OBJECT (info->connection), CONNECTION_GET_SECRETS_CALL_TAG, NULL);
|
||||
|
||||
if (!dbus_g_proxy_end_call (proxy, call, &err,
|
||||
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &secrets,
|
||||
G_TYPE_INVALID)) {
|
||||
|
|
@ -1055,6 +1058,7 @@ nm_manager_get_connection_secrets (NMManager *manager,
|
|||
{
|
||||
DBusGProxy *proxy;
|
||||
GetSecretsInfo *info = NULL;
|
||||
DBusGProxyCall *call;
|
||||
|
||||
g_return_val_if_fail (NM_IS_MANAGER (manager), FALSE);
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
|
||||
|
|
@ -1081,17 +1085,20 @@ nm_manager_get_connection_secrets (NMManager *manager,
|
|||
info->manager = manager;
|
||||
info->device = g_object_ref (device);
|
||||
|
||||
if (!dbus_g_proxy_begin_call_with_timeout (proxy, "GetSecrets",
|
||||
get_secrets_cb,
|
||||
info,
|
||||
free_get_secrets_info,
|
||||
G_MAXINT32,
|
||||
G_TYPE_STRING, setting_name,
|
||||
G_TYPE_BOOLEAN, request_new,
|
||||
G_TYPE_INVALID)) {
|
||||
call = dbus_g_proxy_begin_call_with_timeout (proxy, "GetSecrets",
|
||||
get_secrets_cb,
|
||||
info,
|
||||
free_get_secrets_info,
|
||||
G_MAXINT32,
|
||||
G_TYPE_STRING, setting_name,
|
||||
G_TYPE_BOOLEAN, request_new,
|
||||
G_TYPE_INVALID);
|
||||
if (!call) {
|
||||
nm_warning ("Could not call GetSecrets");
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_object_set_data (G_OBJECT (connection), CONNECTION_GET_SECRETS_CALL_TAG, call);
|
||||
return TRUE;
|
||||
|
||||
error:
|
||||
|
|
@ -1100,3 +1107,25 @@ error:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nm_manager_cancel_get_connection_secrets (NMManager *manager,
|
||||
NMConnection *connection)
|
||||
{
|
||||
DBusGProxyCall *call;
|
||||
DBusGProxy *proxy;
|
||||
|
||||
g_return_if_fail (NM_IS_MANAGER (manager));
|
||||
g_return_if_fail (NM_IS_CONNECTION (connection));
|
||||
|
||||
proxy = g_object_get_data (G_OBJECT (connection), CONNECTION_PROXY_TAG);
|
||||
if (!DBUS_IS_G_PROXY (proxy))
|
||||
return;
|
||||
|
||||
call = g_object_get_data (G_OBJECT (connection), CONNECTION_GET_SECRETS_CALL_TAG);
|
||||
if (!call)
|
||||
return;
|
||||
|
||||
dbus_g_proxy_cancel_call (proxy, call);
|
||||
g_object_set_data (G_OBJECT (connection), CONNECTION_GET_SECRETS_CALL_TAG, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,4 +83,7 @@ gboolean nm_manager_get_connection_secrets (NMManager *manager,
|
|||
const char * setting_name,
|
||||
gboolean request_new);
|
||||
|
||||
void nm_manager_cancel_get_connection_secrets (NMManager *manager,
|
||||
NMConnection *connection);
|
||||
|
||||
#endif /* NM_MANAGER_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue