summaryrefslogtreecommitdiff
path: root/gtk/gtkmountoperation.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-01-15 06:23:38 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-01-17 17:52:08 -0500
commitdc749c5a27663bb2618090b055d30a0630afa175 (patch)
tree83fe70f45e950d3827231129e3b0a6f0ba14d0e3 /gtk/gtkmountoperation.c
parent066810ac0039436c26a2dc93f18a2ccc9fdb3c0c (diff)
downloadgtk+-dc749c5a27663bb2618090b055d30a0630afa175.tar.gz
mount operation: Use headerbar
Make GtkMountOperation use a headerbar for its dialog when desired.
Diffstat (limited to 'gtk/gtkmountoperation.c')
-rw-r--r--gtk/gtkmountoperation.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 850ac821e1..6016a1b68c 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -48,6 +48,7 @@
#include "gtkicontheme.h"
#include "gtkmenuitem.h"
#include "gtkmain.h"
+#include "gtksettings.h"
#include <glib/gprintf.h>
@@ -503,10 +504,16 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
gchar *primary;
const gchar *secondary;
PangoAttrList *attrs;
+ gboolean use_header;
priv = operation->priv;
- widget = gtk_dialog_new ();
+ g_object_get (gtk_settings_get_default (),
+ "gtk-dialogs-use-header", &use_header,
+ NULL);
+ widget = g_object_new (GTK_TYPE_DIALOG,
+ "use-header-bar", use_header,
+ NULL);
dialog = GTK_DIALOG (widget);
window = GTK_WINDOW (widget);
@@ -532,6 +539,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
_("Co_nnect"), GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_dialog_set_alternative_button_order (dialog,
GTK_RESPONSE_OK,
@@ -1395,6 +1403,7 @@ create_show_processes_dialog (GtkMountOperation *op,
GtkCellRenderer *renderer;
GtkListStore *list_store;
gchar *s;
+ gboolean use_header;
priv = op->priv;
@@ -1405,7 +1414,12 @@ create_show_processes_dialog (GtkMountOperation *op,
primary = g_strndup (message, primary - message);
}
- dialog = gtk_dialog_new ();
+ g_object_get (gtk_settings_get_default (),
+ "gtk-dialogs-use-header", &use_header,
+ NULL);
+ dialog = g_object_new (GTK_TYPE_DIALOG,
+ "use-header-bar", use_header,
+ NULL);
if (priv->parent_window != NULL)
gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);