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

* properties/nm-openvpn.c
	  src/nm-openvpn-service.c
		- Fix for new NMSetting API changes



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3070 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-11-07 18:21:12 +00:00
parent 901bf4c68b
commit a69909bb85
3 changed files with 24 additions and 13 deletions

View file

@ -1,3 +1,9 @@
2007-11-07 Dan Williams <dcbw@redhat.com>
* properties/nm-openvpn.c
src/nm-openvpn-service.c
- Fix for new NMSetting API changes
2007-10-28 Tim Niemueller <tim@niemueller.de>
* nm-openvpn.desktop.in: Added NoDisplay=true

View file

@ -34,6 +34,9 @@
#define NM_VPN_API_SUBJECT_TO_CHANGE
#include <nm-vpn-ui-interface.h>
#include <nm-setting-connection.h>
#include <nm-setting-vpn.h>
#include <nm-setting-vpn-properties.h>
#include "../src/nm-openvpn-service.h"
@ -257,13 +260,13 @@ impl_fill_connection (NetworkManagerVpnUI *self, NMConnection *connection)
gboolean use_cipher;
gboolean use_ta;
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);
properties = s_vpn_props->data;
@ -425,15 +428,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)
@ -1349,13 +1352,13 @@ export_to_file (NetworkManagerVpnUIImpl *impl,
char *routes_str = NULL;
gboolean ret;
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_OPENVPN_KEY_REMOTE);
@ -1526,7 +1529,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

@ -47,6 +47,8 @@
#include <NetworkManager.h>
#include <NetworkManagerVPN.h>
#include <nm-setting-vpn.h>
#include <nm-setting-vpn-properties.h>
#include "nm-openvpn-service.h"
#include "nm-utils.h"
@ -618,7 +620,7 @@ real_connect (NMVPNPlugin *plugin,
gint fd;
gboolean success = FALSE;
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_openvpn_properties_validate (properties->data)) {
g_set_error (err,
NM_VPN_PLUGIN_ERROR,
@ -659,7 +661,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,
@ -692,7 +694,7 @@ real_need_secrets (NMVPNPlugin *plugin,
}
if (need_secrets)
*setting_name = NM_SETTING_VPN_PROPERTIES;
*setting_name = NM_SETTING_VPN_PROPERTIES_SETTING_NAME;
return need_secrets;
}