[network-manager-applet/rm-userset: 3/4] editor: port to NM 0.9
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/rm-userset: 3/4] editor: port to NM 0.9
- Date: Fri, 24 Dec 2010 15:54:06 +0000 (UTC)
commit a85daec1ac44b6bbec620df27fdbd570624b8a67
Author: Dan Williams <dcbw redhat com>
Date: Thu Dec 23 10:10:46 2010 -0600
editor: port to NM 0.9
src/connection-editor/Makefile.am | 2 -
src/connection-editor/ce-page.c | 2 -
src/connection-editor/ce-polkit-button.c | 115 +++--------
src/connection-editor/ce-polkit-button.h | 8 +-
src/connection-editor/nm-connection-editor.c | 150 +++++--------
src/connection-editor/nm-connection-editor.h | 11 +-
src/connection-editor/nm-connection-list.c | 288 +++++++-----------------
src/connection-editor/nm-connection-list.h | 10 +-
src/connection-editor/page-dsl.c | 1 -
src/connection-editor/page-mobile.c | 1 -
src/connection-editor/page-wired-security.c | 1 -
src/connection-editor/page-wireless-security.c | 1 -
src/connection-editor/vpn-helpers.c | 6 +-
13 files changed, 167 insertions(+), 429 deletions(-)
---
diff --git a/src/connection-editor/Makefile.am b/src/connection-editor/Makefile.am
index 139879f..6f1cef5 100644
--- a/src/connection-editor/Makefile.am
+++ b/src/connection-editor/Makefile.am
@@ -12,7 +12,6 @@ nm_connection_editor_CPPFLAGS = \
-DNMALOCALEDIR=\"$(datadir)/locale\" \
$(DBUS_CFLAGS) \
$(DISABLE_DEPRECATED) \
- -I${top_srcdir}/src/gconf-helpers \
-I${top_srcdir}/src/utils \
-I${top_srcdir}/src/wireless-security \
-I${top_builddir}/src/marshallers
@@ -60,7 +59,6 @@ nm-connection-editor-service-glue.h: $(top_srcdir)/src/connection-editor/nm-conn
$(AM_V_GEN) dbus-binding-tool --prefix=nm_connection_editor_service --mode=glib-server --output=$@ $<
nm_connection_editor_LDADD = \
- $(top_builddir)/src/gconf-helpers/libgconf-helpers.la \
${top_builddir}/src/wireless-security/libwireless-security.la \
${top_builddir}/src/utils/libutils.la \
${top_builddir}/src/marshallers/libmarshallers.la \
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 717bca3..8f149d4 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -31,7 +31,6 @@
#include <nm-setting-connection.h>
#include <nm-utils.h>
-#include <nm-settings-connection-interface.h>
#include "ce-page.h"
#include "nma-marshal.h"
@@ -408,7 +407,6 @@ ce_page_new_connection (const char *format,
GSList *connections;
connection = nm_connection_new ();
- nm_connection_set_scope (connection, NM_CONNECTION_SCOPE_USER);
s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
nm_connection_add_setting (connection, NM_SETTING (s_con));
diff --git a/src/connection-editor/ce-polkit-button.c b/src/connection-editor/ce-polkit-button.c
index aedcd7d..2d4fc31 100644
--- a/src/connection-editor/ce-polkit-button.c
+++ b/src/connection-editor/ce-polkit-button.c
@@ -43,17 +43,15 @@ typedef struct {
GtkWidget *stock;
GtkWidget *auth;
- NMRemoteSettingsSystem *settings;
- NMSettingsSystemPermissions permission;
- gboolean use_polkit;
- GSList *perm_calls;
+ NMClient *client;
+ NMClientPermission permission;
/* authorized = TRUE if either explicitly authorized or if the action
* could be performed if the user successfully authenticated to gain the
* authorization.
*/
gboolean authorized;
- guint check_id;
+ guint perm_id;
} CEPolkitButtonPrivate;
enum {
@@ -71,7 +69,7 @@ update_button (CEPolkitButton *self, gboolean actionable)
gtk_widget_set_sensitive (GTK_WIDGET (self), actionable);
- if (priv->use_polkit && priv->authorized) {
+ if (priv->authorized) {
gtk_button_set_label (GTK_BUTTON (self), priv->auth_label);
gtk_widget_set_tooltip_text (GTK_WIDGET (self), priv->auth_tooltip);
gtk_button_set_image (GTK_BUTTON (self), priv->auth);
@@ -94,19 +92,6 @@ update_and_emit (CEPolkitButton *self, gboolean old_actionable)
}
void
-ce_polkit_button_set_use_polkit (CEPolkitButton *self, gboolean use_polkit)
-{
- gboolean old_actionable;
-
- g_return_if_fail (self != NULL);
- g_return_if_fail (CE_IS_POLKIT_BUTTON (self));
-
- old_actionable = ce_polkit_button_get_actionable (self);
- CE_POLKIT_BUTTON_GET_PRIVATE (self)->use_polkit = use_polkit;
- update_and_emit (self, old_actionable);
-}
-
-void
ce_polkit_button_set_master_sensitive (CEPolkitButton *self, gboolean sensitive)
{
gboolean old_actionable;
@@ -129,14 +114,7 @@ ce_polkit_button_get_actionable (CEPolkitButton *self)
priv = CE_POLKIT_BUTTON_GET_PRIVATE (self);
- if (!priv->master_sensitive)
- return FALSE;
-
- /* If polkit is in-use, the button is only actionable if the operation is
- * authorized or able to be authorized via user authentication. If polkit
- * isn't in-use, the button will always be actionable unless insensitive.
- */
- return priv->use_polkit ? priv->authorized : TRUE;
+ return priv->master_sensitive && priv->authorized;
}
gboolean
@@ -148,60 +126,23 @@ ce_polkit_button_get_authorized (CEPolkitButton *self)
return CE_POLKIT_BUTTON_GET_PRIVATE (self)->authorized;
}
-typedef struct {
- CEPolkitButton *self;
- gboolean disposed;
-} PermInfo;
-
static void
-get_permissions_cb (NMSettingsSystemInterface *settings,
- NMSettingsSystemPermissions permissions,
- GError *error,
- gpointer user_data)
+permission_changed_cb (NMClient *client,
+ NMClientPermission permission,
+ NMClientPermissionResult result,
+ CEPolkitButton *self)
{
- PermInfo *info = user_data;
- CEPolkitButton *self = info->self;
- CEPolkitButtonPrivate *priv;
+ CEPolkitButtonPrivate *priv = CE_POLKIT_BUTTON_GET_PRIVATE (self);
gboolean old_actionable, old_authorized;
- /* Response might come when button is already disposed */
- if (info->disposed)
- goto out;
-
- priv = CE_POLKIT_BUTTON_GET_PRIVATE (info->self);
-
- priv->perm_calls = g_slist_remove (priv->perm_calls, info);
-
old_actionable = ce_polkit_button_get_actionable (self);
old_authorized = priv->authorized;
- priv->authorized = (permissions & priv->permission);
- if (priv->use_polkit)
- update_and_emit (self, old_actionable);
+ priv->authorized = (result == NM_CLIENT_PERMISSION_RESULT_YES || result == NM_CLIENT_PERMISSION_RESULT_AUTH);
+ update_and_emit (self, old_actionable);
if (priv->authorized != old_authorized)
g_signal_emit (self, signals[AUTHORIZED], 0, priv->authorized);
-
-out:
- g_free (info);
-}
-
-static void
-check_permissions_cb (NMRemoteSettingsSystem *settings, CEPolkitButton *self)
-{
- PermInfo *info;
- CEPolkitButtonPrivate *priv;
-
- info = g_malloc0 (sizeof (PermInfo));
- info->self = self;
-
- priv = CE_POLKIT_BUTTON_GET_PRIVATE (info->self);
- priv->perm_calls = g_slist_append (priv->perm_calls, info);
-
- /* recheck permissions */
- nm_settings_system_interface_get_permissions (NM_SETTINGS_SYSTEM_INTERFACE (settings),
- get_permissions_cb,
- info);
}
GtkWidget *
@@ -210,8 +151,8 @@ ce_polkit_button_new (const char *label,
const char *auth_label,
const char *auth_tooltip,
const char *stock_icon,
- NMRemoteSettingsSystem *settings,
- NMSettingsSystemPermissions permission)
+ NMClient *client,
+ NMClientPermission permission)
{
GObject *object;
CEPolkitButtonPrivate *priv;
@@ -227,13 +168,12 @@ ce_polkit_button_new (const char *label,
priv->auth_label = g_strdup (auth_label);
priv->auth_tooltip = g_strdup (auth_tooltip);
priv->permission = permission;
- priv->use_polkit = FALSE;
- priv->settings = g_object_ref (settings);
- priv->check_id = g_signal_connect (settings,
- NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS,
- G_CALLBACK (check_permissions_cb),
- object);
+ priv->client = g_object_ref (client);
+ priv->perm_id = g_signal_connect (client,
+ "permission-changed",
+ G_CALLBACK (permission_changed_cb),
+ object);
priv->stock = gtk_image_new_from_stock (stock_icon, GTK_ICON_SIZE_BUTTON);
g_object_ref_sink (priv->stock);
@@ -243,7 +183,10 @@ ce_polkit_button_new (const char *label,
update_button (CE_POLKIT_BUTTON (object),
ce_polkit_button_get_actionable (CE_POLKIT_BUTTON (object)));
- check_permissions_cb (settings, CE_POLKIT_BUTTON (object));
+ permission_changed_cb (client,
+ permission,
+ nm_client_get_permission_result (client, permission),
+ CE_POLKIT_BUTTON (object));
return GTK_WIDGET (object);
}
@@ -252,7 +195,6 @@ static void
dispose (GObject *object)
{
CEPolkitButtonPrivate *priv = CE_POLKIT_BUTTON_GET_PRIVATE (object);
- GSList *iter;
if (priv->disposed) {
g_warning ("%s: CEPolkitButton object %p disposed twice", __func__, object);
@@ -262,14 +204,10 @@ dispose (GObject *object)
priv->disposed = TRUE;
- /* Mark any ongoing permissions calls as disposed */
- for (iter = priv->perm_calls; iter; iter = g_slist_next (iter))
- ((PermInfo *) iter->data)->disposed = TRUE;
-
- if (priv->check_id)
- g_signal_handler_disconnect (priv->settings, priv->check_id);
+ if (priv->perm_id)
+ g_signal_handler_disconnect (priv->client, priv->perm_id);
- g_object_unref (priv->settings);
+ g_object_unref (priv->client);
g_object_unref (priv->auth);
g_object_unref (priv->stock);
@@ -285,7 +223,6 @@ finalize (GObject *object)
g_free (priv->auth_label);
g_free (priv->tooltip);
g_free (priv->auth_tooltip);
- g_slist_free (priv->perm_calls);
G_OBJECT_CLASS (ce_polkit_button_parent_class)->finalize (object);
}
diff --git a/src/connection-editor/ce-polkit-button.h b/src/connection-editor/ce-polkit-button.h
index bb31bbc..90fe688 100644
--- a/src/connection-editor/ce-polkit-button.h
+++ b/src/connection-editor/ce-polkit-button.h
@@ -25,7 +25,7 @@
#include <gtk/gtk.h>
-#include "nm-remote-settings-system.h"
+#include <nm-client.h>
#define CE_TYPE_POLKIT_BUTTON (ce_polkit_button_get_type ())
#define CE_POLKIT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CE_TYPE_POLKIT_BUTTON, CEPolkitButton))
@@ -54,10 +54,8 @@ GtkWidget *ce_polkit_button_new (const char *label,
const char *auth_label,
const char *auth_tooltip,
const char *stock_icon,
- NMRemoteSettingsSystem *settings,
- NMSettingsSystemPermissions permission);
-
-void ce_polkit_button_set_use_polkit (CEPolkitButton *button, gboolean use_polkit);
+ NMClient *client,
+ NMClientPermission permission);
void ce_polkit_button_set_master_sensitive (CEPolkitButton *button, gboolean sensitive);
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 34b3257..3cc271b 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -47,8 +47,9 @@
#include <nm-setting-cdma.h>
#include <nm-utils.h>
+#include <nm-remote-connection.h>
+
#include "nm-connection-editor.h"
-#include "gconf-helpers.h"
#include "nma-marshal.h"
#include "ce-page.h"
@@ -128,10 +129,19 @@ ui_to_setting (NMConnectionEditor *editor)
autoconnect = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_AUTOCONNECT, autoconnect, NULL);
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->system_checkbutton)))
- nm_connection_set_scope (editor->connection, NM_CONNECTION_SCOPE_SYSTEM);
- else
- nm_connection_set_scope (editor->connection, NM_CONNECTION_SCOPE_USER);
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->all_checkbutton))) {
+ /* Visible to everyone */
+ g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_PERMISSIONS, NULL, NULL);
+ } else {
+ GSList *users = NULL;
+ char buf[75] = "user:";
+
+ /* Visible only to this user */
+ strcat (buf, g_get_user_name ());
+ users = g_slist_append (users, buf);
+ g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_PERMISSIONS, users, NULL);
+ g_slist_free (users);
+ }
return TRUE;
}
@@ -157,27 +167,18 @@ update_sensitivity (NMConnectionEditor *editor)
*/
if ( !nm_setting_connection_get_read_only (s_con)
&& editor_is_initialized (editor)) {
- if (editor->system_settings_can_modify) {
+ if (editor->can_modify) {
actionable = ce_polkit_button_get_actionable (CE_POLKIT_BUTTON (editor->ok_button));
authorized = ce_polkit_button_get_authorized (CE_POLKIT_BUTTON (editor->ok_button));
}
- if (editor->orig_scope == NM_CONNECTION_SCOPE_SYSTEM) {
- /* If the user cannot ever be authorized to change system connections, and
- * the connection is a system connection, we desensitize the entire dialog.
- */
- sensitive = authorized;
- } else {
- /* Otherwise, if the connection is originally a user-connection,
- * then everything is sensitive except possible the system checkbutton,
- * which will be insensitive if the user has no possibility of
- * authorizing.
- */
- sensitive = TRUE;
- }
+ /* If the user cannot ever be authorized to change system connections,
+ * we desensitize the entire dialog.
+ */
+ sensitive = authorized;
}
- gtk_widget_set_sensitive (GTK_WIDGET (editor->system_checkbutton), actionable && authorized);
+ gtk_widget_set_sensitive (GTK_WIDGET (editor->all_checkbutton), actionable && authorized);
/* Cancel button is always sensitive */
gtk_widget_set_sensitive (GTK_WIDGET (editor->cancel_button), TRUE);
@@ -248,27 +249,25 @@ ok_button_actionable_cb (GtkWidget *button,
}
static void
-can_modify_changed_cb (NMRemoteSettingsSystem *settings,
- GParamSpec *pspec,
- NMConnectionEditor *editor)
+permissions_changed_cb (NMClient *client,
+ NMClientPermission permission,
+ NMClientPermissionResult result,
+ NMConnectionEditor *editor)
{
+ if (permission != NM_CLIENT_PERMISSION_SETTINGS_CONNECTION_MODIFY)
+ return;
+
+ if (result == NM_CLIENT_PERMISSION_RESULT_YES || result == NM_CLIENT_PERMISSION_RESULT_AUTH)
+ editor->can_modify = TRUE;
+ else
+ editor->can_modify = FALSE;
+
connection_editor_validate (editor);
}
static void
-system_checkbutton_toggled_cb (GtkWidget *widget, NMConnectionEditor *editor)
+all_checkbutton_toggled_cb (GtkWidget *widget, NMConnectionEditor *editor)
{
- gboolean use_polkit = TRUE;
-
- /* The only time the Save button does not need to use polkit is when the
- * original connection scope was USER and the "system" checkbutton is
- * unchecked.
- */
- if ( !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))
- && (editor->orig_scope == NM_CONNECTION_SCOPE_USER))
- use_polkit = FALSE;
-
- ce_polkit_button_set_use_polkit (CE_POLKIT_BUTTON (editor->ok_button), use_polkit);
connection_editor_validate (editor);
}
@@ -299,7 +298,7 @@ nm_connection_editor_init (NMConnectionEditor *editor)
editor->window = GTK_WIDGET (gtk_builder_get_object (editor->builder, "nm-connection-editor"));
editor->cancel_button = GTK_WIDGET (gtk_builder_get_object (editor->builder, "cancel_button"));
- editor->system_checkbutton = GTK_WIDGET (gtk_builder_get_object (editor->builder, "system_checkbutton"));
+ editor->all_checkbutton = GTK_WIDGET (gtk_builder_get_object (editor->builder, "system_checkbutton"));
}
static void
@@ -377,12 +376,11 @@ nm_connection_editor_class_init (NMConnectionEditorClass *klass)
NMConnectionEditor *
nm_connection_editor_new (NMConnection *connection,
- NMRemoteSettingsSystem *settings,
+ NMClient *client,
GError **error)
{
NMConnectionEditor *editor;
GtkWidget *hbox;
- gboolean sensitive = TRUE, use_polkit = FALSE;
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
@@ -392,32 +390,20 @@ nm_connection_editor_new (NMConnection *connection,
return NULL;
}
- g_object_get (settings,
- NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY,
- &editor->system_settings_can_modify,
- NULL);
- g_signal_connect (settings,
- "notify::" NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY,
- G_CALLBACK (can_modify_changed_cb),
+ editor->can_modify = nm_client_get_permission_result (client, NM_CLIENT_PERMISSION_SETTINGS_CONNECTION_MODIFY);
+ g_signal_connect (client,
+ "permission-changed",
+ G_CALLBACK (permissions_changed_cb),
editor);
- /* If this is a system connection that we can't ever modify,
- * set the editor's Save button always insensitive.
- */
- if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) {
- sensitive = editor->system_settings_can_modify;
- use_polkit = TRUE;
- }
-
editor->ok_button = ce_polkit_button_new (_("_Save"),
_("Save any changes made to this connection."),
_("_Save..."),
_("Authenticate to save this connection for all users of this machine."),
GTK_STOCK_APPLY,
- settings,
- NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY);
+ client,
+ NM_CLIENT_PERMISSION_SETTINGS_CONNECTION_MODIFY);
gtk_button_set_use_underline (GTK_BUTTON (editor->ok_button), TRUE);
- ce_polkit_button_set_use_polkit (CE_POLKIT_BUTTON (editor->ok_button), use_polkit);
g_signal_connect (editor->ok_button, "actionable",
G_CALLBACK (ok_button_actionable_cb), editor);
@@ -458,8 +444,6 @@ nm_connection_editor_update_connection (NMConnectionEditor *editor, GError **err
nm_connection_replace_settings (editor->orig_connection, settings, NULL);
g_hash_table_destroy (settings);
- nm_connection_set_scope (editor->orig_connection,
- nm_connection_get_scope (editor->connection));
return TRUE;
}
@@ -487,10 +471,9 @@ populate_connection_ui (NMConnectionEditor *editor)
g_signal_connect_swapped (name, "changed", G_CALLBACK (connection_editor_validate), editor);
g_signal_connect_swapped (autoconnect, "toggled", G_CALLBACK (connection_editor_validate), editor);
- g_signal_connect (editor->system_checkbutton, "toggled", G_CALLBACK (system_checkbutton_toggled_cb), editor);
+ g_signal_connect (editor->all_checkbutton, "toggled", G_CALLBACK (all_checkbutton_toggled_cb), editor);
- if (editor->orig_scope == NM_CONNECTION_SCOPE_SYSTEM)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->system_checkbutton), TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->all_checkbutton), TRUE);
connection_editor_validate (editor);
}
@@ -560,7 +543,7 @@ page_initialized (CEPage *page, gpointer unused, GError *error, gpointer user_da
static void request_secrets (GetSecretsInfo *info);
static void
-get_secrets_cb (NMSettingsConnectionInterface *connection,
+get_secrets_cb (NMRemoteConnection *connection,
GHashTable *secrets,
GError *error,
gpointer user_data)
@@ -596,24 +579,14 @@ get_secrets_cb (NMSettingsConnectionInterface *connection,
static void
request_secrets (GetSecretsInfo *info)
{
- NMSettingsConnectionInterface *connection;
- gboolean success;
- GError *error;
-
g_return_if_fail (info != NULL);
- connection = NM_SETTINGS_CONNECTION_INTERFACE (info->self->orig_connection);
- success = nm_settings_connection_interface_get_secrets (connection,
- info->setting_name,
- NULL,
- FALSE,
- get_secrets_cb,
- info);
- if (!success) {
- error = g_error_new_literal (0, 0, _("Failed to update connection secrets due to an unknown error."));
- get_secrets_cb (connection, NULL, error, info);
- g_error_free (error);
- }
+ nm_remote_connection_get_secrets (NM_REMOTE_CONNECTION (info->self->orig_connection),
+ info->setting_name,
+ NULL,
+ FALSE,
+ get_secrets_cb,
+ info);
}
static void
@@ -637,7 +610,7 @@ get_secrets_for_page (NMConnectionEditor *self,
* is an NMConnection because it hasn't been exported over D-Bus yet, so we
* can't ask it for secrets, because it doesn't implement NMSettingsConnectionInterface.
*/
- if (!NM_IS_SETTINGS_CONNECTION_INTERFACE (self->orig_connection)) {
+ if (!NM_IS_REMOTE_CONNECTION (self->orig_connection)) {
ce_page_complete_init (page, setting_name, NULL, NULL);
return;
}
@@ -717,7 +690,6 @@ nm_connection_editor_set_connection (NMConnectionEditor *editor,
editor->connection = nm_connection_duplicate (orig_connection);
editor->orig_connection = g_object_ref (orig_connection);
- editor->orig_scope = nm_connection_get_scope (editor->connection);
nm_connection_editor_update_title (editor);
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_CONNECTION));
@@ -822,24 +794,6 @@ nm_connection_editor_run (NMConnectionEditor *self)
nm_connection_editor_present (self);
}
-void
-nm_connection_editor_save_vpn_secrets (NMConnectionEditor *editor)
-{
- GSList *iter;
-
- g_return_if_fail (NM_IS_CONNECTION_EDITOR (editor));
- g_return_if_fail (nm_connection_get_scope (editor->connection) == NM_CONNECTION_SCOPE_USER);
-
- for (iter = editor->pages; iter; iter = g_slist_next (iter)) {
- CEPage *page = CE_PAGE (iter->data);
-
- if (CE_IS_PAGE_VPN (page)) {
- ce_page_vpn_save_secrets (page, editor->connection);
- break;
- }
- }
-}
-
GtkWindow *
nm_connection_editor_get_window (NMConnectionEditor *editor)
{
diff --git a/src/connection-editor/nm-connection-editor.h b/src/connection-editor/nm-connection-editor.h
index 561f2a3..7cf8548 100644
--- a/src/connection-editor/nm-connection-editor.h
+++ b/src/connection-editor/nm-connection-editor.h
@@ -26,7 +26,7 @@
#include <glib-object.h>
-#include "nm-remote-settings-system.h"
+#include <nm-client.h>
#define NM_TYPE_CONNECTION_EDITOR (nm_connection_editor_get_type ())
#define NM_IS_CONNECTION_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION_EDITOR))
@@ -42,13 +42,11 @@ typedef struct {
NMConnection *connection;
NMConnection *orig_connection;
- NMConnectionScope orig_scope;
-
GetSecretsInfo *secrets_call;
GSList *pending_secrets_calls;
- GtkWidget *system_checkbutton;
- gboolean system_settings_can_modify;
+ GtkWidget *all_checkbutton;
+ NMClientPermissionResult can_modify;
GSList *initializing_pages;
GSList *pages;
@@ -70,12 +68,11 @@ typedef struct {
GType nm_connection_editor_get_type (void);
NMConnectionEditor *nm_connection_editor_new (NMConnection *connection,
- NMRemoteSettingsSystem *settings,
+ NMClient *client,
GError **error);
void nm_connection_editor_present (NMConnectionEditor *editor);
void nm_connection_editor_run (NMConnectionEditor *editor);
-void nm_connection_editor_save_vpn_secrets (NMConnectionEditor *editor);
NMConnection * nm_connection_editor_get_connection (NMConnectionEditor *editor);
gboolean nm_connection_editor_update_connection (NMConnectionEditor *editor, GError **error);
GtkWindow * nm_connection_editor_get_window (NMConnectionEditor *editor);
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index 44b7510..a74ddda 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -27,7 +27,6 @@
#include <unistd.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
#include <gdk/gdkx.h>
#include <glib/gi18n.h>
@@ -44,7 +43,7 @@
#include <nm-setting-serial.h>
#include <nm-vpn-plugin-ui-interface.h>
#include <nm-utils.h>
-#include <nm-settings-system-interface.h>
+#include <nm-remote-settings.h>
#include "ce-page.h"
#include "page-wired.h"
@@ -54,7 +53,6 @@
#include "page-vpn.h"
#include "nm-connection-editor.h"
#include "nm-connection-list.h"
-#include "gconf-helpers.h"
#include "utils.h"
#include "vpn-helpers.h"
#include "ce-polkit-button.h"
@@ -107,14 +105,14 @@ error_dialog (GtkWindow *parent, const char *heading, const char *format, ...)
gtk_widget_destroy (dialog);
}
-static NMSettingsConnectionInterface *
+static NMRemoteConnection *
get_active_connection (GtkTreeView *treeview)
{
GtkTreeSelection *selection;
GList *selected_rows;
GtkTreeModel *model = NULL;
GtkTreeIter iter;
- NMSettingsConnectionInterface *connection = NULL;
+ NMRemoteConnection *connection = NULL;
selection = gtk_tree_view_get_selection (treeview);
selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
@@ -151,7 +149,7 @@ get_treeview_for_type (NMConnectionList *list, GType ctype)
}
static GtkListStore *
-get_model_for_connection (NMConnectionList *list, NMSettingsConnectionInterface *connection)
+get_model_for_connection (NMConnectionList *list, NMRemoteConnection *connection)
{
NMSettingConnection *s_con;
GtkTreeView *treeview;
@@ -183,7 +181,7 @@ get_model_for_connection (NMConnectionList *list, NMSettingsConnectionInterface
static gboolean
get_iter_for_connection (GtkTreeModel *model,
- NMSettingsConnectionInterface *connection,
+ NMRemoteConnection *connection,
GtkTreeIter *iter)
{
GtkTreeIter temp_iter;
@@ -193,7 +191,7 @@ get_iter_for_connection (GtkTreeModel *model,
return FALSE;
do {
- NMSettingsConnectionInterface *candidate = NULL;
+ NMRemoteConnection *candidate = NULL;
gtk_tree_model_get (model, &temp_iter, COL_CONNECTION, &candidate, -1);
if (candidate && (candidate == connection)) {
@@ -281,7 +279,7 @@ out:
static void
update_connection_row (GtkListStore *store,
GtkTreeIter *iter,
- NMSettingsConnectionInterface *connection)
+ NMRemoteConnection *connection)
{
NMSettingConnection *s_con;
char *last_used;
@@ -309,63 +307,29 @@ typedef void (*DeleteResultFunc) (NMConnectionList *list,
typedef struct {
NMConnectionList *list;
- NMSettingsConnectionInterface *original;
- NMConnectionScope orig_scope;
+ NMRemoteConnection *original;
NMConnectionEditor *editor;
DeleteResultFunc callback;
gpointer callback_data;
} DeleteInfo;
static void
-delete_cb (NMSettingsConnectionInterface *connection_iface,
+delete_cb (NMRemoteConnection *remote,
GError *error,
gpointer user_data)
{
DeleteInfo *info = user_data;
- NMConnection *connection = NM_CONNECTION (connection_iface);
if (info->editor)
nm_connection_editor_set_busy (info->editor, FALSE);
- if (!error && (info->orig_scope == NM_CONNECTION_SCOPE_USER)) {
- NMSettingConnection *s_con;
- NMSettingVPN *s_vpn;
- NMVpnPluginUiInterface *plugin;
- GError *vpn_error = NULL;
-
- s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
- g_assert (s_con);
-
- /* Clean up VPN secrets and any plugin-specific data */
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_VPN_SETTING_NAME))
- goto done;
-
- s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN);
- if (!s_vpn)
- goto done;
-
- plugin = vpn_get_plugin_by_service (nm_setting_vpn_get_service_type (s_vpn));
- if (!plugin)
- goto done;
-
- if (!nm_vpn_plugin_ui_interface_delete_connection (plugin, connection, &vpn_error)) {
- g_warning ("%s: couldn't clean up VPN connection on delete: (%d) %s",
- __func__,
- vpn_error ? vpn_error->code : -1,
- (vpn_error && vpn_error->message) ? vpn_error->message : "unknown");
- g_clear_error (&vpn_error);
- }
- }
-
-done:
info->callback (info->list, error, info->callback_data);
g_free (info);
}
static void
delete_connection (NMConnectionList *list,
- NMSettingsConnectionInterface *connection,
- NMConnectionScope orig_scope,
+ NMRemoteConnection *connection,
DeleteResultFunc callback,
gpointer user_data)
{
@@ -376,7 +340,6 @@ delete_connection (NMConnectionList *list,
info = g_malloc0 (sizeof (DeleteInfo));
info->list = list;
- info->orig_scope = orig_scope;
info->callback = callback;
info->callback_data = user_data;
info->editor = editor;
@@ -384,7 +347,7 @@ delete_connection (NMConnectionList *list,
if (editor)
nm_connection_editor_set_busy (editor, TRUE);
- nm_settings_connection_interface_delete (connection, delete_cb, info);
+ nm_remote_connection_delete (connection, delete_cb, info);
}
/**********************************************/
@@ -402,22 +365,14 @@ typedef struct {
} AddInfo;
static void
-add_cb (NMSettingsInterface *settings,
+add_cb (NMRemoteSettings *settings,
+ NMRemoteConnection *connection,
GError *error,
gpointer user_data)
{
AddInfo *info = user_data;
- NMConnection *connection;
nm_connection_editor_set_busy (info->editor, FALSE);
-
- if (!error) {
- /* Let the VPN plugin save its secrets */
- connection = nm_connection_editor_get_connection (info->editor);
- if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_USER)
- nm_connection_editor_save_vpn_secrets (info->editor);
- }
-
info->callback (info->list, error, info->callback_data);
g_free (info);
}
@@ -428,9 +383,6 @@ add_connection (NMConnectionList *self,
AddResultFunc callback,
gpointer callback_data)
{
- NMSettingsInterface *settings = NULL;
- NMConnection *connection;
- NMConnectionScope scope;
AddInfo *info;
info = g_malloc0 (sizeof (AddInfo));
@@ -439,33 +391,26 @@ add_connection (NMConnectionList *self,
info->callback = callback;
info->callback_data = callback_data;
- connection = nm_connection_editor_get_connection (editor);
- g_assert (connection);
- scope = nm_connection_get_scope (connection);
- if (scope == NM_CONNECTION_SCOPE_SYSTEM)
- settings = NM_SETTINGS_INTERFACE (self->system_settings);
- else if (scope == NM_CONNECTION_SCOPE_USER)
- settings = NM_SETTINGS_INTERFACE (self->gconf_settings);
- else
- g_assert_not_reached ();
-
nm_connection_editor_set_busy (editor, TRUE);
- nm_settings_interface_add_connection (settings, connection, add_cb, info);
+
+ nm_remote_settings_add_connection (self->settings,
+ nm_connection_editor_get_connection (editor),
+ add_cb,
+ info);
}
/**********************************************/
/* Connection updating */
typedef void (*UpdateResultFunc) (NMConnectionList *list,
- NMSettingsConnectionInterface *connection,
+ NMRemoteConnection *connection,
GError *error,
gpointer user_data);
typedef struct {
NMConnectionList *list;
NMConnectionEditor *editor;
- NMSettingsConnectionInterface *connection;
- NMConnectionScope orig_scope;
+ NMRemoteConnection *connection;
UpdateResultFunc callback;
gpointer callback_data;
} UpdateInfo;
@@ -479,46 +424,12 @@ update_complete (UpdateInfo *info, GError *error)
}
static void
-update_remove_result_cb (NMConnectionList *list,
- GError *error,
- gpointer user_data)
-{
- UpdateInfo *info = user_data;
-
- update_complete (info, error);
-}
-
-static void
-update_add_result_cb (NMConnectionList *list, GError *error, gpointer user_data)
-{
- UpdateInfo *info = user_data;
-
- if (error) {
- /* set the old scope back on the connection */
- nm_connection_set_scope (NM_CONNECTION (info->connection), info->orig_scope);
- update_complete (info, error);
- return;
- }
-
- /* Now try to remove the original connection */
- delete_connection (list, info->connection, info->orig_scope, update_remove_result_cb, info);
-}
-
-static void
-update_cb (NMSettingsConnectionInterface *connection,
- GError *error,
- gpointer user_data)
+update_cb (NMRemoteConnection *connection, GError *error, gpointer user_data)
{
UpdateInfo *info = user_data;
nm_connection_editor_set_busy (info->editor, FALSE);
- if (!error) {
- /* Save user-connection vpn secrets */
- if (nm_connection_get_scope (NM_CONNECTION (connection)) == NM_CONNECTION_SCOPE_USER)
- nm_connection_editor_save_vpn_secrets (info->editor);
- }
-
/* Clear secrets so they don't lay around in memory; they'll get requested
* again anyway next time the connection is edited.
*/
@@ -530,55 +441,34 @@ update_cb (NMSettingsConnectionInterface *connection,
static void
update_connection (NMConnectionList *list,
NMConnectionEditor *editor,
- NMSettingsConnectionInterface *connection,
- NMConnectionScope orig_scope,
+ NMRemoteConnection *connection,
UpdateResultFunc callback,
gpointer user_data)
{
- NMConnectionScope new_scope;
UpdateInfo *info;
+ GHashTable *new_settings;
+ GError *error = NULL;
info = g_malloc0 (sizeof (UpdateInfo));
info->list = list;
info->editor = editor;
info->connection = g_object_ref (connection);
- info->orig_scope = orig_scope;
info->callback = callback;
info->callback_data = user_data;
- new_scope = nm_connection_get_scope (NM_CONNECTION (connection));
- if (new_scope == orig_scope) {
- /* The easy part: Connection is just updated and has the same scope */
- GHashTable *new_settings;
- GError *error = NULL;
-
- /* System connections need the certificates filled because the
- * applet private values that we use to store the path to certificates
- * and private keys don't go through D-Bus; they are private of course!
- */
- if (new_scope == NM_CONNECTION_SCOPE_SYSTEM) {
- new_settings = nm_connection_to_hash (NM_CONNECTION (connection));
- if (!nm_connection_replace_settings (NM_CONNECTION (connection),
- new_settings,
- &error)) {
- update_complete (info, error);
- g_error_free (error);
- return;
- }
- }
-
- /* Update() actually saves the connection settings to backing storage,
- * either GConf or over D-Bus.
- */
- nm_connection_editor_set_busy (editor, TRUE);
- nm_settings_connection_interface_update (connection, update_cb, info);
- } else {
- /* The hard part: Connection scope changed:
- * Add the modified connection to the new settings service, then delete
- * the original connection from the old settings service.
- */
- add_connection (list, editor, update_add_result_cb, info);
+ /* Connections need the certificates filled because the
+ * applet private values that we use to store the path to certificates
+ * and private keys don't go through D-Bus; they are private of course!
+ */
+ new_settings = nm_connection_to_hash (NM_CONNECTION (connection));
+ if (!nm_connection_replace_settings (NM_CONNECTION (connection), new_settings, &error)) {
+ update_complete (info, error);
+ g_error_free (error);
+ return;
}
+
+ nm_connection_editor_set_busy (editor, TRUE);
+ nm_remote_connection_commit_changes (connection, update_cb, info);
}
/**********************************************/
@@ -665,7 +555,7 @@ really_add_connection (NMConnection *connection,
return;
}
- editor = nm_connection_editor_new (connection, info->list->system_settings, &error);
+ editor = nm_connection_editor_new (connection, info->list->nm_client, &error);
if (!editor) {
g_object_unref (connection);
@@ -688,8 +578,7 @@ page_get_connections (gpointer user_data)
{
ActionInfo *info = (ActionInfo *) user_data;
- return g_slist_concat (nm_settings_interface_list_connections (NM_SETTINGS_INTERFACE (info->list->system_settings)),
- nm_settings_interface_list_connections (NM_SETTINGS_INTERFACE (info->list->gconf_settings)));
+ return nm_remote_settings_list_connections (info->list->settings);
}
static void
@@ -715,12 +604,11 @@ add_clicked (GtkButton *button, gpointer user_data)
typedef struct {
NMConnectionList *list;
NMConnectionEditor *editor;
- NMConnectionScope orig_scope;
} EditInfo;
static void
connection_updated_cb (NMConnectionList *list,
- NMSettingsConnectionInterface *connection,
+ NMRemoteConnection *connection,
GError *error,
gpointer user_data)
{
@@ -764,8 +652,7 @@ edit_done_cb (NMConnectionEditor *editor, gint response, GError *error, gpointer
/* Save the connection to backing storage */
update_connection (info->list,
editor,
- NM_SETTINGS_CONNECTION_INTERFACE (connection),
- info->orig_scope,
+ NM_REMOTE_CONNECTION (connection),
connection_updated_cb,
info);
} else {
@@ -775,7 +662,7 @@ edit_done_cb (NMConnectionEditor *editor, gint response, GError *error, gpointer
g_type_name (nm_connection_lookup_setting_type_by_quark (edit_error->domain)),
edit_error->message, edit_error->code);
connection_updated_cb (info->list,
- NM_SETTINGS_CONNECTION_INTERFACE (connection),
+ NM_REMOTE_CONNECTION (connection),
edit_error,
info);
g_error_free (edit_error);
@@ -798,7 +685,7 @@ edit_done_cb (NMConnectionEditor *editor, gint response, GError *error, gpointer
static void
do_edit (ActionInfo *info)
{
- NMSettingsConnectionInterface *connection;
+ NMRemoteConnection *connection;
NMConnectionEditor *editor;
EditInfo *edit_info;
GError *error = NULL;
@@ -814,7 +701,7 @@ do_edit (ActionInfo *info)
return;
}
- editor = nm_connection_editor_new (NM_CONNECTION (connection), info->list->system_settings, &error);
+ editor = nm_connection_editor_new (NM_CONNECTION (connection), info->list->nm_client, &error);
if (!editor) {
error_dialog (info->list_window,
_("Could not edit connection"),
@@ -826,7 +713,6 @@ do_edit (ActionInfo *info)
edit_info = g_malloc0 (sizeof (EditInfo));
edit_info->list = info->list;
edit_info->editor = editor;
- edit_info->orig_scope = nm_connection_get_scope (NM_CONNECTION (connection));
g_signal_connect (editor, "done", G_CALLBACK (edit_done_cb), edit_info);
g_hash_table_insert (info->list->editors, connection, editor);
@@ -849,7 +735,7 @@ static void
delete_clicked (GtkButton *button, gpointer user_data)
{
ActionInfo *info = (ActionInfo *) user_data;
- NMSettingsConnectionInterface *connection;
+ NMRemoteConnection *connection;
NMConnectionEditor *editor;
NMSettingConnection *s_con;
GtkWidget *dialog;
@@ -888,7 +774,6 @@ delete_clicked (GtkButton *button, gpointer user_data)
if (result == GTK_RESPONSE_YES) {
delete_connection (info->list,
connection,
- nm_connection_get_scope (NM_CONNECTION (connection)),
delete_result_cb,
GTK_WINDOW (info->list->dialog));
}
@@ -900,30 +785,21 @@ pk_button_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
ActionInfo *info = (ActionInfo *) user_data;
GtkTreeIter iter;
GtkTreeModel *model;
- NMSettingsConnectionInterface *connection;
+ NMRemoteConnection *connection;
NMSettingConnection *s_con;
- NMConnectionScope scope;
gboolean sensitive = FALSE;
- gboolean use_polkit = FALSE;
- if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- goto done;
-
- connection = get_active_connection (info->treeview);
- if (!connection)
- goto done;
-
- scope = nm_connection_get_scope (NM_CONNECTION (connection));
- use_polkit = (scope == NM_CONNECTION_SCOPE_SYSTEM);
-
- s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection),
- NM_TYPE_SETTING_CONNECTION);
- g_assert (s_con);
-
- sensitive = !nm_setting_connection_get_read_only (s_con);
+ if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
+ connection = get_active_connection (info->treeview);
+ if (connection) {
+ s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection),
+ NM_TYPE_SETTING_CONNECTION);
+ g_assert (s_con);
+
+ sensitive = !nm_setting_connection_get_read_only (s_con);
+ }
+ }
-done:
- ce_polkit_button_set_use_polkit (CE_POLKIT_BUTTON (info->button), use_polkit);
ce_polkit_button_set_master_sensitive (CE_POLKIT_BUTTON (info->button), sensitive);
}
@@ -932,7 +808,7 @@ vpn_list_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data)
{
ActionInfo *info = (ActionInfo *) user_data;
NMVpnPluginUiInterface *plugin;
- NMSettingsConnectionInterface *connection;
+ NMRemoteConnection *connection;
NMSettingVPN *s_vpn;
const char *service_type;
GtkTreeIter iter;
@@ -988,10 +864,7 @@ import_success_cb (NMConnection *connection, gpointer user_data)
if (!s) {
GSList *connections;
- connections = nm_settings_interface_list_connections (NM_SETTINGS_INTERFACE (info->list->system_settings));
- connections = g_slist_concat (connections,
- nm_settings_interface_list_connections (NM_SETTINGS_INTERFACE (info->list->gconf_settings)));
-
+ connections = nm_remote_settings_list_connections (info->list->settings);
s = utils_next_available_name (connections, _("VPN connection %d"));
g_object_set (s_con, NM_SETTING_CONNECTION_ID, s, NULL);
g_free (s);
@@ -1033,7 +906,7 @@ import_success_cb (NMConnection *connection, gpointer user_data)
return;
}
- editor = nm_connection_editor_new (connection, info->list->system_settings, &error);
+ editor = nm_connection_editor_new (connection, info->list->nm_client, &error);
if (!editor) {
g_object_unref (connection);
error_dialog (info->list_window,
@@ -1059,7 +932,7 @@ static void
export_vpn_cb (GtkButton *button, gpointer user_data)
{
ActionInfo *info = (ActionInfo *) user_data;
- NMSettingsConnectionInterface *connection;
+ NMRemoteConnection *connection;
connection = get_active_connection (info->treeview);
if (connection)
@@ -1113,16 +986,13 @@ dispose (GObject *object)
if (list->gui)
g_object_unref (list->gui);
- if (list->client)
- g_object_unref (list->client);
+ if (list->nm_client)
+ g_object_unref (list->nm_client);
g_slist_free (list->treeviews);
- if (list->gconf_settings)
- g_object_unref (list->gconf_settings);
-
- if (list->system_settings)
- g_object_unref (list->system_settings);
+ if (list->settings)
+ g_object_unref (list->settings);
G_OBJECT_CLASS (nm_connection_list_parent_class)->dispose (object);
}
@@ -1295,8 +1165,8 @@ add_connection_buttons (NMConnectionList *self,
_("_Edit..."),
_("Authenticate to edit the selected connection"),
GTK_STOCK_EDIT,
- self->system_settings,
- NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY);
+ self->nm_client,
+ NM_CLIENT_PERMISSION_SETTINGS_CONNECTION_MODIFY);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
gtk_box_pack_end (GTK_BOX (hbox), button, TRUE, TRUE, 0);
@@ -1313,8 +1183,8 @@ add_connection_buttons (NMConnectionList *self,
_("_Delete..."),
_("Authenticate to delete the selected connection"),
GTK_STOCK_DELETE,
- self->system_settings,
- NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY);
+ self->nm_client,
+ NM_CLIENT_PERMISSION_SETTINGS_CONNECTION_MODIFY);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
gtk_box_pack_end (GTK_BOX (hbox), button, TRUE, TRUE, 0);
@@ -1422,7 +1292,7 @@ add_connection_tabs (NMConnectionList *self, GType def_type)
}
static void
-connection_removed (NMSettingsConnectionInterface *connection, gpointer user_data)
+connection_removed (NMRemoteConnection *connection, gpointer user_data)
{
GtkListStore *store = GTK_LIST_STORE (user_data);
GtkTreeIter iter;
@@ -1432,7 +1302,7 @@ connection_removed (NMSettingsConnectionInterface *connection, gpointer user_dat
}
static void
-connection_updated (NMSettingsConnectionInterface *connection,
+connection_updated (NMRemoteConnection *connection,
GHashTable *settings,
gpointer user_data)
{
@@ -1444,8 +1314,8 @@ connection_updated (NMSettingsConnectionInterface *connection,
}
static void
-connection_added (NMSettingsInterface *settings,
- NMSettingsConnectionInterface *connection,
+connection_added (NMRemoteSettings *settings,
+ NMRemoteConnection *connection,
gpointer user_data)
{
NMConnectionList *self = NM_CONNECTION_LIST (user_data);
@@ -1517,8 +1387,8 @@ nm_connection_list_new (GType def_type)
ICON_LOAD(list->vpn_icon, "nm-vpn-standalone-lock");
ICON_LOAD(list->unknown_icon, "nm-no-connection");
- list->client = gconf_client_get_default ();
- if (!list->client)
+ list->nm_client = nm_client_new ();
+ if (!list->nm_client)
goto error;
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
@@ -1528,16 +1398,10 @@ nm_connection_list_new (GType def_type)
goto error;
}
- list->system_settings = nm_remote_settings_system_new (bus);
+ list->settings = nm_remote_settings_new (bus);
dbus_g_connection_unref (bus);
- g_signal_connect (list->system_settings,
- NM_SETTINGS_INTERFACE_NEW_CONNECTION,
- G_CALLBACK (connection_added),
- list);
-
- list->gconf_settings = nma_gconf_settings_new (NULL);
- g_signal_connect (list->gconf_settings,
- NM_SETTINGS_INTERFACE_NEW_CONNECTION,
+ g_signal_connect (list->settings,
+ NM_REMOTE_SETTINGS_NEW_CONNECTION,
G_CALLBACK (connection_added),
list);
diff --git a/src/connection-editor/nm-connection-list.h b/src/connection-editor/nm-connection-list.h
index 52954a2..314cc5e 100644
--- a/src/connection-editor/nm-connection-list.h
+++ b/src/connection-editor/nm-connection-list.h
@@ -24,11 +24,10 @@
#define NM_CONNECTION_LIST_H
#include <glib-object.h>
-#include <gconf/gconf-client.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#include <nm-remote-settings-system.h>
-#include "nma-gconf-settings.h"
+#include <nm-client.h>
+#include <nm-remote-settings.h>
#define NM_TYPE_CONNECTION_LIST (nm_connection_list_get_type ())
#define NM_IS_CONNECTION_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION_LIST))
@@ -41,9 +40,8 @@ typedef struct {
GHashTable *editors;
GSList *treeviews;
- GConfClient *client;
- NMAGConfSettings *gconf_settings;
- NMRemoteSettingsSystem *system_settings;
+ NMClient *nm_client;
+ NMRemoteSettings *settings;
GtkBuilder *gui;
GtkWidget *dialog;
diff --git a/src/connection-editor/page-dsl.c b/src/connection-editor/page-dsl.c
index 94da531..fdba4d5 100644
--- a/src/connection-editor/page-dsl.c
+++ b/src/connection-editor/page-dsl.c
@@ -32,7 +32,6 @@
#include "page-dsl.h"
#include "nm-connection-editor.h"
-#include "gconf-helpers.h"
G_DEFINE_TYPE (CEPageDsl, ce_page_dsl, CE_TYPE_PAGE)
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index afe2fab..9605619 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -34,7 +34,6 @@
#include "page-mobile.h"
#include "nm-connection-editor.h"
-#include "gconf-helpers.h"
#include "mobile-wizard.h"
G_DEFINE_TYPE (CEPageMobile, ce_page_mobile, CE_TYPE_PAGE)
diff --git a/src/connection-editor/page-wired-security.c b/src/connection-editor/page-wired-security.c
index e955b50..19f8ef7 100644
--- a/src/connection-editor/page-wired-security.c
+++ b/src/connection-editor/page-wired-security.c
@@ -36,7 +36,6 @@
#include "page-wired.h"
#include "page-wired-security.h"
#include "nm-connection-editor.h"
-#include "gconf-helpers.h"
G_DEFINE_TYPE (CEPageWiredSecurity, ce_page_wired_security, CE_TYPE_PAGE)
diff --git a/src/connection-editor/page-wireless-security.c b/src/connection-editor/page-wireless-security.c
index f8b5821..153c949 100644
--- a/src/connection-editor/page-wireless-security.c
+++ b/src/connection-editor/page-wireless-security.c
@@ -36,7 +36,6 @@
#include "page-wireless.h"
#include "page-wireless-security.h"
#include "nm-connection-editor.h"
-#include "gconf-helpers.h"
G_DEFINE_TYPE (CEPageWirelessSecurity, ce_page_wireless_security, CE_TYPE_PAGE)
diff --git a/src/connection-editor/vpn-helpers.c b/src/connection-editor/vpn-helpers.c
index bde55a0..aea909e 100644
--- a/src/connection-editor/vpn-helpers.c
+++ b/src/connection-editor/vpn-helpers.c
@@ -212,11 +212,9 @@ import_vpn_from_file_cb (GtkWidget *dialog, gint response, gpointer user_data)
g_hash_table_foreach (plugins, try_import, (gpointer) &import_info);
connection = import_info.connection;
- if (connection) {
- if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_UNKNOWN)
- nm_connection_set_scope (connection, NM_CONNECTION_SCOPE_USER);
+ if (connection)
info->callback (connection, info->user_data);
- } else {
+ else {
GtkWidget *err_dialog;
char *basename = g_path_get_basename (filename);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]