[evolution/gnome-3-10] Bug #721213 - Character encoding combo opened empty



commit 97fc8e626506781240acce37d253b529430fe87d
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 27 19:16:58 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 5d114d2..dd84e5f 100644
--- a/e-util/e-action-combo-box.c
+++ b/e-util/e-action-combo-box.c
@@ -363,6 +363,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 1423a59..0c11a45 100644
--- a/e-util/e-charset-combo-box.c
+++ b/e-util/e-charset-combo-box.c
@@ -221,6 +221,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;
@@ -283,6 +309,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;
 
@@ -344,17 +371,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]