diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-03-14 18:57:12 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-03-16 17:29:39 +0800 |
commit | 98648871225823cf7ddc11a746185fe9007d6936 (patch) | |
tree | 10bed2f86d69a89095b8fcf90564a48021996714 /libempathy-gtk | |
parent | ede1523b824fef2f72b8d60f4efdf78a4fc4a768 (diff) | |
download | gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.tar gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.tar.gz gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.tar.bz2 gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.tar.lz gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.tar.xz gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.tar.zst gsoc2013-empathy-98648871225823cf7ddc11a746185fe9007d6936.zip |
contact-widget: don't display the account when editing our info
All these flags are making this code pretty messy. Hopefully we'll move and
clean it when implementing the new design next cycle.
https://bugzilla.gnome.org/show_bug.cgi?id=672036
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 20 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.h | 1 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.ui | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index edeec31f4..e44772a72 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -103,6 +103,7 @@ typedef struct GtkWidget *vbox_avatar; GtkWidget *favourite_checkbox; GtkWidget *label_details; + GtkWidget *label_left_account; /* Location */ GtkWidget *vbox_location; @@ -1403,7 +1404,7 @@ contact_widget_contact_update (EmpathyContactWidget *information) contact_widget_change_contact, information); } } - else + else if ((information->flags & EMPATHY_CONTACT_WIDGET_NO_ACCOUNT) == 0) { if (account) { @@ -1585,6 +1586,11 @@ contact_widget_contact_setup (EmpathyContactWidget *information) G_CALLBACK (contact_widget_change_contact), information); } + else if (information->flags & EMPATHY_CONTACT_WIDGET_NO_ACCOUNT) + { + /* Don't display the account */ + gtk_widget_hide (information->label_left_account); + } else { /* Pack the protocol icon with the account name in an hbox */ @@ -1606,11 +1612,14 @@ contact_widget_contact_setup (EmpathyContactWidget *information) information->label_account, FALSE, TRUE, 0); } - gtk_grid_attach (GTK_GRID (information->grid_contact), - information->widget_account, - 1, 0, 1, 1); + if (information->widget_account != NULL) + { + gtk_grid_attach (GTK_GRID (information->grid_contact), + information->widget_account, + 1, 0, 1, 1); - gtk_widget_show (information->widget_account); + gtk_widget_show (information->widget_account); + } /* Set up avatar chooser/display */ if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_AVATAR) @@ -1761,6 +1770,7 @@ empathy_contact_widget_new (EmpathyContact *contact, "grid_client", &information->grid_client, "hbox_client_requested", &information->hbox_client_requested, "label_details", &information->label_details, + "label_left_account", &information->label_left_account, NULL); g_free (filename); diff --git a/libempathy-gtk/empathy-contact-widget.h b/libempathy-gtk/empathy-contact-widget.h index 2533248b5..a50f9fa3e 100644 --- a/libempathy-gtk/empathy-contact-widget.h +++ b/libempathy-gtk/empathy-contact-widget.h @@ -64,6 +64,7 @@ typedef enum EMPATHY_CONTACT_WIDGET_SHOW_DETAILS = 1 << 8, EMPATHY_CONTACT_WIDGET_EDIT_DETAILS = 1 << 9, EMPATHY_CONTACT_WIDGET_NO_STATUS = 1 << 10, + EMPATHY_CONTACT_WIDGET_NO_ACCOUNT = 1 << 11, } EmpathyContactWidgetFlags; GtkWidget * empathy_contact_widget_new (EmpathyContact *contact, diff --git a/libempathy-gtk/empathy-contact-widget.ui b/libempathy-gtk/empathy-contact-widget.ui index a8d9fbe7a..c6cb7a5ca 100644 --- a/libempathy-gtk/empathy-contact-widget.ui +++ b/libempathy-gtk/empathy-contact-widget.ui @@ -10,7 +10,7 @@ <property name="column_spacing">6</property> <property name="row_spacing">6</property> <child> - <object class="GtkLabel" id="label680"> + <object class="GtkLabel" id="label_left_account"> <property name="visible">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">Account:</property> |