NetworkManager/system-settings/src/nm-system-config-error.c
Tambet Ingo 5262883e96 2008-07-16 Tambet Ingo <tambet@gmail.com>
* system-settings/src/nm-system-config-interface.c
	(nm_system_config_interface_supports_add): Implement.
	(nm_system_config_interface_add_connection): Return a boolean to notify
	of errors.

	* system-settings/src/nm-polkit-helpers.c:
	* system-settings/src/nm-polkit-helpers.h: Move error declarations to
	a separate file.

	* system-settings/src/dbus-settings.c (impl_settings_add_connection):
	Return an error when none of the plugins support add or if addition
	failed for some reason.

	* system-settings/src/nm-system-config-error.h:
	* system-settings/src/nm-system-config-error.c: New files, mostly moved
	here from nm-polkit-helpers.[ch].

	* system-settings/src/Makefile.am: Build new files.

	* system-settings/plugins/keyfile/reader.c
	(read_array_of_array_of_uint): Make it more general so that it would
	work for routes as well.

	* system-settings/plugins/keyfile/writer.c
	(write_array_of_array_of_uint): Ditto.
	Fix the netmask/prefix writing.

	* system-settings/plugins/keyfile/plugin.c (add_connection): Return
	boolean to notify errors.

	* system-settings/plugins/ifcfg-suse/nm-suse-connection.c (update):
	Return more specific error.
	(delete): Ditto.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3821 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-07-16 07:37:10 +00:00

39 lines
1.1 KiB
C

/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
#include "nm-system-config-error.h"
GQuark
nm_sysconfig_settings_error_quark (void)
{
static GQuark ret = 0;
if (ret == 0)
ret = g_quark_from_static_string ("nm_sysconfig_settings_error");
return ret;
}
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
nm_sysconfig_settings_error_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, "GeneralError"),
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, "NotPrivileged"),
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_INVALID_CONNECTION, "InvalidConnection"),
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_ADD_NOT_SUPPORTED, "AddNotSupported"),
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_UPDATE_NOT_SUPPORTED, "UpdateNotSupported"),
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_DELETE_NOT_SUPPORTED, "DeleteNotSupported"),
ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_ADD_FAILED, "AddFailed"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("NMSysconfigSettingsError", values);
}
return etype;
}