[network-manager-applet: 3/7] editor: allow changes on one page modify other pages



commit cc2c8276a914ed8b2b72f458330d7ee1f77a8c84
Author: Jiří Klimeš <jklimes redhat com>
Date:   Fri Oct 2 11:33:17 2015 +0200

    editor: allow changes on one page modify other pages
    
    Changes in properties on a page may require changes on other pages. Let's add
    an infrastructure for that.
    When a change should influence other page(s), the information is set using
    nm_connection_editor_inter_page_set_value(). And then that can be retrieved by
    nm_connection_editor_inter_page_get_value() in another page in method
    inter_page_change().

 src/connection-editor/ce-page.c              |   20 +++++++++++++
 src/connection-editor/ce-page.h              |   10 ++++++-
 src/connection-editor/nm-connection-editor.c |   38 +++++++++++++++++++++++++-
 src/connection-editor/nm-connection-editor.h |   15 ++++++++++
 src/connection-editor/page-8021x-security.c  |    4 ++-
 src/connection-editor/page-8021x-security.h  |    3 +-
 src/connection-editor/page-bluetooth.c       |    4 ++-
 src/connection-editor/page-bluetooth.h       |    3 +-
 src/connection-editor/page-bond.c            |   12 +++++---
 src/connection-editor/page-bond.h            |    3 +-
 src/connection-editor/page-bridge-port.c     |    4 ++-
 src/connection-editor/page-bridge-port.h     |    3 +-
 src/connection-editor/page-bridge.c          |    4 ++-
 src/connection-editor/page-bridge.h          |    3 +-
 src/connection-editor/page-dcb.c             |    4 ++-
 src/connection-editor/page-dcb.h             |    3 +-
 src/connection-editor/page-dsl.c             |    4 ++-
 src/connection-editor/page-dsl.h             |    3 +-
 src/connection-editor/page-ethernet.c        |    4 ++-
 src/connection-editor/page-ethernet.h        |    3 +-
 src/connection-editor/page-general.c         |    4 ++-
 src/connection-editor/page-general.h         |    3 +-
 src/connection-editor/page-infiniband.c      |    4 ++-
 src/connection-editor/page-infiniband.h      |    3 +-
 src/connection-editor/page-ip4.c             |    4 ++-
 src/connection-editor/page-ip4.h             |    3 +-
 src/connection-editor/page-ip6.c             |    4 ++-
 src/connection-editor/page-ip6.h             |    3 +-
 src/connection-editor/page-mobile.c          |    4 ++-
 src/connection-editor/page-mobile.h          |    3 +-
 src/connection-editor/page-ppp.c             |    4 ++-
 src/connection-editor/page-ppp.h             |    3 +-
 src/connection-editor/page-team-port.c       |    4 ++-
 src/connection-editor/page-team-port.h       |    3 +-
 src/connection-editor/page-team.c            |   12 +++++---
 src/connection-editor/page-team.h            |    3 +-
 src/connection-editor/page-vlan.c            |    4 ++-
 src/connection-editor/page-vlan.h            |    3 +-
 src/connection-editor/page-vpn.c             |    4 ++-
 src/connection-editor/page-vpn.h             |    3 +-
 src/connection-editor/page-wifi-security.c   |    4 ++-
 src/connection-editor/page-wifi-security.h   |    3 +-
 src/connection-editor/page-wifi.c            |    5 +++-
 src/connection-editor/page-wifi.h            |    3 +-
 44 files changed, 190 insertions(+), 50 deletions(-)
---
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 1194ed9..3f79c22 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -151,6 +151,24 @@ ce_page_last_update (CEPage *self, NMConnection *connection, GError **error)
        return TRUE;
 }
 
+gboolean
+ce_page_inter_page_change (CEPage *self)
+{
+       gboolean ret = FALSE;
+
+       g_return_val_if_fail (CE_IS_PAGE (self), FALSE);
+
+       if (self->inter_page_change_running)
+               return FALSE;
+
+       self->inter_page_change_running = TRUE;
+       if (CE_PAGE_GET_CLASS (self)->inter_page_change)
+               ret = CE_PAGE_GET_CLASS (self)->inter_page_change (self);
+       self->inter_page_change_running = FALSE;
+
+       return ret;
+}
+
 static void
 _set_active_combo_item (GtkComboBox *combo, const char *item,
                         const char *combo_item, int combo_idx)
@@ -766,6 +784,7 @@ ce_page_new_connection (const char *format,
 
 CEPage *
 ce_page_new (GType page_type,
+             NMConnectionEditor *editor,
              NMConnection *connection,
              GtkWindow *parent_window,
              NMClient *client,
@@ -786,6 +805,7 @@ ce_page_new (GType page_type,
                                      NULL));
        self->title = g_strdup (title);
        self->client = client;
+       self->editor = editor;
 
        if (ui_file) {
                if (!gtk_builder_add_from_file (self->builder, ui_file, &error)) {
diff --git a/src/connection-editor/ce-page.h b/src/connection-editor/ce-page.h
index 2c11514..efafc03 100644
--- a/src/connection-editor/ce-page.h
+++ b/src/connection-editor/ce-page.h
@@ -30,6 +30,7 @@
 
 #include <NetworkManager.h>
 
+#include "nm-connection-editor.h"
 #include "utils.h"
 
 /* for ARPHRD_ETHER / ARPHRD_INFINIBAND for MAC utilies */
@@ -63,12 +64,14 @@ typedef struct {
        GObject parent;
 
        gboolean initialized;
+       gboolean inter_page_change_running;
        GtkBuilder *builder;
        GtkWidget *page;
        char *title;
 
        gulong secrets_done_validate;
 
+       NMConnectionEditor *editor;
        NMConnection *connection;
        GtkWindow *parent_window;
        NMClient *client;
@@ -80,6 +83,7 @@ typedef struct {
        /* Virtual functions */
        gboolean    (*ce_page_validate_v) (CEPage *self, NMConnection *connection, GError **error);
        gboolean    (*last_update)  (CEPage *self, NMConnection *connection, GError **error);
+       gboolean    (*inter_page_change)  (CEPage *self);
 
        /* Signals */
        void        (*changed)     (CEPage *self);
@@ -87,7 +91,8 @@ typedef struct {
 } CEPageClass;
 
 
-typedef CEPage* (*CEPageNewFunc)(NMConnection *connection,
+typedef CEPage* (*CEPageNewFunc)(NMConnectionEditor *editor,
+                                 NMConnection *connection,
                                  GtkWindow *parent,
                                  NMClient *client,
                                  const char **out_secrets_setting_name,
@@ -102,6 +107,7 @@ const char * ce_page_get_title (CEPage *self);
 
 gboolean ce_page_validate (CEPage *self, NMConnection *connection, GError **error);
 gboolean ce_page_last_update (CEPage *self, NMConnection *connection, GError **error);
+gboolean ce_page_inter_page_change (CEPage *self);
 
 void ce_page_setup_mac_combo (CEPage *self, GtkComboBox *combo,
                               const char *mac, char **mac_list);
@@ -146,6 +152,7 @@ NMConnection *ce_page_new_connection (const char *format,
                                       gpointer user_data);
 
 CEPage *ce_page_new (GType page_type,
+                     NMConnectionEditor *editor,
                      NMConnection *connection,
                      GtkWindow *parent_window,
                      NMClient *client,
@@ -153,5 +160,6 @@ CEPage *ce_page_new (GType page_type,
                      const char *widget_name,
                      const char *title);
 
+
 #endif  /* __CE_PAGE_H__ */
 
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 9c7a1ef..8de0680 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -258,6 +258,12 @@ permissions_changed_cb (NMClient *client,
 }
 
 static void
+destroy_inter_page_item (gpointer data)
+{
+       return;
+}
+
+static void
 nm_connection_editor_init (NMConnectionEditor *editor)
 {
        GtkWidget *dialog;
@@ -290,6 +296,8 @@ nm_connection_editor_init (NMConnectionEditor *editor)
 
        editor->cancel_button = GTK_WIDGET (gtk_builder_get_object (editor->builder, "cancel_button"));
        editor->export_button = GTK_WIDGET (gtk_builder_get_object (editor->builder, "export_button"));
+
+       editor->inter_page_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, 
(GDestroyNotify) destroy_inter_page_item);
 }
 
 static void
@@ -361,6 +369,8 @@ dispose (GObject *object)
 
        g_clear_pointer (&editor->last_validation_error, g_free);
 
+       g_hash_table_destroy (editor->inter_page_hash);
+
 out:
        G_OBJECT_CLASS (nm_connection_editor_parent_class)->dispose (object);
 }
@@ -507,6 +517,14 @@ static void
 page_changed (CEPage *page, gpointer user_data)
 {
        NMConnectionEditor *editor = NM_CONNECTION_EDITOR (user_data);
+       GSList *iter;
+
+       /* Do page interdependent changes */
+       for (iter = editor->pages; iter; iter = g_slist_next (iter))
+               ce_page_inter_page_change (CE_PAGE (iter->data));
+
+       if (editor_is_initialized (editor))
+               nm_connection_editor_inter_page_clear_data (editor);
 
        connection_editor_validate (editor);
 }
@@ -695,7 +713,7 @@ add_page (NMConnectionEditor *editor,
        g_return_val_if_fail (func != NULL, FALSE);
        g_return_val_if_fail (connection != NULL, FALSE);
 
-       page = (*func) (connection, GTK_WINDOW (editor->window), editor->client,
+       page = (*func) (editor, connection, GTK_WINDOW (editor->window), editor->client,
                        &secrets_setting_name, error);
        if (page) {
                g_object_set_data_full (G_OBJECT (page),
@@ -1119,3 +1137,21 @@ nm_connection_editor_warning (GtkWindow *parent, const char *heading, const char
        va_end (args);
 }
 
+void
+nm_connection_editor_inter_page_set_value (NMConnectionEditor *editor, InterPageChangeType type, gpointer 
value)
+{
+       g_hash_table_insert (editor->inter_page_hash, GUINT_TO_POINTER (type), value);
+}
+
+gboolean
+nm_connection_editor_inter_page_get_value (NMConnectionEditor *editor, InterPageChangeType type, gpointer 
*value)
+{
+       return g_hash_table_lookup_extended (editor->inter_page_hash, GUINT_TO_POINTER (type), NULL, value);
+}
+
+void
+nm_connection_editor_inter_page_clear_data (NMConnectionEditor *editor)
+{
+       g_hash_table_remove_all (editor->inter_page_hash);
+}
+
diff --git a/src/connection-editor/nm-connection-editor.h b/src/connection-editor/nm-connection-editor.h
index 259e8dc..bdbab11 100644
--- a/src/connection-editor/nm-connection-editor.h
+++ b/src/connection-editor/nm-connection-editor.h
@@ -66,6 +66,8 @@ typedef struct {
        guint validate_id;
 
        char *last_validation_error;
+
+       GHashTable *inter_page_hash;
 } NMConnectionEditor;
 
 typedef struct {
@@ -75,6 +77,11 @@ typedef struct {
        void (*done)  (NMConnectionEditor *editor, gint result, GError *error);
 } NMConnectionEditorClass;
 
+typedef enum {
+       /* Add item for inter-page changes here */
+       DUMMY,
+} InterPageChangeType;
+
 GType               nm_connection_editor_get_type (void);
 NMConnectionEditor *nm_connection_editor_new (GtkWindow *parent_window,
                                               NMConnection *connection,
@@ -98,4 +105,12 @@ void                nm_connection_editor_warning (GtkWindow *parent,
                                                   const char *format,
                                                   ...);
 
+void               nm_connection_editor_inter_page_set_value (NMConnectionEditor *editor,
+                                                              InterPageChangeType type,
+                                                              gpointer value);
+gboolean           nm_connection_editor_inter_page_get_value (NMConnectionEditor *editor,
+                                                              InterPageChangeType type,
+                                                              gpointer *value);
+void               nm_connection_editor_inter_page_clear_data (NMConnectionEditor *editor);
+
 #endif
diff --git a/src/connection-editor/page-8021x-security.c b/src/connection-editor/page-8021x-security.c
index f484a5d..0ff13ae 100644
--- a/src/connection-editor/page-8021x-security.c
+++ b/src/connection-editor/page-8021x-security.c
@@ -91,7 +91,8 @@ finish_setup (CEPage8021xSecurity *self, gpointer unused, GError *error, gpointe
 }
 
 CEPage *
-ce_page_8021x_security_new (NMConnection *connection,
+ce_page_8021x_security_new (NMConnectionEditor *editor,
+                            NMConnection *connection,
                             GtkWindow *parent_window,
                             NMClient *client,
                             const char **out_secrets_setting_name,
@@ -102,6 +103,7 @@ ce_page_8021x_security_new (NMConnection *connection,
        CEPage *parent;
 
        self = CE_PAGE_8021X_SECURITY (ce_page_new (CE_TYPE_PAGE_8021X_SECURITY,
+                                                   editor,
                                                    connection,
                                                    parent_window,
                                                    client,
diff --git a/src/connection-editor/page-8021x-security.h b/src/connection-editor/page-8021x-security.h
index b06e33f..439360c 100644
--- a/src/connection-editor/page-8021x-security.h
+++ b/src/connection-editor/page-8021x-security.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_8021x_security_get_type (void);
 
-CEPage *ce_page_8021x_security_new (NMConnection *connection,
+CEPage *ce_page_8021x_security_new (NMConnectionEditor *editor,
+                                    NMConnection *connection,
                                     GtkWindow *parent,
                                     NMClient *client,
                                     const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-bluetooth.c b/src/connection-editor/page-bluetooth.c
index 23ec596..de51127 100644
--- a/src/connection-editor/page-bluetooth.c
+++ b/src/connection-editor/page-bluetooth.c
@@ -90,7 +90,8 @@ finish_setup (CEPageBluetooth *self, gpointer unused, GError *error, gpointer us
 }
 
 CEPage *
-ce_page_bluetooth_new (NMConnection *connection,
+ce_page_bluetooth_new (NMConnectionEditor *editor,
+                       NMConnection *connection,
                        GtkWindow *parent_window,
                        NMClient *client,
                        const char **out_secrets_setting_name,
@@ -100,6 +101,7 @@ ce_page_bluetooth_new (NMConnection *connection,
        CEPageBluetoothPrivate *priv;
 
        self = CE_PAGE_BLUETOOTH (ce_page_new (CE_TYPE_PAGE_BLUETOOTH,
+                                 editor,
                                  connection,
                                  parent_window,
                                  client,
diff --git a/src/connection-editor/page-bluetooth.h b/src/connection-editor/page-bluetooth.h
index dd2207a..ae2df50 100644
--- a/src/connection-editor/page-bluetooth.h
+++ b/src/connection-editor/page-bluetooth.h
@@ -47,7 +47,8 @@ typedef struct {
 
 GType ce_page_bluetooth_get_type (void);
 
-CEPage *ce_page_bluetooth_new (NMConnection *connection,
+CEPage *ce_page_bluetooth_new (NMConnectionEditor *edit,
+                               NMConnection *connection,
                                GtkWindow *parent,
                                NMClient *client,
                                const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index 9d3b789..af608d0 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -426,16 +426,18 @@ finish_setup (CEPageBond *self, gpointer unused, GError *error, gpointer user_da
 }
 
 CEPage *
-ce_page_bond_new (NMConnection *connection,
-                                 GtkWindow *parent_window,
-                                 NMClient *client,
-                                 const char **out_secrets_setting_name,
-                                 GError **error)
+ce_page_bond_new (NMConnectionEditor *editor,
+                  NMConnection *connection,
+                  GtkWindow *parent_window,
+                  NMClient *client,
+                  const char **out_secrets_setting_name,
+                  GError **error)
 {
        CEPageBond *self;
        CEPageBondPrivate *priv;
 
        self = CE_PAGE_BOND (ce_page_new (CE_TYPE_PAGE_BOND,
+                                         editor,
                                          connection,
                                          parent_window,
                                          client,
diff --git a/src/connection-editor/page-bond.h b/src/connection-editor/page-bond.h
index 646abe1..5b75e09 100644
--- a/src/connection-editor/page-bond.h
+++ b/src/connection-editor/page-bond.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_bond_get_type (void);
 
-CEPage *ce_page_bond_new (NMConnection *connection,
+CEPage *ce_page_bond_new (NMConnectionEditor *editor,
+                          NMConnection *connection,
                           GtkWindow *parent,
                           NMClient *client,
                           const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-bridge-port.c b/src/connection-editor/page-bridge-port.c
index 52e6260..129f73d 100644
--- a/src/connection-editor/page-bridge-port.c
+++ b/src/connection-editor/page-bridge-port.c
@@ -88,7 +88,8 @@ finish_setup (CEPageBridgePort *self, gpointer unused, GError *error, gpointer u
 }
 
 CEPage *
-ce_page_bridge_port_new (NMConnection *connection,
+ce_page_bridge_port_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent_window,
                          NMClient *client,
                          const char **out_secrets_setting_name,
@@ -98,6 +99,7 @@ ce_page_bridge_port_new (NMConnection *connection,
        CEPageBridgePortPrivate *priv;
 
        self = CE_PAGE_BRIDGE_PORT (ce_page_new (CE_TYPE_PAGE_BRIDGE_PORT,
+                                                editor,
                                                 connection,
                                                 parent_window,
                                                 client,
diff --git a/src/connection-editor/page-bridge-port.h b/src/connection-editor/page-bridge-port.h
index a74f7f8..748d269 100644
--- a/src/connection-editor/page-bridge-port.h
+++ b/src/connection-editor/page-bridge-port.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_bridge_port_get_type (void);
 
-CEPage *ce_page_bridge_port_new (NMConnection *connection,
+CEPage *ce_page_bridge_port_new (NMConnectionEditor *editor,
+                                 NMConnection *connection,
                                  GtkWindow *parent,
                                  NMClient *client,
                                  const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-bridge.c b/src/connection-editor/page-bridge.c
index d3007a4..1ec84ea 100644
--- a/src/connection-editor/page-bridge.c
+++ b/src/connection-editor/page-bridge.c
@@ -192,7 +192,8 @@ finish_setup (CEPageBridge *self, gpointer unused, GError *error, gpointer user_
 }
 
 CEPage *
-ce_page_bridge_new (NMConnection *connection,
+ce_page_bridge_new (NMConnectionEditor *editor,
+                    NMConnection *connection,
                     GtkWindow *parent_window,
                     NMClient *client,
                     const char **out_secrets_setting_name,
@@ -202,6 +203,7 @@ ce_page_bridge_new (NMConnection *connection,
        CEPageBridgePrivate *priv;
 
        self = CE_PAGE_BRIDGE (ce_page_new (CE_TYPE_PAGE_BRIDGE,
+                                         editor,
                                          connection,
                                          parent_window,
                                          client,
diff --git a/src/connection-editor/page-bridge.h b/src/connection-editor/page-bridge.h
index 4b1873f..3581b06 100644
--- a/src/connection-editor/page-bridge.h
+++ b/src/connection-editor/page-bridge.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_bridge_get_type (void);
 
-CEPage *ce_page_bridge_new (NMConnection *connection,
+CEPage *ce_page_bridge_new (NMConnectionEditor *editor,
+                            NMConnection *connection,
                             GtkWindow *parent,
                             NMClient *client,
                             const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-dcb.c b/src/connection-editor/page-dcb.c
index b8405fe..632a287 100644
--- a/src/connection-editor/page-dcb.c
+++ b/src/connection-editor/page-dcb.c
@@ -584,7 +584,8 @@ finish_setup (CEPageDcb *self, gpointer unused, GError *error, gpointer user_dat
 }
 
 CEPage *
-ce_page_dcb_new (NMConnection *connection,
+ce_page_dcb_new (NMConnectionEditor *editor,
+                 NMConnection *connection,
                  GtkWindow *parent_window,
                  NMClient *client,
                  const char **out_secrets_setting_name,
@@ -596,6 +597,7 @@ ce_page_dcb_new (NMConnection *connection,
        NMSettingDcb *s_dcb;
 
        self = CE_PAGE_DCB (ce_page_new (CE_TYPE_PAGE_DCB,
+                                        editor,
                                         connection,
                                         parent_window,
                                         client,
diff --git a/src/connection-editor/page-dcb.h b/src/connection-editor/page-dcb.h
index ad34520..9019cc6 100644
--- a/src/connection-editor/page-dcb.h
+++ b/src/connection-editor/page-dcb.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_dcb_get_type (void);
 
-CEPage *ce_page_dcb_new (NMConnection *connection,
+CEPage *ce_page_dcb_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent,
                          NMClient *client,
                          const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-dsl.c b/src/connection-editor/page-dsl.c
index aeb9f55..7177a06 100644
--- a/src/connection-editor/page-dsl.c
+++ b/src/connection-editor/page-dsl.c
@@ -110,7 +110,8 @@ finish_setup (CEPageDsl *self, gpointer unused, GError *error, gpointer user_dat
 }
 
 CEPage *
-ce_page_dsl_new (NMConnection *connection,
+ce_page_dsl_new (NMConnectionEditor *editor,
+                 NMConnection *connection,
                  GtkWindow *parent_window,
                  NMClient *client,
                  const char **out_secrets_setting_name,
@@ -120,6 +121,7 @@ ce_page_dsl_new (NMConnection *connection,
        CEPageDslPrivate *priv;
 
        self = CE_PAGE_DSL (ce_page_new (CE_TYPE_PAGE_DSL,
+                                        editor,
                                         connection,
                                         parent_window,
                                         client,
diff --git a/src/connection-editor/page-dsl.h b/src/connection-editor/page-dsl.h
index e893c9a..b5c6f1b 100644
--- a/src/connection-editor/page-dsl.h
+++ b/src/connection-editor/page-dsl.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_dsl_get_type (void);
 
-CEPage *ce_page_dsl_new (NMConnection *connection,
+CEPage *ce_page_dsl_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent,
                          NMClient *client,
                          const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index 7a56d35..cc754b9 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -298,7 +298,8 @@ finish_setup (CEPageEthernet *self, gpointer unused, GError *error, gpointer use
 }
 
 CEPage *
-ce_page_ethernet_new (NMConnection *connection,
+ce_page_ethernet_new (NMConnectionEditor *editor,
+                      NMConnection *connection,
                       GtkWindow *parent_window,
                       NMClient *client,
                       const char **out_secrets_setting_name,
@@ -308,6 +309,7 @@ ce_page_ethernet_new (NMConnection *connection,
        CEPageEthernetPrivate *priv;
 
        self = CE_PAGE_ETHERNET (ce_page_new (CE_TYPE_PAGE_ETHERNET,
+                                             editor,
                                              connection,
                                              parent_window,
                                              client,
diff --git a/src/connection-editor/page-ethernet.h b/src/connection-editor/page-ethernet.h
index 0a06a57..68ff57d 100644
--- a/src/connection-editor/page-ethernet.h
+++ b/src/connection-editor/page-ethernet.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_ethernet_get_type (void);
 
-CEPage *ce_page_ethernet_new (NMConnection *connection,
+CEPage *ce_page_ethernet_new (NMConnectionEditor *editor,
+                              NMConnection *connection,
                               GtkWindow *parent,
                               NMClient *client,
                               const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-general.c b/src/connection-editor/page-general.c
index 1f71328..13e8aa2 100644
--- a/src/connection-editor/page-general.c
+++ b/src/connection-editor/page-general.c
@@ -331,7 +331,8 @@ finish_setup (CEPageGeneral *self, gpointer unused, GError *error, gpointer user
 }
 
 CEPage *
-ce_page_general_new (NMConnection *connection,
+ce_page_general_new (NMConnectionEditor *editor,
+                     NMConnection *connection,
                      GtkWindow *parent_window,
                      NMClient *client,
                      const char **out_secrets_setting_name,
@@ -341,6 +342,7 @@ ce_page_general_new (NMConnection *connection,
        CEPageGeneralPrivate *priv;
 
        self = CE_PAGE_GENERAL (ce_page_new (CE_TYPE_PAGE_GENERAL,
+                                            editor,
                                             connection,
                                             parent_window,
                                             client,
diff --git a/src/connection-editor/page-general.h b/src/connection-editor/page-general.h
index 23ee94d..1e2f3be 100644
--- a/src/connection-editor/page-general.h
+++ b/src/connection-editor/page-general.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_general_get_type (void);
 
-CEPage *ce_page_general_new (NMConnection *connection,
+CEPage *ce_page_general_new (NMConnectionEditor *editor,
+                             NMConnection *connection,
                              GtkWindow *parent,
                              NMClient *client,
                              const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index 09c9b8f..a0ce48a 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -133,7 +133,8 @@ finish_setup (CEPageInfiniband *self, gpointer unused, GError *error, gpointer u
 }
 
 CEPage *
-ce_page_infiniband_new (NMConnection *connection,
+ce_page_infiniband_new (NMConnectionEditor *editor,
+                        NMConnection *connection,
                         GtkWindow *parent_window,
                         NMClient *client,
                         const char **out_secrets_setting_name,
@@ -143,6 +144,7 @@ ce_page_infiniband_new (NMConnection *connection,
        CEPageInfinibandPrivate *priv;
 
        self = CE_PAGE_INFINIBAND (ce_page_new (CE_TYPE_PAGE_INFINIBAND,
+                                               editor,
                                                connection,
                                                parent_window,
                                                client,
diff --git a/src/connection-editor/page-infiniband.h b/src/connection-editor/page-infiniband.h
index ab45277..9feca14 100644
--- a/src/connection-editor/page-infiniband.h
+++ b/src/connection-editor/page-infiniband.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_infiniband_get_type (void);
 
-CEPage *ce_page_infiniband_new (NMConnection *connection,
+CEPage *ce_page_infiniband_new (NMConnectionEditor *editor,
+                                NMConnection *connection,
                                 GtkWindow *parent,
                                 NMClient *client,
                                 const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index 48d6041..e7c4fdd 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -1128,7 +1128,8 @@ finish_setup (CEPageIP4 *self, gpointer unused, GError *error, gpointer user_dat
 }
 
 CEPage *
-ce_page_ip4_new (NMConnection *connection,
+ce_page_ip4_new (NMConnectionEditor *editor,
+                 NMConnection *connection,
                  GtkWindow *parent_window,
                  NMClient *client,
                  const char **out_secrets_setting_name,
@@ -1139,6 +1140,7 @@ ce_page_ip4_new (NMConnection *connection,
        NMSettingConnection *s_con;
 
        self = CE_PAGE_IP4 (ce_page_new (CE_TYPE_PAGE_IP4,
+                                        editor,
                                         connection,
                                         parent_window,
                                         client,
diff --git a/src/connection-editor/page-ip4.h b/src/connection-editor/page-ip4.h
index e9886cf..6490393 100644
--- a/src/connection-editor/page-ip4.h
+++ b/src/connection-editor/page-ip4.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_ip4_get_type (void);
 
-CEPage *ce_page_ip4_new (NMConnection *connection,
+CEPage *ce_page_ip4_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent,
                          NMClient *client,
                          const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index 439858a..8a71d17 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -1136,7 +1136,8 @@ finish_setup (CEPageIP6 *self, gpointer unused, GError *error, gpointer user_dat
 }
 
 CEPage *
-ce_page_ip6_new (NMConnection *connection,
+ce_page_ip6_new (NMConnectionEditor *editor,
+                 NMConnection *connection,
                  GtkWindow *parent_window,
                  NMClient *client,
                  const char **out_secrets_setting_name,
@@ -1147,6 +1148,7 @@ ce_page_ip6_new (NMConnection *connection,
        NMSettingConnection *s_con;
 
        self = CE_PAGE_IP6 (ce_page_new (CE_TYPE_PAGE_IP6,
+                                        editor,
                                         connection,
                                         parent_window,
                                         client,
diff --git a/src/connection-editor/page-ip6.h b/src/connection-editor/page-ip6.h
index defc23c..4a671f4 100644
--- a/src/connection-editor/page-ip6.h
+++ b/src/connection-editor/page-ip6.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_ip6_get_type (void);
 
-CEPage *ce_page_ip6_new (NMConnection *connection,
+CEPage *ce_page_ip6_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent,
                          NMClient *client,
                          const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index 375b717..671ece1 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -291,7 +291,8 @@ finish_setup (CEPageMobile *self, gpointer unused, GError *error, gpointer user_
 }
 
 CEPage *
-ce_page_mobile_new (NMConnection *connection,
+ce_page_mobile_new (NMConnectionEditor *editor,
+                    NMConnection *connection,
                     GtkWindow *parent_window,
                     NMClient *client,
                     const char **out_secrets_setting_name,
@@ -301,6 +302,7 @@ ce_page_mobile_new (NMConnection *connection,
        CEPageMobilePrivate *priv;
 
        self = CE_PAGE_MOBILE (ce_page_new (CE_TYPE_PAGE_MOBILE,
+                                           editor,
                                            connection,
                                            parent_window,
                                            client,
diff --git a/src/connection-editor/page-mobile.h b/src/connection-editor/page-mobile.h
index 914e8cd..750c736 100644
--- a/src/connection-editor/page-mobile.h
+++ b/src/connection-editor/page-mobile.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_mobile_get_type (void);
 
-CEPage *ce_page_mobile_new (NMConnection *connection,
+CEPage *ce_page_mobile_new (NMConnectionEditor *editor,
+                            NMConnection *connection,
                             GtkWindow *parent,
                             NMClient *client,
                             const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-ppp.c b/src/connection-editor/page-ppp.c
index a6e28ee..1a0363a 100644
--- a/src/connection-editor/page-ppp.c
+++ b/src/connection-editor/page-ppp.c
@@ -262,7 +262,8 @@ finish_setup (CEPagePpp *self, gpointer unused, GError *error, gpointer user_dat
 }
 
 CEPage *
-ce_page_ppp_new (NMConnection *connection,
+ce_page_ppp_new (NMConnectionEditor *editor,
+                 NMConnection *connection,
                  GtkWindow *parent_window,
                  NMClient *client,
                  const char **out_secrets_setting_name,
@@ -273,6 +274,7 @@ ce_page_ppp_new (NMConnection *connection,
        NMSettingConnection *s_con;
 
        self = CE_PAGE_PPP (ce_page_new (CE_TYPE_PAGE_PPP,
+                                        editor,
                                         connection,
                                         parent_window,
                                         client,
diff --git a/src/connection-editor/page-ppp.h b/src/connection-editor/page-ppp.h
index b731535..c8e9246 100644
--- a/src/connection-editor/page-ppp.h
+++ b/src/connection-editor/page-ppp.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_ppp_get_type (void);
 
-CEPage *ce_page_ppp_new (NMConnection *connection,
+CEPage *ce_page_ppp_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent,
                          NMClient *client,
                          const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-team-port.c b/src/connection-editor/page-team-port.c
index ebf86e0..dbad57f 100644
--- a/src/connection-editor/page-team-port.c
+++ b/src/connection-editor/page-team-port.c
@@ -131,7 +131,8 @@ finish_setup (CEPageTeamPort *self, gpointer unused, GError *error, gpointer use
 }
 
 CEPage *
-ce_page_team_port_new (NMConnection *connection,
+ce_page_team_port_new (NMConnectionEditor *editor,
+                       NMConnection *connection,
                        GtkWindow *parent_window,
                        NMClient *client,
                        const char **out_secrets_setting_name,
@@ -141,6 +142,7 @@ ce_page_team_port_new (NMConnection *connection,
        CEPageTeamPortPrivate *priv;
 
        self = CE_PAGE_TEAM_PORT (ce_page_new (CE_TYPE_PAGE_TEAM_PORT,
+                                              editor,
                                               connection,
                                               parent_window,
                                               client,
diff --git a/src/connection-editor/page-team-port.h b/src/connection-editor/page-team-port.h
index e086de4..62d24cd 100644
--- a/src/connection-editor/page-team-port.h
+++ b/src/connection-editor/page-team-port.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_team_port_get_type (void);
 
-CEPage *ce_page_team_port_new (NMConnection *connection,
+CEPage *ce_page_team_port_new (NMConnectionEditor *editor,
+                               NMConnection *connection,
                                GtkWindow *parent,
                                NMClient *client,
                                const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-team.c b/src/connection-editor/page-team.c
index 1ac337f..2ddf4d1 100644
--- a/src/connection-editor/page-team.c
+++ b/src/connection-editor/page-team.c
@@ -249,16 +249,18 @@ finish_setup (CEPageTeam *self, gpointer unused, GError *error, gpointer user_da
 }
 
 CEPage *
-ce_page_team_new (NMConnection *connection,
-                                 GtkWindow *parent_window,
-                                 NMClient *client,
-                                 const char **out_secrets_setting_name,
-                                 GError **error)
+ce_page_team_new (NMConnectionEditor *editor,
+                  NMConnection *connection,
+                  GtkWindow *parent_window,
+                  NMClient *client,
+                  const char **out_secrets_setting_name,
+                  GError **error)
 {
        CEPageTeam *self;
        CEPageTeamPrivate *priv;
 
        self = CE_PAGE_TEAM (ce_page_new (CE_TYPE_PAGE_TEAM,
+                                         editor,
                                          connection,
                                          parent_window,
                                          client,
diff --git a/src/connection-editor/page-team.h b/src/connection-editor/page-team.h
index d3a5270..68f5ff2 100644
--- a/src/connection-editor/page-team.h
+++ b/src/connection-editor/page-team.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_team_get_type (void);
 
-CEPage *ce_page_team_new (NMConnection *connection,
+CEPage *ce_page_team_new (NMConnectionEditor *editor,
+                          NMConnection *connection,
                           GtkWindow *parent,
                           NMClient *client,
                           const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index 5df091c..ea2891c 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -571,7 +571,8 @@ finish_setup (CEPageVlan *self, gpointer unused, GError *error, gpointer user_da
 }
 
 CEPage *
-ce_page_vlan_new (NMConnection *connection,
+ce_page_vlan_new (NMConnectionEditor *editor,
+                  NMConnection *connection,
                   GtkWindow *parent_window,
                   NMClient *client,
                   const char **out_secrets_setting_name,
@@ -581,6 +582,7 @@ ce_page_vlan_new (NMConnection *connection,
        CEPageVlanPrivate *priv;
 
        self = CE_PAGE_VLAN (ce_page_new (CE_TYPE_PAGE_VLAN,
+                                         editor,
                                          connection,
                                          parent_window,
                                          client,
diff --git a/src/connection-editor/page-vlan.h b/src/connection-editor/page-vlan.h
index 5a96e02..f0f7238 100644
--- a/src/connection-editor/page-vlan.h
+++ b/src/connection-editor/page-vlan.h
@@ -43,7 +43,8 @@ typedef struct {
 
 GType ce_page_vlan_get_type (void);
 
-CEPage *ce_page_vlan_new (NMConnection *connection,
+CEPage *ce_page_vlan_new (NMConnectionEditor *editor,
+                          NMConnection *connection,
                           GtkWindow *parent,
                           NMClient *client,
                           const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-vpn.c b/src/connection-editor/page-vpn.c
index 376a40a..6e100f6 100644
--- a/src/connection-editor/page-vpn.c
+++ b/src/connection-editor/page-vpn.c
@@ -84,7 +84,8 @@ finish_setup (CEPageVpn *self, gpointer unused, GError *error, gpointer user_dat
 }
 
 CEPage *
-ce_page_vpn_new (NMConnection *connection,
+ce_page_vpn_new (NMConnectionEditor *editor,
+                 NMConnection *connection,
                  GtkWindow *parent_window,
                  NMClient *client,
                  const char **out_secrets_setting_name,
@@ -95,6 +96,7 @@ ce_page_vpn_new (NMConnection *connection,
        const char *service_type;
 
        self = CE_PAGE_VPN (ce_page_new (CE_TYPE_PAGE_VPN,
+                                        editor,
                                         connection,
                                         parent_window,
                                         client,
diff --git a/src/connection-editor/page-vpn.h b/src/connection-editor/page-vpn.h
index d9df6a1..62a4d9d 100644
--- a/src/connection-editor/page-vpn.h
+++ b/src/connection-editor/page-vpn.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_vpn_get_type (void);
 
-CEPage *ce_page_vpn_new (NMConnection *connection,
+CEPage *ce_page_vpn_new (NMConnectionEditor *editor,
+                         NMConnection *connection,
                          GtkWindow *parent,
                          NMClient *client,
                          const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index 671011c..b6fade0 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -399,7 +399,8 @@ finish_setup (CEPageWifiSecurity *self, gpointer unused, GError *error, gpointer
 }
 
 CEPage *
-ce_page_wifi_security_new (NMConnection *connection,
+ce_page_wifi_security_new (NMConnectionEditor *editor,
+                           NMConnection *connection,
                            GtkWindow *parent_window,
                            NMClient *client,
                            const char **out_secrets_setting_name,
@@ -417,6 +418,7 @@ ce_page_wifi_security_new (NMConnection *connection,
        }
 
        self = CE_PAGE_WIFI_SECURITY (ce_page_new (CE_TYPE_PAGE_WIFI_SECURITY,
+                                                  editor,
                                                   connection,
                                                   parent_window,
                                                   client,
diff --git a/src/connection-editor/page-wifi-security.h b/src/connection-editor/page-wifi-security.h
index a4b2d48..1565cc1 100644
--- a/src/connection-editor/page-wifi-security.h
+++ b/src/connection-editor/page-wifi-security.h
@@ -46,7 +46,8 @@ typedef struct {
 
 GType ce_page_wifi_security_get_type (void);
 
-CEPage *ce_page_wifi_security_new (NMConnection *connection,
+CEPage *ce_page_wifi_security_new (NMConnectionEditor *editor,
+                                   NMConnection *connection,
                                    GtkWindow *parent,
                                    NMClient *client,
                                    const char **out_secrets_setting_name,
diff --git a/src/connection-editor/page-wifi.c b/src/connection-editor/page-wifi.c
index 1724ec3..d9dcb69 100644
--- a/src/connection-editor/page-wifi.c
+++ b/src/connection-editor/page-wifi.c
@@ -28,6 +28,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
+#include "nm-connection-editor.h"
 #include "page-wifi.h"
 
 G_DEFINE_TYPE (CEPageWifi, ce_page_wifi, CE_TYPE_PAGE)
@@ -422,7 +423,8 @@ finish_setup (CEPageWifi *self, gpointer unused, GError *error, gpointer user_da
 }
 
 CEPage *
-ce_page_wifi_new (NMConnection *connection,
+ce_page_wifi_new (NMConnectionEditor *editor,
+                  NMConnection *connection,
                   GtkWindow *parent_window,
                   NMClient *client,
                   const char **out_secrets_setting_name,
@@ -434,6 +436,7 @@ ce_page_wifi_new (NMConnection *connection,
        g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
 
        self = CE_PAGE_WIFI (ce_page_new (CE_TYPE_PAGE_WIFI,
+                                         editor,
                                          connection,
                                          parent_window,
                                          client,
diff --git a/src/connection-editor/page-wifi.h b/src/connection-editor/page-wifi.h
index c12c029..d1f0d63 100644
--- a/src/connection-editor/page-wifi.h
+++ b/src/connection-editor/page-wifi.h
@@ -45,7 +45,8 @@ typedef struct {
 
 GType ce_page_wifi_get_type (void);
 
-CEPage *ce_page_wifi_new (NMConnection *connection,
+CEPage *ce_page_wifi_new (NMConnectionEditor *editor,
+                          NMConnection *connection,
                           GtkWindow *parent,
                           NMClient *client,
                           const char **out_secrets_setting_name,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]