]> err.no Git - mapper/commitdiff
More map widget integration fixes
authorKaj-Michael Lang <milang@tal.org>
Thu, 5 Jun 2008 09:23:35 +0000 (12:23 +0300)
committerKaj-Michael Lang <milang@tal.org>
Thu, 5 Jun 2008 09:23:35 +0000 (12:23 +0300)
src/cb.c

index 1be88a361c6a980ef5856af4f58260ec1dbaf1b8..5a8138d1fde5748aef58700742552ed616581250 100644 (file)
--- 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 {