From b93db55ba9359209550ec81ab29cbf5bdabafd2b Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 16 Apr 2009 12:28:11 +0000 Subject: [PATCH] Port EmpathyContactWidget to new API From: Xavier Claessens svn path=/trunk/; revision=2847 --- libempathy-gtk/empathy-contact-dialogs.c | 4 + libempathy-gtk/empathy-contact-list-view.c | 1 + libempathy-gtk/empathy-contact-widget.c | 18 +- libempathy-gtk/empathy-contact-widget.ui | 873 +++++++++++---------- 4 files changed, 463 insertions(+), 433 deletions(-) diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index d287b4d7..72b5b28b 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -121,6 +121,8 @@ empathy_subscription_dialog_show (EmpathyContact *contact, contact_widget, TRUE, TRUE, 0); + gtk_widget_show (contact_widget); + g_object_set_data (G_OBJECT (dialog), "contact_widget", contact_widget); subscription_dialogs = g_list_prepend (subscription_dialogs, dialog); @@ -216,6 +218,7 @@ empathy_contact_information_dialog_show (EmpathyContact *contact, empathy_account_chooser_filter_is_connected, NULL); } + gtk_widget_show (contact_widget); g_object_set_data (G_OBJECT (dialog), "contact_widget", contact_widget); information_dialogs = g_list_prepend (information_dialogs, dialog); @@ -317,6 +320,7 @@ empathy_new_contact_dialog_show (GtkWindow *parent) empathy_contact_widget_set_account_filter (contact_widget, can_add_contact_to_account, NULL); + gtk_widget_show (contact_widget); new_contact_dialog = dialog; diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 8b4f2066..3fdc7b32 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -172,6 +172,7 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view, g_signal_connect (priv->tooltip_widget, "destroy", G_CALLBACK (contact_list_view_tooltip_destroy_cb), view); + gtk_widget_show (priv->tooltip_widget); } else { empathy_contact_widget_set_contact (priv->tooltip_widget, contact); diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index f8ff3673..6d302171 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -160,18 +159,16 @@ empathy_contact_widget_new (EmpathyContact *contact, EmpathyContactWidgetFlags flags) { EmpathyContactWidget *information; - GladeXML *glade; + GtkBuilder *gui; gchar *filename; information = g_slice_new0 (EmpathyContactWidget); information->flags = flags; information->factory = empathy_contact_factory_dup_singleton (); - filename = empathy_file_lookup ("empathy-contact-widget.glade", + filename = empathy_file_lookup ("empathy-contact-widget.ui", "libempathy-gtk"); - glade = empathy_glade_get_file (filename, - "vbox_contact_widget", - NULL, + gui = empathy_builder_get_file (filename, "vbox_contact_widget", &information->vbox_contact_widget, "vbox_contact", &information->vbox_contact, "hbox_presence", &information->hbox_presence, @@ -193,16 +190,13 @@ empathy_contact_widget_new (EmpathyContact *contact, NULL); g_free (filename); - empathy_glade_connect (glade, - information, + empathy_builder_connect (gui, information, "vbox_contact_widget", "destroy", contact_widget_destroy_cb, "entry_group", "changed", contact_widget_entry_group_changed_cb, "entry_group", "activate", contact_widget_entry_group_activate_cb, "button_group", "clicked", contact_widget_button_group_clicked_cb, NULL); - g_object_unref (glade); - g_object_set_data (G_OBJECT (information->vbox_contact_widget), "EmpathyContactWidget", information); @@ -215,7 +209,9 @@ empathy_contact_widget_new (EmpathyContact *contact, contact_widget_set_contact (information, contact); - gtk_widget_show (information->vbox_contact_widget); + g_object_ref (information->vbox_contact_widget); + g_object_force_floating (G_OBJECT (information->vbox_contact_widget)); + g_object_unref (gui); return information->vbox_contact_widget; } diff --git a/libempathy-gtk/empathy-contact-widget.ui b/libempathy-gtk/empathy-contact-widget.ui index 8d626628..1f53f765 100644 --- a/libempathy-gtk/empathy-contact-widget.ui +++ b/libempathy-gtk/empathy-contact-widget.ui @@ -1,216 +1,228 @@ - - - True - Contact information + + + + vertical + 6 - + + True + vertical 6 - + True - 6 - - - True - 0 - <b>Contact</b> - True - - - False - False - - + 0 + <b>Contact</b> + True + + + False + False + 0 + + + + + True + 12 - + True - 12 + 6 - + True + vertical 6 - + True - 6 + 3 + 2 + 6 + 6 - + True - 3 - 2 - 6 - 6 - - - - - - - - - - - - True - 0 - Account: - - - GTK_FILL - - - - - - True - 0 - Identifier: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Alias: - - - 2 - 3 - GTK_FILL - - - + 0 + Account: + + GTK_FILL + + - + True - 6 - - - True - gtk-missing-image - - - False - False - - - - - True - True - 0 - True - True - True - - - 1 - - + 0 + Identifier: - 1 + 1 + 2 + GTK_FILL + + + + True + 0 + Alias: + + + 2 + 3 + GTK_FILL + + + + + + + + + + + + + + 0 + - + True + 6 - + + True + gtk-missing-image + + + False + False + 0 + + + + + True + True + 0 + True + True + True + + + 1 + - False - False 1 + + 0 + + + + + True + vertical + + + + + + False + False + 1 + - - False - False - 1 - False + False + 1 + + + + + False + 0 + + + + + vertical + 6 + + + True + 0 + <b>Groups</b> + True + + + False + False + 0 - - 6 - - - True - 0 - <b>Groups</b> - True - - - False - False - - + + True + 12 - + True - 12 + vertical + 6 - + True - 6 + 0 + Select the groups you want this contact to appear in. Note that you can select more than one group or no groups. + True + True + + + False + False + 0 + + + + + True + 12 - + True - 0 - Select the groups you want this contact to appear in. Note that you can select more than one group or no groups. - True - True + True + - False - False + 0 - + + _Add Group True - 12 - - - True - True - - - - - True - False - True - _Add Group - True - - - False - False - 1 - - + False + True + True + True False @@ -218,339 +230,356 @@ 1 + + + False + False + 1 + + + + + 100 + True + True + never + automatic + in - - 100 + True True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - - - True - True - False - False - - + False + False - - 2 - + + 2 + - - 1 - 1 + + + 1 + + + + + vertical + 6 - - 6 - - - True - 0 - <b>Contact Details</b> - True - - - False - False - - + + True + 0 + <b>Contact Details</b> + True + + + False + False + 0 + + + + + True + 12 - + True - 12 + vertical + 6 - - True - 6 + + 4 + 2 + 12 + 6 - - 4 - 2 - 12 - 6 - - - - - - - - - - - - - - - 0 - Fullname: - - - GTK_FILL - - - - - - 0 - Email: - - - 1 - 2 - GTK_FILL - - - - - - 0 - Web site: - - - 2 - 3 - GTK_FILL - - - - - - 0 - Birthday: - - - 3 - 4 - GTK_FILL - - - + + 0 + Fullname: + + + GTK_FILL + + + + + + 0 + Email: + + + 1 + 2 + GTK_FILL + + + + + + 0 + Web site: + + 2 + 3 + GTK_FILL + + + + + + 0 + Birthday: + + + 3 + 4 + GTK_FILL + + + + + + + + - + + + + + + + + 0 + + + + + True + 6 + + True - 6 - - - True - gtk-dialog-info - - - False - False - - - - - True - 0 - Information requested... - True - True - - - 1 - - + gtk-dialog-info False False + 0 + + + + + True + 0 + Information requested... + True + True + + 1 + + False + False + 1 + - - False - False - 1 - False - 2 + False + 1 + + + False + 2 + + + + + vertical + 6 - - 6 - - - True - 0 - <b>Client Information</b> - True - - - False - False - - + + True + 0 + <b>Client Information</b> + True + + + False + False + 0 + + + + + True + 12 - + True - 12 + vertical + 6 - + + 3 + 2 + 12 + 6 + + + 0 + 0 + OS: + + + 2 + 3 + GTK_FILL + + + + + 0 + 0 + Version: + + + 1 + 2 + GTK_FILL + + + + + 0 + 0 + Client: + + + GTK_FILL + + + + + True + 0 + 2 + True + True + + + 1 + 2 + + + + + + True + 0 + 2 + True + True + + + 1 + 2 + 1 + 2 + + + + + + True + 0 + 2 + True + True + + + 1 + 2 + 2 + 3 + + + + + + False + 0 + + + + True 6 - - 3 - 2 - 12 - 6 - - - 0 - 0 - OS: - - - 2 - 3 - GTK_FILL - - - - - 0 - 0 - Version: - - - 1 - 2 - GTK_FILL - - - - - 0 - 0 - Client: - - - GTK_FILL - - - - - True - 0 - 2 - True - True - - - 1 - 2 - - - - - - True - 0 - 2 - True - True - - - 1 - 2 - 1 - 2 - - - - - - True - 0 - 2 - True - True - - - 1 - 2 - 2 - 3 - - - + + True + gtk-dialog-info False + False + 0 - + True - 6 - - - True - gtk-dialog-info - - - False - False - - - - - True - 0 - Information requested... - True - True - - - 1 - - + 0 + Information requested... + True + True - False - False 1 + + False + False + 1 + - - False - False - 1 - False - 3 + False + 1 + + False + 3 + -- 2.39.2