2007-11-07 Dan Williams <dcbw@redhat.com>

* auth-dialog/main.c
	  properties/nm-vpnc.c
	  src/nm-vpnc-service.c
		- Fix for new NMSetting API changes



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3071 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-11-07 18:22:04 +00:00
parent a69909bb85
commit df921e74c5
4 changed files with 34 additions and 18 deletions

View file

@ -1,3 +1,10 @@
2007-11-07 Dan Williams <dcbw@redhat.com>
* auth-dialog/main.c
properties/nm-vpnc.c
src/nm-vpnc-service.c
- Fix for new NMSetting API changes
2007-10-26 Dan Williams <dcbw@redhat.com>
* properties/nm-vpnc.c

View file

@ -29,6 +29,9 @@
#include <libgnomeui/libgnomeui.h>
#include <gnome-keyring.h>
#include <nm-setting-vpn.h>
#include <nm-setting-vpn-properties.h>
#include "../src/nm-vpnc-service.h"
#include "gnome-two-password-dialog.h"
@ -50,7 +53,7 @@ find_one_password (const char *vpn_name,
vpn_name,
"setting-name",
GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
NM_SETTING_VPN_PROPERTIES,
NM_SETTING_VPN_PROPERTIES_SETTING_NAME,
"setting-key",
GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
secret_name,
@ -106,7 +109,7 @@ save_vpn_password (const char *vpn_name,
GnomeKeyringAttributeList *attrs = NULL;
guint32 id = 0;
display_name = g_strdup_printf ("VPN %s secret for %s/%s/" NM_SETTING_VPN_PROPERTIES,
display_name = g_strdup_printf ("VPN %s secret for %s/%s/" NM_SETTING_VPN_PROPERTIES_SETTING_NAME,
secret_name,
vpn_name,
vpn_service);
@ -117,7 +120,7 @@ save_vpn_password (const char *vpn_name,
vpn_name);
gnome_keyring_attribute_list_append_string (attrs,
"setting-name",
NM_SETTING_VPN_PROPERTIES);
NM_SETTING_VPN_PROPERTIES_SETTING_NAME);
gnome_keyring_attribute_list_append_string (attrs,
"setting-key",
secret_name);

View file

@ -34,6 +34,10 @@
#define NM_VPN_API_SUBJECT_TO_CHANGE
#include <nm-vpn-ui-interface.h>
#include <nm-setting-vpn.h>
#include <nm-setting-vpn-properties.h>
#include <nm-setting-connection.h>
#include "../src/nm-vpnc-service.h"
#include "pcf-file.h"
@ -177,13 +181,13 @@ impl_fill_connection (NetworkManagerVpnUI *self, NMConnection *connection)
g_return_if_fail (NM_IS_CONNECTION (connection));
s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_SETTING_CONNECTION);
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
g_assert (s_con);
s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_SETTING_VPN);
s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN));
g_assert (s_vpn);
s_vpn_props = (NMSettingVPNProperties *) nm_connection_get_setting (connection, NM_SETTING_VPN_PROPERTIES);
s_vpn_props = NM_SETTING_VPN_PROPERTIES (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN_PROPERTIES));
g_assert (s_vpn_props);
/* Connection name */
@ -272,15 +276,15 @@ impl_get_widget (NetworkManagerVpnUI *self, NMConnection *connection)
goto out;
/* Populate UI bits from the NMConnection */
s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_SETTING_CONNECTION);
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
g_assert (s_con);
g_assert (s_con->name);
gtk_entry_set_text (impl->w_connection_name, s_con->name);
s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_SETTING_VPN);
s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN));
g_assert (s_vpn);
s_vpn_props = (NMSettingVPNProperties *) nm_connection_get_setting (connection, NM_SETTING_VPN_PROPERTIES);
s_vpn_props = NM_SETTING_VPN_PROPERTIES (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN_PROPERTIES));
g_assert (s_vpn_props);
if (s_vpn_props->data)
@ -751,13 +755,13 @@ export_to_file (NetworkManagerVpnUIImpl *impl,
char *routes_str = NULL;
gboolean ret = TRUE;
s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_SETTING_CONNECTION);
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
g_assert (s_con);
s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_SETTING_VPN);
s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN));
g_assert (s_vpn);
s_vpn_props = (NMSettingVPNProperties *) nm_connection_get_setting (connection, NM_SETTING_VPN_PROPERTIES);
s_vpn_props = NM_SETTING_VPN_PROPERTIES (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN_PROPERTIES));
g_assert (s_vpn_props);
val = (GValue *) g_hash_table_lookup (s_vpn_props->data, NM_VPNC_KEY_GATEWAY);
@ -888,7 +892,7 @@ impl_export (NetworkManagerVpnUI *self, NMConnection *connection)
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_SETTING_CONNECTION);
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
g_assert (s_con);
g_assert (s_con->name);

View file

@ -9,6 +9,8 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <nm-setting-vpn.h>
#include <nm-setting-vpn-properties.h>
#include "nm-vpnc-service.h"
#include "nm-utils.h"
@ -269,7 +271,7 @@ real_connect (NMVPNPlugin *plugin,
NMSettingVPNProperties *properties;
gint vpnc_fd;
properties = (NMSettingVPNProperties *) nm_connection_get_setting (connection, NM_SETTING_VPN_PROPERTIES);
properties = NM_SETTING_VPN_PROPERTIES (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN_PROPERTIES));
if (!properties || !nm_vpnc_properties_validate (properties->data)) {
g_set_error (err,
NM_VPN_PLUGIN_ERROR,
@ -279,7 +281,7 @@ real_connect (NMVPNPlugin *plugin,
return FALSE;
}
s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_SETTING_VPN);
s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN));
g_assert (s_vpn);
if ((vpnc_fd = nm_vpnc_start_vpnc_binary (NM_VPNC_PLUGIN (plugin))) >= 0)
@ -309,7 +311,7 @@ real_need_secrets (NMVPNPlugin *plugin,
g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
s_vpn_props = (NMSettingVPNProperties *) nm_connection_get_setting (connection, NM_SETTING_VPN_PROPERTIES);
s_vpn_props = NM_SETTING_VPN_PROPERTIES (nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN_PROPERTIES));
if (!s_vpn_props) {
g_set_error (error,
NM_VPN_PLUGIN_ERROR,
@ -322,11 +324,11 @@ real_need_secrets (NMVPNPlugin *plugin,
// FIXME: there are some configurations where both passwords are not
// required. Make sure they work somehow.
if (!g_hash_table_lookup (s_vpn_props->data, NM_VPNC_KEY_SECRET)) {
*setting_name = NM_SETTING_VPN_PROPERTIES;
*setting_name = NM_SETTING_VPN_PROPERTIES_SETTING_NAME;
return TRUE;
}
if (!g_hash_table_lookup (s_vpn_props->data, NM_VPNC_KEY_XAUTH_PASSWORD)) {
*setting_name = NM_SETTING_VPN_PROPERTIES;
*setting_name = NM_SETTING_VPN_PROPERTIES_SETTING_NAME;
return TRUE;
}