diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-17 22:29:03 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-21 17:17:49 +0800 |
commit | 1629b3b04f38eb748ae8385e407e01bfaf312a63 (patch) | |
tree | 612502aee7dfeecd1a5419416f3bd4ee7b920297 /libempathy-gtk/empathy-individual-widget.c | |
parent | 932d46f051bbfbf144dcb063849e4f285daa8586 (diff) | |
download | gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.gz gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.bz2 gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.lz gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.xz gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.zst gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.zip |
Port to champlain 0.10 (#642010)
Diffstat (limited to 'libempathy-gtk/empathy-individual-widget.c')
-rw-r--r-- | libempathy-gtk/empathy-individual-widget.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c index 35e12dbe2..8ca5c0f73 100644 --- a/libempathy-gtk/empathy-individual-widget.c +++ b/libempathy-gtk/empathy-individual-widget.c @@ -728,8 +728,8 @@ location_update (EmpathyIndividualWidget *self) #ifdef HAVE_LIBCHAMPLAIN if (display_map == TRUE) { - GPtrArray *markers; - ChamplainLayer *layer; + ChamplainMarkerLayer *layer; + ChamplainBoundingBox *bbox; priv->map_view_embed = gtk_champlain_embed_new (); priv->map_view = gtk_champlain_embed_get_view ( @@ -738,14 +738,12 @@ location_update (EmpathyIndividualWidget *self) gtk_container_add (GTK_CONTAINER (priv->viewport_map), priv->map_view_embed); g_object_set (G_OBJECT (priv->map_view), - "show-license", TRUE, - "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC, + "kinetic-mode", TRUE, "zoom-level", 10, NULL); - layer = champlain_layer_new (); - champlain_view_add_layer (priv->map_view, layer); - markers = g_ptr_array_new (); + layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_NONE); + champlain_view_add_layer (priv->map_view, CHAMPLAIN_LAYER (layer)); /* FIXME: For now, we have to do this manually. Once libfolks grows a * location interface, we can use that. (bgo#627400) */ @@ -793,24 +791,21 @@ location_update (EmpathyIndividualWidget *self) lon = g_value_get_double (value); /* Add a marker to the map */ - marker = champlain_marker_new_with_text ( + marker = champlain_label_new_with_text ( folks_aliasable_get_alias (FOLKS_ALIASABLE (persona)), NULL, NULL, NULL); - champlain_base_marker_set_position ( - CHAMPLAIN_BASE_MARKER (marker), lat, lon); - clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL); - - g_ptr_array_add (markers, marker); + champlain_location_set_location (CHAMPLAIN_LOCATION (marker), + lat, lon); + champlain_marker_layer_add_marker (layer, + CHAMPLAIN_MARKER (marker)); g_object_unref (contact); } } /* Zoom to show all of the markers */ - g_ptr_array_add (markers, NULL); /* NULL-terminate the array */ - champlain_view_ensure_markers_visible (priv->map_view, - (ChamplainBaseMarker **) markers->pdata, FALSE); - g_ptr_array_free (markers, TRUE); + bbox = champlain_layer_get_bounding_box (CHAMPLAIN_LAYER (layer)); + champlain_view_ensure_visible (priv->map_view, bbox, FALSE); gtk_widget_show_all (priv->viewport_map); } |