[evolution] Bug #721213 - Character encoding combo opened empty



commit fd692d0b1d16f6e083add4dd8fe8a3019948e4a2
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 27 19:15:21 2014 +0100

    Bug #721213 - Character encoding combo opened empty

 e-util/e-action-combo-box.c  |    3 +++
 e-util/e-charset-combo-box.c |   38 +++++++++++++++++++++++++++-----------
 2 files changed, 30 insertions(+), 11 deletions(-)
---
diff --git a/e-util/e-action-combo-box.c b/e-util/e-action-combo-box.c
index e0a9357..14731a7 100644
--- a/e-util/e-action-combo-box.c
+++ b/e-util/e-action-combo-box.c
@@ -361,6 +361,9 @@ action_combo_box_constructed (GObject *object)
 
        combo_box = GTK_COMBO_BOX (object);
 
+       /* Chain up to parent's constructed() method. */
+       G_OBJECT_CLASS (e_action_combo_box_parent_class)->constructed (object);
+
        /* This needs to happen after constructor properties are set
         * so that GtkCellLayout.get_area() returns something valid. */
 
diff --git a/e-util/e-charset-combo-box.c b/e-util/e-charset-combo-box.c
index f2d6355..c97cbe5 100644
--- a/e-util/e-charset-combo-box.c
+++ b/e-util/e-charset-combo-box.c
@@ -220,6 +220,32 @@ charset_combo_box_get_property (GObject *object,
 }
 
 static void
+charset_combo_box_constructed (GObject *object)
+{
+       ECharsetComboBoxPrivate *priv;
+       GtkRadioAction *radio_action;
+       GSList *group;
+
+       priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (object);
+
+       /* Chain up to parent's constructed() method. */
+       G_OBJECT_CLASS (e_charset_combo_box_parent_class)->constructed (object);
+
+       radio_action = priv->other_action;
+       group = gtk_radio_action_get_group (radio_action);
+
+       e_action_combo_box_set_action (
+               E_ACTION_COMBO_BOX (object), radio_action);
+
+       e_action_combo_box_add_separator_after (
+               E_ACTION_COMBO_BOX (object), g_slist_length (group));
+
+       g_signal_connect (
+               object, "notify::charset",
+               G_CALLBACK (charset_combo_box_notify_charset_cb), NULL);
+}
+
+static void
 charset_combo_box_dispose (GObject *object)
 {
        ECharsetComboBoxPrivate *priv;
@@ -282,6 +308,7 @@ e_charset_combo_box_class_init (ECharsetComboBoxClass *class)
        object_class = G_OBJECT_CLASS (class);
        object_class->set_property = charset_combo_box_set_property;
        object_class->get_property = charset_combo_box_get_property;
+       object_class->constructed = charset_combo_box_constructed;
        object_class->dispose = charset_combo_box_dispose;
        object_class->finalize = charset_combo_box_finalize;
 
@@ -343,17 +370,6 @@ e_charset_combo_box_init (ECharsetComboBox *combo_box)
        g_object_set_data (G_OBJECT (radio_action), "charset", (gpointer) "");
 
        gtk_radio_action_set_group (radio_action, group);
-       group = gtk_radio_action_get_group (radio_action);
-
-       e_action_combo_box_set_action (
-               E_ACTION_COMBO_BOX (combo_box), radio_action);
-
-       e_action_combo_box_add_separator_after (
-               E_ACTION_COMBO_BOX (combo_box), g_slist_length (group));
-
-       g_signal_connect (
-               combo_box, "notify::charset",
-               G_CALLBACK (charset_combo_box_notify_charset_cb), NULL);
 
        combo_box->priv->other_action = radio_action;
 }


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