aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-25 17:42:07 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-25 23:04:43 +0800
commit3e67f2f4f77ba1e59f69721f9821a482cba1678a (patch)
treec80273623165915d16a95d61bcaa5077afc6fc85 /libempathy-gtk/empathy-contact-widget.c
parented582f419d68c95dabfc26d4453c89d0d7f038a4 (diff)
downloadgsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.tar
gsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.tar.gz
gsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.tar.bz2
gsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.tar.lz
gsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.tar.xz
gsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.tar.zst
gsoc2013-empathy-3e67f2f4f77ba1e59f69721f9821a482cba1678a.zip
contact-widget: display map even if contact only published his lat/lon
We used to hide the whole location vbox if no field was displayed in the location table (such as street, city, etc). But if contact only publishes it's lat and lon, we can at least display the map widget. (#611062)
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index f55e81405..f4e7de4e1 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -552,6 +552,7 @@ contact_widget_location_update (EmpathyContactWidget *information)
};
int i;
const gchar *skey;
+ gboolean display_map = FALSE;
if (!(information->flags & EMPATHY_CONTACT_WIDGET_SHOW_LOCATION))
{
@@ -666,20 +667,30 @@ contact_widget_location_update (EmpathyContactWidget *information)
row++;
}
- if (row == 0)
+#if HAVE_LIBCHAMPLAIN
+ if (has_position &&
+ !(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP))
+ {
+ /* Cannot be displayed in tooltips until Clutter-Gtk can deal with such
+ * windows */
+ display_map = TRUE;
+ }
+#endif
+
+ if (row > 0)
+ {
+ /* We can display some fields */
+ gtk_widget_show (information->table_location);
+ }
+ else if (!display_map)
{
+ /* Can't display either fields or map */
gtk_widget_hide (information->vbox_location);
return;
}
- gtk_widget_show (information->table_location);
-
#if HAVE_LIBCHAMPLAIN
- /* Cannot be displayed in tooltips until Clutter-Gtk can deal with such
- * windows
- */
- if (has_position &&
- !(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP))
+ if (display_map)
{
ClutterActor *marker;
ChamplainLayer *layer;