From eeae3f57c40e0ed599771bd0c886993c88f0c0f8 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 5 Jun 2008 12:23:35 +0300 Subject: [PATCH] More map widget integration fixes --- src/cb.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cb.c b/src/cb.c index 1be88a3..5a8138d 100644 --- a/src/cb.c +++ b/src/cb.c @@ -341,7 +341,7 @@ return TRUE; gboolean menu_cb_goto_nextway(GtkAction *action) { -GtkMapCenterMode *cm; +GtkMapCenterMode cm; g_return_val_if_fail(_route, TRUE); @@ -363,7 +363,7 @@ return TRUE; gboolean menu_cb_goto_nearpoi(GtkAction *action) { -GtkMapCenterMode *cm; +GtkMapCenterMode cm; gdouble lat, lon; poi_info *p; @@ -378,11 +378,11 @@ if (p) { g_free(banner); poi_free(p); - if (gtk_map_get_center_mode(_map)!=CENTER_MANUAL) + g_object_get(_map, "center-mode", &cm); + if (cm!=CENTER_MANUAL) set_action_activate("autocenter_none", TRUE); gtk_map_set_center_latlon(_map, p->lat, p->lon); - map_update_location_from_center(); } else { MACRO_BANNER_SHOW_INFO(_window, _("No POIs found.")); } @@ -617,6 +617,7 @@ gboolean window_cb_key_press(GtkWidget * widget, GdkEventKey * event) { CustomKey custom_key; +GtkMapCenterMode cm; custom_key=custom_key_get_type(event->keyval); if (custom_key==CUSTOM_KEY_ENUM_COUNT) @@ -636,7 +637,8 @@ switch (_action[custom_key]) { gtk_map_pan(_map, 1, 0); break; case CUSTOM_ACTION_TOGGLE_AUTOCENTER: - switch (gtk_map_get_center_mode(_map)) { + g_object_get(_map, "center-mode", &cm); + switch (cm) { case CENTER_LATLON: case CENTER_WAS_LEAD: set_action_activate("autocenter_lead", TRUE); @@ -938,8 +940,10 @@ cb_poi_search(GtkAction *action) { poi_info poi; gdouble lat, lon; +GtkMapCenterMode cm; -if (gtk_map_get_center_mode(_map)!=CENTER_MANUAL) { +g_object_get(_map, "center-mode", &cm); +if (cm!=CENTER_MANUAL) { lat=_gps->data.lat; lon=_gps->data.lon; } else { -- 2.39.5