[gnome-terminal] server: Make prefs dialogue an app window



commit eb1c2aa26978a3e52d2b6086bfa450c49941bbcb
Author: Christian Persch <chpe gnome org>
Date:   Tue Aug 16 19:17:55 2016 +0200

    server: Make prefs dialogue an app window
    
    This means it'll keep the server alive while it's open.

 src/preferences.ui         |    3 ++-
 src/profile-editor.c       |    2 ++
 src/profile-preferences.ui |    3 ++-
 src/terminal-app.c         |    7 +------
 src/terminal-prefs.c       |    2 ++
 5 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/preferences.ui b/src/preferences.ui
index 2bb3c9b..6acab38 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -42,8 +42,9 @@
       </row>
     </data>
   </object>
-  <object class="GtkWindow" id="preferences-dialog">
+  <object class="GtkApplicationWindow" id="preferences-dialog">
     <property name="can_focus">False</property>
+    <property name="show_menubar">False</property>
     <property name="border_width">0</property>
     <property name="title" translatable="yes">Preferences</property>
     <property name="role">gnome-terminal-preferences</property>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 82cc7a9..002561d 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -843,6 +843,8 @@ terminal_profile_edit (GSettings  *profile,
   g_object_set_data_full (G_OBJECT (editor), "builder",
                           builder, (GDestroyNotify) g_object_unref);
 
+  gtk_window_set_application (GTK_WINDOW (editor), GTK_APPLICATION (terminal_app_get ()));
+
   /* Store the dialogue on the profile, so we can acccess it above to check if
    * there's already a profile editor for this profile.
    */
diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui
index 9c00946..5adcb53 100644
--- a/src/profile-preferences.ui
+++ b/src/profile-preferences.ui
@@ -144,8 +144,9 @@
       </row>
     </data>
   </object>
-  <object class="GtkWindow" id="profile-editor-dialog">
+  <object class="GtkApplicationWindow" id="profile-editor-dialog">
     <property name="can_focus">False</property>
+    <property name="show_menubar">False</property>
     <property name="title" translatable="yes">Profile Editor</property>
     <property name="role">gnome-terminal-profile-editor</property>
     <property name="resizable">False</property>
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 2d9129c..95a06e2 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -334,13 +334,8 @@ app_menu_preferences_cb (GSimpleAction *action,
                          gpointer       user_data)
 {
   TerminalApp *app = user_data;
-  GtkWindow *window;
-
-  window = gtk_application_get_active_window (GTK_APPLICATION (app));
-  if (!TERMINAL_IS_WINDOW (window))
-    return;
 
-  terminal_app_edit_preferences (app, window);
+  terminal_app_edit_preferences (app, NULL);
 }
 
 static void
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index e03b964..cd7b0d9 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -603,6 +603,8 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
 
   data->dialog = dialog;
 
+  gtk_window_set_application (GTK_WINDOW (data->dialog), GTK_APPLICATION (terminal_app_get ()));
+
   terminal_util_bind_mnemonic_label_sensitivity (dialog);
 
   settings = terminal_app_get_global_settings (app);


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