[network-manager-openvpn/lr/libnm: 6/15] properties: rename the classes to be more libnm-ish
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/lr/libnm: 6/15] properties: rename the classes to be more libnm-ish
- Date: Wed, 19 Aug 2015 16:41:20 +0000 (UTC)
commit d729ea4c0aa14bb227331e600ed7d255bf79a4cc
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Thu Jul 16 15:22:12 2015 +0200
properties: rename the classes to be more libnm-ish
No functional change.
properties/auth-helpers.c | 48 +++++++++---------
properties/import-export.c | 16 +++---
properties/nm-openvpn.c | 118 ++++++++++++++++++++++----------------------
properties/nm-openvpn.h | 44 ++++++++--------
4 files changed, 113 insertions(+), 113 deletions(-)
---
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 6a2ff55..8352b42 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -42,16 +42,16 @@
#include <nm-utils.h>
#include <nm-ui-utils.h>
-#define OPENVPN_PLUGIN_UI_ERROR NM_SETTING_VPN_ERROR
-#define OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY NM_SETTING_VPN_ERROR_INVALID_PROPERTY
+#define OPENVPN_EDITOR_PLUGIN_ERROR NM_SETTING_VPN_ERROR
+#define OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY NM_SETTING_VPN_ERROR_INVALID_PROPERTY
#else /* !NM_OPENVPN_OLD */
#include <NetworkManager.h>
#include <nma-ui-utils.h>
-#define OPENVPN_PLUGIN_UI_ERROR NM_CONNECTION_ERROR
-#define OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY NM_CONNECTION_ERROR_INVALID_PROPERTY
+#define OPENVPN_EDITOR_PLUGIN_ERROR NM_CONNECTION_ERROR
+#define OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY NM_CONNECTION_ERROR_INVALID_PROPERTY
#endif
#include "auth-helpers.h"
@@ -453,8 +453,8 @@ validate_tls (GtkBuilder *builder, const char *prefix, GError **error)
g_free (tmp);
if (!valid) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_CA);
return FALSE;
}
@@ -464,8 +464,8 @@ validate_tls (GtkBuilder *builder, const char *prefix, GError **error)
g_free (tmp);
if (!valid) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_CERT);
return FALSE;
}
@@ -476,8 +476,8 @@ validate_tls (GtkBuilder *builder, const char *prefix, GError **error)
g_free (tmp);
if (!valid) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_KEY);
return FALSE;
}
@@ -493,8 +493,8 @@ validate_tls (GtkBuilder *builder, const char *prefix, GError **error)
if (!gtk_entry_get_text_length (GTK_ENTRY (widget))) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_CERTPASS);
return FALSE;
}
@@ -520,16 +520,16 @@ auth_widget_check_validity (GtkBuilder *builder, const char *contype, GError **e
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (!str || !strlen (str)) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_USERNAME);
return FALSE;
}
} else if (!strcmp (contype, NM_OPENVPN_CONTYPE_PASSWORD)) {
if (!validate_file_chooser (builder, "pw_ca_cert_chooser")) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_CA);
return FALSE;
}
@@ -537,16 +537,16 @@ auth_widget_check_validity (GtkBuilder *builder, const char *contype, GError **e
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (!str || !strlen (str)) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_USERNAME);
return FALSE;
}
} else if (!strcmp (contype, NM_OPENVPN_CONTYPE_STATIC_KEY)) {
if (!validate_file_chooser (builder, "sk_key_chooser")) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_STATIC_KEY);
return FALSE;
}
@@ -555,8 +555,8 @@ auth_widget_check_validity (GtkBuilder *builder, const char *contype, GError **e
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (!str || !strlen (str)) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_LOCAL_IP);
return FALSE;
}
@@ -565,8 +565,8 @@ auth_widget_check_validity (GtkBuilder *builder, const char *contype, GError **e
str = gtk_entry_get_text (GTK_ENTRY (widget));
if (!str || !strlen (str)) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_REMOTE_IP);
return FALSE;
}
diff --git a/properties/import-export.c b/properties/import-export.c
index 6f5f0fa..b8aa34f 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -43,15 +43,15 @@
#define nm_simple_connection_new nm_connection_new
-#define OPENVPN_PLUGIN_UI_ERROR NM_SETTING_VPN_ERROR
-#define OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN NM_SETTING_VPN_ERROR_UNKNOWN
+#define OPENVPN_EDITOR_PLUGIN_ERROR NM_SETTING_VPN_ERROR
+#define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN NM_SETTING_VPN_ERROR_UNKNOWN
#else /* !NM_OPENVPN_OLD */
#include <NetworkManager.h>
-#define OPENVPN_PLUGIN_UI_ERROR NM_CONNECTION_ERROR
-#define OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN NM_CONNECTION_ERROR_FAILED
+#define OPENVPN_EDITOR_PLUGIN_ERROR NM_CONNECTION_ERROR
+#define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN NM_CONNECTION_ERROR_FAILED
#endif
#include "import-export.h"
@@ -736,15 +736,15 @@ do_import (const char *path, char **lines, GError **error)
if (!have_client && !have_sk) {
g_set_error_literal (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN,
_("The file to import wasn't a valid OpenVPN client configuration."));
g_object_unref (connection);
connection = NULL;
} else if (!have_remote) {
g_set_error_literal (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN,
_("The file to import wasn't a valid OpenVPN configure (no remote)."));
g_object_unref (connection);
connection = NULL;
diff --git a/properties/nm-openvpn.c b/properties/nm-openvpn.c
index 827a629..7ecfa21 100644
--- a/properties/nm-openvpn.c
+++ b/properties/nm-openvpn.c
@@ -47,11 +47,11 @@
#define OPENVPN_PLUGIN_NAME _("OpenVPN")
#define OPENVPN_PLUGIN_DESC _("Compatible with the OpenVPN server.")
-#define OPENVPN_PLUGIN_UI_ERROR NM_SETTING_VPN_ERROR
-#define OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY NM_SETTING_VPN_ERROR_INVALID_PROPERTY
-#define OPENVPN_PLUGIN_UI_ERROR_MISSING_PROPERTY NM_SETTING_VPN_ERROR_MISSING_PROPERTY
-#define OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN NM_SETTING_VPN_ERROR_UNKNOWN
-#define OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_READABLE NM_SETTING_VPN_ERROR_UNKNOWN
+#define OPENVPN_EDITOR_PLUGIN_ERROR NM_SETTING_VPN_ERROR
+#define OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY NM_SETTING_VPN_ERROR_INVALID_PROPERTY
+#define OPENVPN_EDITOR_PLUGIN_ERROR_MISSING_PROPERTY NM_SETTING_VPN_ERROR_MISSING_PROPERTY
+#define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN NM_SETTING_VPN_ERROR_UNKNOWN
+#define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE NM_SETTING_VPN_ERROR_UNKNOWN
#else /* !NM_OPENVPN_OLD */
@@ -60,11 +60,11 @@
#define OPENVPN_PLUGIN_NAME _("openvpn")
#define OPENVPN_PLUGIN_DESC _("OpenVPN")
-#define OPENVPN_PLUGIN_UI_ERROR NM_CONNECTION_ERROR
-#define OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY NM_CONNECTION_ERROR_INVALID_PROPERTY
-#define OPENVPN_PLUGIN_UI_ERROR_MISSING_PROPERTY NM_CONNECTION_ERROR_MISSING_PROPERTY
-#define OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN NM_CONNECTION_ERROR_FAILED
-#define OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_READABLE NM_CONNECTION_ERROR_FAILED
+#define OPENVPN_EDITOR_PLUGIN_ERROR NM_CONNECTION_ERROR
+#define OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY NM_CONNECTION_ERROR_INVALID_PROPERTY
+#define OPENVPN_EDITOR_PLUGIN_ERROR_MISSING_PROPERTY NM_CONNECTION_ERROR_MISSING_PROPERTY
+#define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN NM_CONNECTION_ERROR_FAILED
+#define OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE NM_CONNECTION_ERROR_FAILED
#endif
#include "../src/nm-openvpn-service-defines.h"
@@ -82,21 +82,21 @@ enum {
PROP_SERVICE
};
-static void openvpn_plugin_ui_interface_init (NMVpnEditorPluginInterface *iface_class);
+static void openvpn_editor_plugin_interface_init (NMVpnEditorPluginInterface *iface_class);
-G_DEFINE_TYPE_EXTENDED (OpenvpnPluginUi, openvpn_plugin_ui, G_TYPE_OBJECT, 0,
+G_DEFINE_TYPE_EXTENDED (OpenvpnEditorPlugin, openvpn_editor_plugin, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_EDITOR_PLUGIN,
- openvpn_plugin_ui_interface_init))
+ openvpn_editor_plugin_interface_init))
/************** UI widget class **************/
-static void openvpn_plugin_ui_widget_interface_init (NMVpnEditorInterface *iface_class);
+static void openvpn_editor_plugin_widget_interface_init (NMVpnEditorInterface *iface_class);
-G_DEFINE_TYPE_EXTENDED (OpenvpnPluginUiWidget, openvpn_plugin_ui_widget, G_TYPE_OBJECT, 0,
+G_DEFINE_TYPE_EXTENDED (OpenvpnEditor, openvpn_editor_plugin_widget, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_EDITOR,
- openvpn_plugin_ui_widget_interface_init))
+ openvpn_editor_plugin_widget_interface_init))
-#define OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
OPENVPN_TYPE_PLUGIN_UI_WIDGET, OpenvpnPluginUiWidgetPrivate))
+#define OPENVPN_EDITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), OPENVPN_TYPE_EDITOR,
OpenvpnEditorPrivate))
typedef struct {
GtkBuilder *builder;
@@ -106,7 +106,7 @@ typedef struct {
gboolean window_added;
GHashTable *advanced;
gboolean new_connection;
-} OpenvpnPluginUiWidgetPrivate;
+} OpenvpnEditorPrivate;
#define COL_AUTH_NAME 0
@@ -159,9 +159,9 @@ out:
}
static gboolean
-check_validity (OpenvpnPluginUiWidget *self, GError **error)
+check_validity (OpenvpnEditor *self, GError **error)
{
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
GtkWidget *widget;
const char *str;
GtkTreeModel *model;
@@ -179,8 +179,8 @@ check_validity (OpenvpnPluginUiWidget *self, GError **error)
gtk_widget_override_background_color (widget, GTK_STATE_NORMAL, !gateway_valid ? &rgba : NULL);
if (!gateway_valid) {
g_set_error (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY,
NM_OPENVPN_KEY_REMOTE);
return FALSE;
}
@@ -200,14 +200,14 @@ check_validity (OpenvpnPluginUiWidget *self, GError **error)
static void
stuff_changed_cb (GtkWidget *widget, gpointer user_data)
{
- g_signal_emit_by_name (OPENVPN_PLUGIN_UI_WIDGET (user_data), "changed");
+ g_signal_emit_by_name (OPENVPN_EDITOR (user_data), "changed");
}
static void
auth_combo_changed_cb (GtkWidget *combo, gpointer user_data)
{
- OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (user_data);
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditor *self = OPENVPN_EDITOR (user_data);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
GtkWidget *auth_notebook;
GtkWidget *show_passwords;
GtkTreeModel *model;
@@ -244,8 +244,8 @@ advanced_dialog_close_cb (GtkWidget *dialog, gpointer user_data)
static void
advanced_dialog_response_cb (GtkWidget *dialog, gint response, gpointer user_data)
{
- OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (user_data);
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditor *self = OPENVPN_EDITOR (user_data);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
GError *error = NULL;
if (response != GTK_RESPONSE_OK) {
@@ -268,8 +268,8 @@ advanced_dialog_response_cb (GtkWidget *dialog, gint response, gpointer user_dat
static void
advanced_button_clicked_cb (GtkWidget *button, gpointer user_data)
{
- OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (user_data);
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditor *self = OPENVPN_EDITOR (user_data);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
GtkWidget *dialog, *toplevel, *widget;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -303,9 +303,9 @@ advanced_button_clicked_cb (GtkWidget *button, gpointer user_data)
}
static gboolean
-init_plugin_ui (OpenvpnPluginUiWidget *self, NMConnection *connection, GError **error)
+init_editor_plugin (OpenvpnEditor *self, NMConnection *connection, GError **error)
{
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
NMSettingVpn *s_vpn;
GtkWidget *widget;
GtkListStore *store;
@@ -409,8 +409,8 @@ init_plugin_ui (OpenvpnPluginUiWidget *self, NMConnection *connection, GError **
static GObject *
get_widget (NMVpnEditor *iface)
{
- OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (iface);
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditor *self = OPENVPN_EDITOR (iface);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
return G_OBJECT (priv->widget);
}
@@ -454,8 +454,8 @@ update_connection (NMVpnEditor *iface,
NMConnection *connection,
GError **error)
{
- OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (iface);
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
+ OpenvpnEditor *self = OPENVPN_EDITOR (iface);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (self);
NMSettingVpn *s_vpn;
GtkWidget *widget;
char *str, *auth_type;
@@ -523,10 +523,10 @@ is_new_func (const char *key, const char *value, gpointer user_data)
}
static NMVpnEditor *
-nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
+nm_vpn_editor_interface_new (NMConnection *connection, GError **error)
{
NMVpnEditor *object;
- OpenvpnPluginUiWidgetPrivate *priv;
+ OpenvpnEditorPrivate *priv;
char *ui_file;
gboolean new = TRUE;
NMSettingVpn *s_vpn;
@@ -534,13 +534,13 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
if (error)
g_return_val_if_fail (*error == NULL, NULL);
- object = g_object_new (OPENVPN_TYPE_PLUGIN_UI_WIDGET, NULL);
+ object = g_object_new (OPENVPN_TYPE_EDITOR, NULL);
if (!object) {
- g_set_error_literal (error, OPENVPN_PLUGIN_UI_ERROR, 0, _("could not create openvpn object"));
+ g_set_error_literal (error, OPENVPN_EDITOR_PLUGIN_ERROR, 0, _("could not create openvpn
object"));
return NULL;
}
- priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (object);
+ priv = OPENVPN_EDITOR_GET_PRIVATE (object);
ui_file = g_strdup_printf ("%s/%s", UIDIR, "nm-openvpn-dialog.ui");
priv->builder = gtk_builder_new ();
@@ -551,7 +551,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
g_warning ("Couldn't load builder file: %s",
error && *error ? (*error)->message : "(unknown)");
g_clear_error (error);
- g_set_error (error, OPENVPN_PLUGIN_UI_ERROR, 0,
+ g_set_error (error, OPENVPN_EDITOR_PLUGIN_ERROR, 0,
"could not load required resources from %s", ui_file);
g_free (ui_file);
g_object_unref (object);
@@ -562,7 +562,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
priv->widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "openvpn-vbox"));
if (!priv->widget) {
- g_set_error_literal (error, OPENVPN_PLUGIN_UI_ERROR, 0, _("could not load UI widget"));
+ g_set_error_literal (error, OPENVPN_EDITOR_PLUGIN_ERROR, 0, _("could not load UI widget"));
g_object_unref (object);
return NULL;
}
@@ -575,7 +575,7 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
nm_setting_vpn_foreach_data_item (s_vpn, is_new_func, &new);
priv->new_connection = new;
- if (!init_plugin_ui (OPENVPN_PLUGIN_UI_WIDGET (object), connection, error)) {
+ if (!init_editor_plugin (OPENVPN_EDITOR (object), connection, error)) {
g_object_unref (object);
return NULL;
}
@@ -592,8 +592,8 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
static void
dispose (GObject *object)
{
- OpenvpnPluginUiWidget *plugin = OPENVPN_PLUGIN_UI_WIDGET (object);
- OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (plugin);
+ OpenvpnEditor *plugin = OPENVPN_EDITOR (object);
+ OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (plugin);
if (priv->group)
g_object_unref (priv->group);
@@ -610,26 +610,26 @@ dispose (GObject *object)
if (priv->advanced)
g_hash_table_destroy (priv->advanced);
- G_OBJECT_CLASS (openvpn_plugin_ui_widget_parent_class)->dispose (object);
+ G_OBJECT_CLASS (openvpn_editor_plugin_widget_parent_class)->dispose (object);
}
static void
-openvpn_plugin_ui_widget_class_init (OpenvpnPluginUiWidgetClass *req_class)
+openvpn_editor_plugin_widget_class_init (OpenvpnEditorClass *req_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
- g_type_class_add_private (req_class, sizeof (OpenvpnPluginUiWidgetPrivate));
+ g_type_class_add_private (req_class, sizeof (OpenvpnEditorPrivate));
object_class->dispose = dispose;
}
static void
-openvpn_plugin_ui_widget_init (OpenvpnPluginUiWidget *plugin)
+openvpn_editor_plugin_widget_init (OpenvpnEditor *plugin)
{
}
static void
-openvpn_plugin_ui_widget_interface_init (NMVpnEditorInterface *iface_class)
+openvpn_editor_plugin_widget_interface_init (NMVpnEditorInterface *iface_class)
{
/* interface implementation */
iface_class->get_widget = get_widget;
@@ -651,8 +651,8 @@ import (NMVpnEditorPlugin *iface, const char *path, GError **error)
&& !g_str_has_suffix (ext, ".cnf")
&& !g_str_has_suffix (ext, ".ovpntest"))) { /* Special extension for testcases */
g_set_error_literal (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN,
_("unknown OpenVPN file extension"));
goto out;
}
@@ -679,8 +679,8 @@ import (NMVpnEditorPlugin *iface, const char *path, GError **error)
lines = g_strsplit_set (contents, "\r\n", 0);
if (g_strv_length (lines) <= 1) {
g_set_error_literal (error,
- OPENVPN_PLUGIN_UI_ERROR,
- OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_READABLE,
+ OPENVPN_EDITOR_PLUGIN_ERROR,
+ OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_READABLE,
_("not a valid OpenVPN configuration file"));
goto out;
}
@@ -731,7 +731,7 @@ get_capabilities (NMVpnEditorPlugin *iface)
static NMVpnEditor *
get_editor (NMVpnEditorPlugin *iface, NMConnection *connection, GError **error)
{
- return nm_vpn_plugin_ui_widget_interface_new (connection, error);
+ return nm_vpn_editor_interface_new (connection, error);
}
static void
@@ -755,7 +755,7 @@ get_property (GObject *object, guint prop_id,
}
static void
-openvpn_plugin_ui_class_init (OpenvpnPluginUiClass *req_class)
+openvpn_editor_plugin_class_init (OpenvpnEditorPluginClass *req_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
@@ -775,12 +775,12 @@ openvpn_plugin_ui_class_init (OpenvpnPluginUiClass *req_class)
}
static void
-openvpn_plugin_ui_init (OpenvpnPluginUi *plugin)
+openvpn_editor_plugin_init (OpenvpnEditorPlugin *plugin)
{
}
static void
-openvpn_plugin_ui_interface_init (NMVpnEditorPluginInterface *iface_class)
+openvpn_editor_plugin_interface_init (NMVpnEditorPluginInterface *iface_class)
{
/* interface implementation */
iface_class->get_editor = get_editor;
@@ -800,6 +800,6 @@ nm_vpn_editor_plugin_factory (GError **error)
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- return g_object_new (OPENVPN_TYPE_PLUGIN_UI, NULL);
+ return g_object_new (OPENVPN_TYPE_EDITOR_PLUGIN, NULL);
}
diff --git a/properties/nm-openvpn.h b/properties/nm-openvpn.h
index 4aa3826..bda4888 100644
--- a/properties/nm-openvpn.h
+++ b/properties/nm-openvpn.h
@@ -25,46 +25,46 @@
#include <glib-object.h>
-#define OPENVPN_TYPE_PLUGIN_UI (openvpn_plugin_ui_get_type ())
-#define OPENVPN_PLUGIN_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OPENVPN_TYPE_PLUGIN_UI,
OpenvpnPluginUi))
-#define OPENVPN_PLUGIN_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OPENVPN_TYPE_PLUGIN_UI,
OpenvpnPluginUiClass))
-#define OPENVPN_IS_PLUGIN_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OPENVPN_TYPE_PLUGIN_UI))
-#define OPENVPN_IS_PLUGIN_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OPENVPN_TYPE_PLUGIN_UI))
-#define OPENVPN_PLUGIN_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OPENVPN_TYPE_PLUGIN_UI,
OpenvpnPluginUiClass))
+#define OPENVPN_TYPE_EDITOR_PLUGIN (openvpn_editor_plugin_get_type ())
+#define OPENVPN_EDITOR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
OPENVPN_TYPE_EDITOR_PLUGIN, OpenvpnEditorPlugin))
+#define OPENVPN_EDITOR_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OPENVPN_TYPE_EDITOR_PLUGIN,
OpenvpnEditorPluginClass))
+#define OPENVPN_IS_EDITOR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
OPENVPN_TYPE_EDITOR_PLUGIN))
+#define OPENVPN_IS_EDITOR_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
OPENVPN_TYPE_EDITOR_PLUGIN))
+#define OPENVPN_EDITOR_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OPENVPN_TYPE_EDITOR_PLUGIN,
OpenvpnEditorPluginClass))
-typedef struct _OpenvpnPluginUi OpenvpnPluginUi;
-typedef struct _OpenvpnPluginUiClass OpenvpnPluginUiClass;
+typedef struct _OpenvpnEditorPlugin OpenvpnEditorPlugin;
+typedef struct _OpenvpnEditorPluginClass OpenvpnEditorPluginClass;
-struct _OpenvpnPluginUi {
+struct _OpenvpnEditorPlugin {
GObject parent;
};
-struct _OpenvpnPluginUiClass {
+struct _OpenvpnEditorPluginClass {
GObjectClass parent;
};
-GType openvpn_plugin_ui_get_type (void);
+GType openvpn_editor_plugin_get_type (void);
-#define OPENVPN_TYPE_PLUGIN_UI_WIDGET (openvpn_plugin_ui_widget_get_type ())
-#define OPENVPN_PLUGIN_UI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
OPENVPN_TYPE_PLUGIN_UI_WIDGET, OpenvpnPluginUiWidget))
-#define OPENVPN_PLUGIN_UI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
OPENVPN_TYPE_PLUGIN_UI_WIDGET, OpenvpnPluginUiWidgetClass))
-#define OPENVPN_IS_PLUGIN_UI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
OPENVPN_TYPE_PLUGIN_UI_WIDGET))
-#define OPENVPN_IS_PLUGIN_UI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
OPENVPN_TYPE_PLUGIN_UI_WIDGET))
-#define OPENVPN_PLUGIN_UI_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
OPENVPN_TYPE_PLUGIN_UI_WIDGET, OpenvpnPluginUiWidgetClass))
+#define OPENVPN_TYPE_EDITOR (openvpn_editor_plugin_widget_get_type ())
+#define OPENVPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OPENVPN_TYPE_EDITOR,
OpenvpnEditor))
+#define OPENVPN_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OPENVPN_TYPE_EDITOR,
OpenvpnEditorClass))
+#define OPENVPN_IS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OPENVPN_TYPE_EDITOR))
+#define OPENVPN_IS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OPENVPN_TYPE_EDITOR))
+#define OPENVPN_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OPENVPN_TYPE_EDITOR,
OpenvpnEditorClass))
-typedef struct _OpenvpnPluginUiWidget OpenvpnPluginUiWidget;
-typedef struct _OpenvpnPluginUiWidgetClass OpenvpnPluginUiWidgetClass;
+typedef struct _OpenvpnEditor OpenvpnEditor;
+typedef struct _OpenvpnEditorClass OpenvpnEditorClass;
-struct _OpenvpnPluginUiWidget {
+struct _OpenvpnEditor {
GObject parent;
};
-struct _OpenvpnPluginUiWidgetClass {
+struct _OpenvpnEditorClass {
GObjectClass parent;
};
-GType openvpn_plugin_ui_widget_get_type (void);
+GType openvpn_editor_plugin_widget_get_type (void);
#endif /* _NM_OPENVPN_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]