MACRO_BANNER_SHOW_INFO(_window, _("Auto-Center Mode: Lat/Lon"));
break;
case CENTER_MANUAL:
+ default:
_center_mode = -_center_mode;
MACRO_BANNER_SHOW_INFO(_window, _("Auto-Center Off"));
return TRUE;
}
gboolean
-menu_cb_goto_home(GtkAction * action)
+menu_cb_goto_home(GtkAction *action)
{
-guint unitx, unity;
-
-if (_home.valid==FALSE) {
+if (map_goto_position(&_home)==FALSE) {
MACRO_BANNER_SHOW_INFO(_window, _("Home not set."));
- return TRUE;
+} else {
+ MACRO_BANNER_SHOW_INFO(_window, _("At home location"));
}
-_center_mode = CENTER_MANUAL;
-latlon2unit(_home.lat, _home.lon, unitx, unity);
-map_center_unit(unitx, unity);
-map_set_autozoom(FALSE);
-map_update_location_from_center();
-MACRO_BANNER_SHOW_INFO(_window, _("At home location"));
return TRUE;
}
gboolean
menu_cb_goto_destination(GtkAction *action)
{
-guint unitx, unity;
-
-if (_dest.valid==FALSE) {
+if (map_goto_position(&_dest)==FALSE) {
MACRO_BANNER_SHOW_INFO(_window, _("Destination not set."));
- return TRUE;
+} else {
+ MACRO_BANNER_SHOW_INFO(_window, _("At destination"));
}
-_center_mode = CENTER_MANUAL;
-latlon2unit(_dest.lat, _dest.lon, unitx, unity);
-map_center_unit(unitx, unity);
-map_set_autozoom(FALSE);
-map_update_location_from_center();
-MACRO_BANNER_SHOW_INFO(_window, _("At destination"));
return TRUE;
}
gboolean
-menu_cb_goto_gps(GtkAction * action)
+menu_cb_goto_gps(GtkAction *action)
{
_center_mode = CENTER_LATLON;
map_center_unit(_pos.unitx, _pos.unity);