summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-06-06 22:26:09 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-06-19 19:58:03 +0200
commit7eb484ecc9c0bbab2ca0033a60fc1fb97ac735c0 (patch)
tree9ea6af2ba3e27c1e48b405fd4fa1d91295f69281
parentb73e046a0758ce9f4f251f36a4c27afecaf46bc3 (diff)
downloadnetwork-manager-applet-7eb484ecc9c0bbab2ca0033a60fc1fb97ac735c0.tar.gz
editor/connection-editor: propagate the new-editor signal
-rw-r--r--src/connection-editor/nm-connection-editor.c17
-rw-r--r--src/connection-editor/nm-connection-editor.h3
2 files changed, 19 insertions, 1 deletions
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index f668d01f..b0c9ab6f 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -72,6 +72,7 @@ G_DEFINE_TYPE (NMConnectionEditor, nm_connection_editor, G_TYPE_OBJECT)
enum {
EDITOR_DONE,
+ NEW_EDITOR,
EDITOR_LAST_SIGNAL
};
@@ -543,6 +544,13 @@ nm_connection_editor_class_init (NMConnectionEditorClass *klass)
G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 1, GTK_TYPE_RESPONSE_TYPE);
+
+ editor_signals[NEW_EDITOR] =
+ g_signal_new (NM_CONNECTION_EDITOR_NEW_EDITOR,
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 1, G_TYPE_POINTER);
}
NMConnectionEditor *
@@ -788,6 +796,14 @@ page_initialized (CEPage *page, GError *error, gpointer user_data)
recheck_initialization (editor);
}
+static void
+page_new_editor (CEPage *page, NMConnectionEditor *new_editor, gpointer user_data)
+{
+ NMConnectionEditor *self = NM_CONNECTION_EDITOR (user_data);
+
+ g_signal_emit (self, editor_signals[NEW_EDITOR], 0, new_editor);
+}
+
static void request_secrets (GetSecretsInfo *info);
static void
@@ -898,6 +914,7 @@ add_page (NMConnectionEditor *editor,
editor->initializing_pages = g_slist_append (editor->initializing_pages, page);
g_signal_connect (page, CE_PAGE_CHANGED, G_CALLBACK (page_changed), editor);
g_signal_connect (page, CE_PAGE_INITIALIZED, G_CALLBACK (page_initialized), editor);
+ g_signal_connect (page, CE_PAGE_NEW_EDITOR, G_CALLBACK (page_new_editor), editor);
}
return !!page;
}
diff --git a/src/connection-editor/nm-connection-editor.h b/src/connection-editor/nm-connection-editor.h
index fc55e2e7..31ed635c 100644
--- a/src/connection-editor/nm-connection-editor.h
+++ b/src/connection-editor/nm-connection-editor.h
@@ -32,7 +32,8 @@
#define NM_IS_CONNECTION_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION_EDITOR))
#define NM_CONNECTION_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTION_EDITOR, NMConnectionEditor))
-#define NM_CONNECTION_EDITOR_DONE "done"
+#define NM_CONNECTION_EDITOR_DONE "done"
+#define NM_CONNECTION_EDITOR_NEW_EDITOR "new-editor"
typedef struct GetSecretsInfo GetSecretsInfo;