From 7618df792ff3f2add6c6d04f156f61d778262636 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 12 Apr 2013 21:58:14 -0400 Subject: [PATCH] network: Allow setting title on connection editor We want the title to match whats in the device list, which sometimes does not match the connection id exactly. This API lets us do so. https://bugzilla.gnome.org/show_bug.cgi?id=693780 --- .../network/connection-editor/net-connection-editor.c | 11 +++++++++++ .../network/connection-editor/net-connection-editor.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c index e145fe036..cf6faee8f 100644 --- a/panels/network/connection-editor/net-connection-editor.c +++ b/panels/network/connection-editor/net-connection-editor.c @@ -278,6 +278,9 @@ net_connection_editor_update_title (NetConnectionEditor *editor) { gchar *id; + if (editor->title_set) + return; + if (editor->is_new_connection) { if (editor->device) { id = g_strdup (_("New Profile")); @@ -961,3 +964,11 @@ net_connection_editor_reset (NetConnectionEditor *editor) nm_connection_replace_settings (editor->connection, settings, NULL); g_hash_table_destroy (settings); } + +void +net_connection_editor_set_title (NetConnectionEditor *editor, + const gchar *title) +{ + gtk_window_set_title (GTK_WINDOW (editor->window), title); + editor->title_set = TRUE; +} diff --git a/panels/network/connection-editor/net-connection-editor.h b/panels/network/connection-editor/net-connection-editor.h index ef883d49d..6d08925f1 100644 --- a/panels/network/connection-editor/net-connection-editor.h +++ b/panels/network/connection-editor/net-connection-editor.h @@ -64,6 +64,8 @@ struct _NetConnectionEditor guint permission_id; NMClientPermissionResult can_modify; + + gboolean title_set; }; struct _NetConnectionEditorClass @@ -80,6 +82,8 @@ NetConnectionEditor *net_connection_editor_new (GtkWindow *parent_wi NMAccessPoint *ap, NMClient *client, NMRemoteSettings *settings); +void net_connection_editor_set_title (NetConnectionEditor *editor, + const gchar *title); void net_connection_editor_run (NetConnectionEditor *editor); void net_connection_editor_present (NetConnectionEditor *editor); void net_connection_editor_forget (NetConnectionEditor *editor);