_min_center.unitx = pixel2unit(grid2pixel(_screen_grids_halfwidth));
_min_center.unity = pixel2unit(grid2pixel(_screen_grids_halfheight));
- _max_center.unitx =
- WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfwidth) - 1;
- _max_center.unity =
- WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfheight) - 1;
+ _max_center.unitx = WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfwidth) - 1;
+ _max_center.unity = WORLD_SIZE_UNITS - grid2unit(_screen_grids_halfheight) - 1;
map_center_unit(_center.unitx, _center.unity);
map_move_mark();
gps_show_info();
gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item), _enable_gps);
- gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_reset_item), _enable_gps);
vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
return TRUE;
return TRUE;
}
-gboolean menu_cb_gps_reset(GtkAction * action)
-{
- printf("%s()\n", __PRETTY_FUNCTION__);
-
- reset_bluetooth();
-
- vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
- return TRUE;
-}
-
gboolean menu_cb_gps_details(GtkAction * action)
{
printf("%s()\n", __PRETTY_FUNCTION__);
break;
}
- case CUSTOM_ACTION_RESET_BLUETOOTH:
- reset_bluetooth();
- break;
-
case CUSTOM_ACTION_ROUTE_DISTNEXT:
route_show_distance_to_next();
break;
gtk_widget_set_sensitive(GTK_WIDGET
(_menu_gps_details_item),
FALSE);
- gtk_widget_set_sensitive(GTK_WIDGET
- (_menu_gps_reset_item),
- FALSE);
}
} else if (!_rcvr_mac || strcmp(_rcvr_mac, gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac)))) {
/* User specified a new rcvr mac. */
gtk_menu_item_new_with_label(_("Details...")));
gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_details_item),
_enable_gps);
- gtk_menu_append(submenu, _menu_gps_reset_item =
- gtk_menu_item_new_with_label(_("Reset Bluetooth")));
- gtk_widget_set_sensitive(GTK_WIDGET(_menu_gps_reset_item), _enable_gps);
-
gtk_menu_append(menu, gtk_separator_menu_item_new());
/* The other menu items. */
G_CALLBACK(menu_cb_gps_show_info), NULL);
g_signal_connect(G_OBJECT(_menu_gps_details_item), "activate",
G_CALLBACK(menu_cb_gps_details), NULL);
- g_signal_connect(G_OBJECT(_menu_gps_reset_item), "activate",
- G_CALLBACK(menu_cb_gps_reset), NULL);
g_signal_connect(G_OBJECT(_menu_auto_download_item), "toggled",
G_CALLBACK(menu_cb_auto_download), NULL);
/* Do updates after non-updates (because they'll both be done anyway). */
return (a->retries - b->retries);
}
-
-#ifdef BT_HACK
-void reset_bluetooth()
-{
- printf("%s()\n", __PRETTY_FUNCTION__);
- if (system
- ("/usr/bin/sudo -l | grep -q '/usr/sbin/hciconfig *hci0 *reset'"
- " && sudo /usr/sbin/hciconfig hci0 reset"))
- popup_error(_window,
- _
- ("An error occurred while trying to reset the bluetooth "
- "radio.\n\n"
- "Did you make sure to modify\nthe /etc/sudoers file?"));
- else if (_conn_state > RCVR_OFF) {
- set_conn_state(RCVR_DOWN);
- rcvr_connect_later();
- }
- vprintf("%s(): return\n", __PRETTY_FUNCTION__);
-}
-#else
-void reset_bluetooth()
-{
-}
-#endif
#define PI (3.14159265358979323846f)
+#define MERCATOR_SPAN (-6.28318377773622f)
+#define MERCATOR_TOP (3.14159188886811f)
+
+#define SQR(s) ((s)*(s))
+
/** MAX_ZOOM defines the largest map zoom level we will download.
* (MAX_ZOOM - 1) is the largest map zoom level that the user can zoom to.
*/
(tofill) = strtol((str), &error_check, 10); \
if(error_check == (str)) \
{ \
- g_printerr("Line %d: Failed to parse string as int: %s\n", \
- __LINE__, str); \
- MACRO_BANNER_SHOW_INFO(_window, \
- _("Invalid NMEA input from receiver!")); \
+ g_printerr("Line %d: Failed to parse string as int: %s\n", __LINE__, str); \
+ MACRO_BANNER_SHOW_INFO(_window, _("Invalid NMEA input from receiver!")); \
return; \
} \
}
if(error_check == (str)) \
{ \
g_printerr("Failed to parse string as float: %s\n", str); \
- MACRO_BANNER_SHOW_INFO(_window, \
- _("Invalid NMEA input from receiver!")); \
+ MACRO_BANNER_SHOW_INFO(_window, _("Invalid NMEA input from receiver!")); \
return; \
} \
}
} \
};
-#define MERCATOR_SPAN (-6.28318377773622f)
-#define MERCATOR_TOP (3.14159188886811f)
-
#define latlon2unit(lat, lon, unitx, unity) { \
gfloat tmp; \
unitx = (lon + 180.f) * (WORLD_SIZE_UNITS / 360.f) + 0.5f; \