gboolean cmenu_cb_loc_set_home(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);
+_pos.unitx = x2unit(_cmenu_position_x);
+_pos.unity = y2unit(_cmenu_position_y);
+unit2latlon(_pos.unitx, _pos.unity, _home.lat, _home.lon);
- vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
- return TRUE;
+config_save_home();
+return TRUE;
}
gboolean cmenu_cb_loc_set_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, _gps.lat, _gps.lon);
+_pos.unitx = x2unit(_cmenu_position_x);
+_pos.unity = y2unit(_cmenu_position_y);
+unit2latlon(_pos.unitx, _pos.unity, _gps.lat, _gps.lon);
- /* Move mark to new location. */
- refresh_mark();
+/* Move mark to new location. */
+refresh_mark();
- vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
- return TRUE;
+return TRUE;
}
gboolean cmenu_cb_way_show_latlon(GtkAction * action)
return TRUE;
}
+config_save_home(void)
+{
+GConfClient *gconf_client = gconf_client_get_default();
+
+if (!gconf_client)
+ return FALSE;
+
+/* Save home lat/lon. */
+gconf_client_set_float(gconf_client, GCONF_KEY_HOME_LAT, _home.lat, NULL);
+gconf_client_set_float(gconf_client, GCONF_KEY_HOME_LON, _home.lon, NULL);
+
+return TRUE;
+}
+
/**
* Save all configuration data to GCONF.
*/
gconf_client_set_float(gconf_client, GCONF_KEY_LAT, _gps.lat, NULL);
gconf_client_set_float(gconf_client, GCONF_KEY_LON, _gps.lon, NULL);
- /* Save home lat/lon. */
- gconf_client_set_float(gconf_client, GCONF_KEY_HOME_LAT, _home.lat, NULL);
- gconf_client_set_float(gconf_client, GCONF_KEY_HOME_LON, _home.lon, NULL);
-
/* Save last center point. */
{
gfloat center_lat, center_lon;