[empathy] Port empathy-presence-chooser to GtkComboBox
- From: Danielle Madeley <daniellem src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Port empathy-presence-chooser to GtkComboBox
- Date: Mon, 18 Oct 2010 07:49:10 +0000 (UTC)
commit 18c25feae5e0094113b7e7327b3f0de308f1f369
Author: Danielle Madeley <danielle madeley collabora co uk>
Date: Mon Oct 18 10:34:37 2010 +1100
Port empathy-presence-chooser to GtkComboBox
libempathy-gtk/empathy-presence-chooser.c | 24 ++++++++++++++++++------
libempathy-gtk/empathy-presence-chooser.h | 6 +++---
2 files changed, 21 insertions(+), 9 deletions(-)
---
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 8258688..1dbc38a 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -21,7 +21,7 @@
* Authors: Richard Hult <richard imendio com>
* Martyn Russell <martyn imendio com>
* Xavier Claessens <xclaesse gmail com>
- * Davyd Madeley <davyd madeley collabora co uk>
+ * Danielle Madeley <danielle madeley collabora co uk>
*/
#include "config.h"
@@ -126,6 +126,7 @@ static struct { TpConnectionPresenceType state;
{ TP_CONNECTION_PRESENCE_TYPE_UNSET, },
};
+static void presence_chooser_constructed (GObject *object);
static void presence_chooser_finalize (GObject *object);
static void presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser);
static void presence_chooser_menu_add_item (GtkWidget *menu,
@@ -138,13 +139,14 @@ static void presence_chooser_set_state (TpConnectionPres
static void presence_chooser_custom_activate_cb (GtkWidget *item,
gpointer user_data);
-G_DEFINE_TYPE (EmpathyPresenceChooser, empathy_presence_chooser, GTK_TYPE_COMBO_BOX_ENTRY);
+G_DEFINE_TYPE (EmpathyPresenceChooser, empathy_presence_chooser, GTK_TYPE_COMBO_BOX);
static void
empathy_presence_chooser_class_init (EmpathyPresenceChooserClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ object_class->constructed = presence_chooser_constructed;
object_class->finalize = presence_chooser_finalize;
g_type_class_add_private (object_class, sizeof (EmpathyPresenceChooserPriv));
@@ -848,13 +850,20 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
{
EmpathyPresenceChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
EMPATHY_TYPE_PRESENCE_CHOOSER, EmpathyPresenceChooserPriv);
- GtkWidget *entry;
- GtkCellRenderer *renderer;
chooser->priv = priv;
/* Create the not-favorite icon */
priv->not_favorite_pixbuf = create_not_favorite_pixbuf ();
+}
+
+static void
+presence_chooser_constructed (GObject *object)
+{
+ EmpathyPresenceChooser *chooser = EMPATHY_PRESENCE_CHOOSER (object);
+ EmpathyPresenceChooserPriv *priv = chooser->priv;
+ GtkWidget *entry;
+ GtkCellRenderer *renderer;
tp_g_signal_connect_object (gtk_icon_theme_get_default (), "changed",
G_CALLBACK (icon_theme_changed_cb),
@@ -862,7 +871,7 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
presence_chooser_create_model (chooser);
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (chooser),
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (chooser),
COL_STATUS_TEXT);
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (chooser),
combo_row_separator_func,
@@ -983,7 +992,10 @@ presence_chooser_finalize (GObject *object)
GtkWidget *
empathy_presence_chooser_new (void)
{
- return g_object_new (EMPATHY_TYPE_PRESENCE_CHOOSER, NULL);
+ /* FIXME, why can't this go in init()? */
+ return g_object_new (EMPATHY_TYPE_PRESENCE_CHOOSER,
+ "has-entry", TRUE,
+ NULL);
}
static void
diff --git a/libempathy-gtk/empathy-presence-chooser.h b/libempathy-gtk/empathy-presence-chooser.h
index 7b85a62..d4595ab 100644
--- a/libempathy-gtk/empathy-presence-chooser.h
+++ b/libempathy-gtk/empathy-presence-chooser.h
@@ -21,7 +21,7 @@
* Authors: Richard Hult <richard imendio com>
* Martyn Russell <martyn imendio com>
* Xavier Claessens <xclaesse gmail com>
- * Davyd Madeley <davyd madeley collabora co uk>
+ * Danielle Madeley <danielle madeley collabora co uk>
*/
#ifndef __EMPATHY_PRESENCE_CHOOSER_H__
@@ -42,14 +42,14 @@ typedef struct _EmpathyPresenceChooser EmpathyPresenceChooser;
typedef struct _EmpathyPresenceChooserClass EmpathyPresenceChooserClass;
struct _EmpathyPresenceChooser {
- GtkComboBoxEntry parent;
+ GtkComboBox parent;
/*<private>*/
gpointer priv;
};
struct _EmpathyPresenceChooserClass {
- GtkComboBoxEntryClass parent_class;
+ GtkComboBoxClass parent_class;
};
GType empathy_presence_chooser_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]