[krb5-auth-dialog] Pass on use-header-bar property to GtkDialog



commit 6265b3c9bfb81c2b4f1a8fca8c0d4900cae88779
Author: Guido Günther <agx sigxcpu org>
Date:   Thu Oct 23 22:56:28 2014 +0200

    Pass on use-header-bar property to GtkDialog

 src/ka-pwdialog.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/ka-pwdialog.c b/src/ka-pwdialog.c
index a54ce07..5242eca 100644
--- a/src/ka-pwdialog.c
+++ b/src/ka-pwdialog.c
@@ -72,6 +72,39 @@ ka_pwdialog_finalize (GObject *object)
     parent_class->finalize (object);
 }
 
+
+static GObject *
+ka_pwdialog_constructor (GType type,
+                         guint n_construct_properties,
+                         GObjectConstructParam *construct_params)
+{
+    GObject *object;
+    guint idx;
+    GParamSpec *pspec;
+    GValue *value;
+
+    for (idx = 0; idx < n_construct_properties; idx++)
+    {
+        pspec = construct_params[idx].pspec;
+        if (g_strcmp0 (pspec->name, "use-header-bar") != 0)
+            continue;
+
+        /* GtkDialog uses "-1" to imply an unset value for this property */
+        value = construct_params[idx].value;
+        if (g_value_get_int (value) == -1)
+            g_value_set_int (value, 1);
+
+        break;
+    }
+
+    object = G_OBJECT_CLASS (ka_pwdialog_parent_class)->constructor (type,
+                                                                     n_construct_properties,
+                                                                     construct_params);
+
+    return object;
+}
+
+
 static void
 ka_pwdialog_class_init (KaPwDialogClass * klass)
 {
@@ -79,6 +112,7 @@ ka_pwdialog_class_init (KaPwDialogClass * klass)
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
     object_class->finalize = ka_pwdialog_finalize;
+    object_class->constructor = ka_pwdialog_constructor;
 
     /* Bind class to template
      */


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