[gnome-control-center/gnome-3-8] network: Allow setting title on connection editor



commit d1166ad1db0f017c785d1a064bd109ddf07d7299
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 12 21:58:14 2013 -0400

    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

 panels/network/connection-editor/net-connection-editor.c | 11 +++++++++++
 panels/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 e145fe0..cf6faee 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 ef883d4..6d08925 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);


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