2008-06-20 Dan Williams <dcbw@redhat.com>

* libnm-glib/nm-vpn-plugin-ui-interface.c
	  libnm-glib/nm-vpn-plugin-ui-interface.h
		- 'validity-changed' -> 'changed' to work better with the connection
			editor.  Plugin UI widgets should emit 'changed' whenever their
			UI values change in a meaningful way.
		- (nm_vpn_plugin_ui_widget_interface_update_connection): the
			update_connection member now returns validity of the UI widget



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3761 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-06-20 19:46:46 +00:00
parent ebaee3a388
commit bdeeab3eda
3 changed files with 37 additions and 14 deletions

View file

@ -1,3 +1,13 @@
2008-06-20 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-vpn-plugin-ui-interface.c
libnm-glib/nm-vpn-plugin-ui-interface.h
- 'validity-changed' -> 'changed' to work better with the connection
editor. Plugin UI widgets should emit 'changed' whenever their
UI values change in a meaningful way.
- (nm_vpn_plugin_ui_widget_interface_update_connection): the
update_connection member now returns validity of the UI widget
2008-06-20 Tambet Ingo <tambet@gmail.com>
* libnm-util/nm-connection.c (nm_connection_duplicate): Implement.

View file

@ -145,13 +145,13 @@ widget_interface_init (gpointer g_iface)
return;
/* Signals */
g_signal_new ("validity-changed",
g_signal_new ("changed",
iface_type,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMVpnPluginUiWidgetInterface, validity_changed),
G_STRUCT_OFFSET (NMVpnPluginUiWidgetInterface, changed),
NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
@ -191,10 +191,14 @@ nm_vpn_plugin_ui_widget_interface_get_widget (NMVpnPluginUiWidgetInterface *ifac
return NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE (iface)->get_widget (iface);
}
void
gboolean
nm_vpn_plugin_ui_widget_interface_update_connection (NMVpnPluginUiWidgetInterface *iface,
NMConnection *connection)
NMConnection *connection,
GError **error)
{
return NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE (iface)->update_connection (iface, connection);
if (error)
g_return_val_if_fail (*error == NULL, FALSE);
return NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE (iface)->update_connection (iface, connection, error);
}

View file

@ -141,20 +141,29 @@ struct _NMVpnPluginUiWidgetInterface {
/* Return the GtkWidget for the VPN's UI */
GObject * (*get_widget) (NMVpnPluginUiWidgetInterface *iface);
/* Called to save the user-entered options to the connection object */
void (*update_connection) (NMVpnPluginUiWidgetInterface *iface,
NMConnection *connection);
/* Called to save the user-entered options to the connection object. Should
* return FALSE and set 'error' if the current options are invalid. 'error'
* should contain enough information for the plugin to determine which UI
* widget is invalid at a later point in time. For example, creating unique
* error codes for what error occurred and populating the message field
* of 'error' with the name of the invalid property.
*/
gboolean (*update_connection) (NMVpnPluginUiWidgetInterface *iface,
NMConnection *connection,
GError **error);
/* Emitted when the validity of the user-entered options changes */
void (*validity_changed) (NMVpnPluginUiWidgetInterface *iface, gboolean valid);
/* Emitted when the value of a UI widget changes. May trigger a validity
* check via update_connection() to write values to the connection */
void (*changed) (NMVpnPluginUiWidgetInterface *iface);
};
GType nm_vpn_plugin_ui_widget_interface_get_type (void);
GObject * nm_vpn_plugin_ui_widget_interface_get_widget (NMVpnPluginUiWidgetInterface *iface);
void nm_vpn_plugin_ui_widget_interface_update_connection (NMVpnPluginUiWidgetInterface *iface,
NMConnection *connection);
gboolean nm_vpn_plugin_ui_widget_interface_update_connection (NMVpnPluginUiWidgetInterface *iface,
NMConnection *connection,
GError **error);
G_END_DECLS