[network-manager-applet] connection-editor: add an (undocumented) --keep-above flag



commit e9bb2c0ef99dd042ead578ed1561508d006022b4
Author: Dan Winship <danw redhat com>
Date:   Fri Jan 9 14:10:18 2015 -0500

    connection-editor: add an (undocumented) --keep-above flag
    
    Add --keep-above, to tell nm-c-e to mark all of its windows "keep
    above". (For use by anaconda, to keep them from getting lost under its
    fullscreen window.)

 src/connection-editor/main.c                 |    5 +++++
 src/connection-editor/nm-connection-editor.c |    5 +++++
 src/connection-editor/nm-connection-list.c   |    5 ++++-
 3 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/connection-editor/main.c b/src/connection-editor/main.c
index cb5d4b5..d552201 100644
--- a/src/connection-editor/main.c
+++ b/src/connection-editor/main.c
@@ -42,6 +42,8 @@
 #include "nm-connection-list.h"
 #include "nm-connection-editor.h"
 
+gboolean nm_ce_keep_above;
+
 static GMainLoop *loop = NULL;
 
 #define ARG_TYPE      "type"
@@ -357,6 +359,9 @@ main (int argc, char *argv[])
                { ARG_CREATE, 'c', 0, G_OPTION_ARG_NONE,   &create, "Create a new connection", NULL },
                { ARG_SHOW,   's', 0, G_OPTION_ARG_NONE,   &show,   "Show a given connection type page", NULL 
},
                { "edit",     'e', 0, G_OPTION_ARG_STRING, &uuid,   "Edit an existing connection with a given 
UUID", "UUID" },
+
+               /* This is not passed over D-Bus. */
+               { "keep-above", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &nm_ce_keep_above, NULL, NULL },
                { NULL }
        };
 
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 7821525..df463e2 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -83,6 +83,8 @@
 #include "vpn-helpers.h"
 #include "eap-method.h"
 
+extern gboolean nm_ce_keep_above;
+
 G_DEFINE_TYPE (NMConnectionEditor, nm_connection_editor, G_TYPE_OBJECT)
 
 enum {
@@ -293,6 +295,9 @@ nm_connection_editor_init (NMConnectionEditor *editor)
        }
 
        editor->window = GTK_WIDGET (gtk_builder_get_object (editor->builder, "nm-connection-editor"));
+       if (nm_ce_keep_above)
+               gtk_window_set_keep_above (GTK_WINDOW (editor->window), TRUE);
+
        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"));
 }
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index c8c3a15..2f109fc 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -54,6 +54,8 @@
 #include "ce-polkit-button.h"
 #include "connection-helpers.h"
 
+extern gboolean nm_ce_keep_above;
+
 G_DEFINE_TYPE (NMConnectionList, nm_connection_list, G_TYPE_OBJECT)
 
 enum {
@@ -903,10 +905,11 @@ nm_connection_list_new (void)
        initialize_treeview (list);
        add_connection_buttons (list);
 
-       /* Connect to the main dialog's response handler */
        list->dialog = GTK_WIDGET (gtk_builder_get_object (list->gui, "NMConnectionList"));
        if (!list->dialog)
                goto error;
+       if (nm_ce_keep_above)
+               gtk_window_set_keep_above (GTK_WINDOW (list->dialog), TRUE);
        g_signal_connect (G_OBJECT (list->dialog), "response", G_CALLBACK (dialog_response_cb), list);
 
        if (!vpn_get_plugins (&error)) {


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