return TRUE;
}
+gboolean menu_cb_goto_destination(GtkAction *action)
+{
+guint unitx, unity;
+
+if (_dest.valid==FALSE) {
+ MACRO_BANNER_SHOW_INFO(_window, _("Destination not set."));
+ return TRUE;
+}
+latlon2unit(_dest.lat, _dest.lon, unitx, unity);
+map_center_unit(unitx, unity);
+map_set_autozoom(FALSE);
+return TRUE;
+}
+
gboolean menu_cb_goto_gps(GtkAction * action)
{
printf("%s()\n", __PRETTY_FUNCTION__);
_pos.unitx = x2unit(_cmenu_position_x);
_pos.unity = y2unit(_cmenu_position_y);
unit2latlon(_pos.unitx, _pos.unity, _home.lat, _home.lon);
+_home.valid=TRUE;
config_save_home();
return TRUE;
}
+gboolean cmenu_cb_loc_set_destination(GtkAction *action)
+{
+_pos.unitx = x2unit(_cmenu_position_x);
+_pos.unity = y2unit(_cmenu_position_y);
+unit2latlon(_pos.unitx, _pos.unity, _dest.lat, _dest.lon);
+_dest.valid=TRUE;
+return TRUE;
+}
+
gboolean cmenu_cb_loc_set_gps(GtkAction * action)
{
_pos.unitx = x2unit(_cmenu_position_x);
gboolean menu_cb_goto_latlon(GtkAction * action);
gboolean menu_cb_goto_gps(GtkAction * action);
gboolean menu_cb_goto_home(GtkAction * action);
+gboolean menu_cb_goto_destination(GtkAction *action);
gboolean menu_cb_goto_nextway(GtkAction * action);
gboolean menu_cb_goto_nearpoi(GtkAction * action);
gboolean cmenu_cb_loc_add_poi(GtkAction * action);
gboolean cmenu_cb_loc_set_gps(GtkAction * action);
gboolean cmenu_cb_loc_set_home(GtkAction * action);
+gboolean cmenu_cb_loc_set_destination(GtkAction *action);
gboolean cb_add_poi(GtkAction * action);
#endif
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new());
gtk_menu_append(submenu, _menu_goto_home = gtk_menu_item_new_with_label(_("Home")));
+ gtk_menu_append(submenu, _menu_goto_destination = gtk_menu_item_new_with_label(_("Destination")));
+ gtk_menu_append(submenu, _menu_goto_address = gtk_menu_item_new_with_label(_("Address...")));
gtk_menu_append(submenu, _menu_goto_latlon = gtk_menu_item_new_with_label(_("Lat/Lon...")));
gtk_menu_append(submenu, _menu_goto_gps = gtk_menu_item_new_with_label(_("GPS Location")));
gtk_menu_append(submenu, _menu_goto_nextway = gtk_menu_item_new_with_label(_("Next Waypoint")));
/* Connect the "Go to" signals. */
g_signal_connect(G_OBJECT(_menu_goto_home), "activate",
G_CALLBACK(menu_cb_goto_home), NULL);
+ g_signal_connect(G_OBJECT(_menu_goto_destination), "activate",
+ G_CALLBACK(menu_cb_goto_destination), NULL);
g_signal_connect(G_OBJECT(_menu_goto_latlon), "activate",
G_CALLBACK(menu_cb_goto_latlon), NULL);
g_signal_connect(G_OBJECT(_menu_goto_gps), "activate",
gtk_menu_append(submenu, _cmenu_loc_clip_latlon_item
= gtk_menu_item_new_with_label(_("Copy Lat/Lon")));
gtk_menu_append(submenu, gtk_separator_menu_item_new());
+ gtk_menu_append(submenu, _cmenu_loc_set_destination
+ = gtk_menu_item_new_with_label(_("Set destination")));
gtk_menu_append(submenu, _cmenu_loc_distance_to_item
= gtk_menu_item_new_with_label(_("Show Distance to")));
gtk_menu_append(submenu, _cmenu_loc_route_to_item
G_CALLBACK(cmenu_cb_loc_set_gps), NULL);
g_signal_connect(G_OBJECT(_cmenu_loc_set_home), "activate",
G_CALLBACK(cmenu_cb_loc_set_home), NULL);
+ g_signal_connect(G_OBJECT(_cmenu_loc_set_destination), "activate",
+ G_CALLBACK(cmenu_cb_loc_set_destination), NULL);
g_signal_connect(G_OBJECT(_cmenu_way_show_latlon_item), "activate",
G_CALLBACK(cmenu_cb_way_show_latlon), NULL);
/* Menu items for the "Go to" submenu. */
GtkWidget *_menu_goto_home;
+GtkWidget *_menu_goto_destination;
+GtkWidget *_menu_goto_address;
GtkWidget *_menu_goto_latlon;
GtkWidget *_menu_goto_gps;
GtkWidget *_menu_goto_nextway;
GtkWidget *_cmenu_loc_add_way;
GtkWidget *_cmenu_loc_add_poi;
GtkWidget *_cmenu_loc_set_gps;
+GtkWidget *_cmenu_loc_set_destination;
GtkWidget *_cmenu_loc_set_home;
/* Menu items for the "Waypoint" context menu. */