]> err.no Git - mapper/commitdiff
Remove gps reset hack.
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 16 Jul 2007 13:33:48 +0000 (16:33 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 16 Jul 2007 13:33:48 +0000 (16:33 +0300)
src/cb.c
src/settings-gui.c
src/ui-common.c
src/utils.c
src/utils.h

index aa08bdb646b03ed514a7bcfcb5b317575f915e7e..ac71df625feb540fa5de8d0d6b6b9f1d9eb11194 100644 (file)
--- a/src/cb.c
+++ b/src/cb.c
@@ -57,10 +57,8 @@ gboolean map_cb_configure(GtkWidget * widget, GdkEventConfigure * event)
 
        _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);
 
@@ -656,7 +654,6 @@ gboolean menu_cb_enable_gps(GtkAction * action)
        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;
@@ -679,16 +676,6 @@ gboolean menu_cb_auto_download(GtkAction * action)
        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__);
@@ -907,10 +894,6 @@ gboolean window_cb_key_press(GtkWidget * widget, GdkEventKey * event)
                        break;
                }
 
-       case CUSTOM_ACTION_RESET_BLUETOOTH:
-               reset_bluetooth();
-               break;
-
        case CUSTOM_ACTION_ROUTE_DISTNEXT:
                route_show_distance_to_next();
                break;
index 69112e6723e43ecfb7ebec0535186c2ff41815f4..8b207ffb59affc380ec8121ce7b8c2de4b6b4892 100644 (file)
@@ -789,9 +789,6 @@ gboolean settings_dialog()
                                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. */
index 0c827d74bd5c1292c975e481c14be8df9c06515f..0b0685dedc71fe818844426511889f70b02695c9 100644 (file)
@@ -430,10 +430,6 @@ static void menu_init()
                        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. */
@@ -548,8 +544,6 @@ static void menu_init()
                         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);
 
index d1da6550f1e066b4ee32e8ba86ce034d488f52e0..75b5238f9a43f4f7b02e1c6b14dc87b7885b1cd8 100644 (file)
@@ -187,27 +187,3 @@ download_comparefunc(const ProgressUpdateInfo * a,
        /* 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
index a4c8fc2278c4fee780d8583a0bd765dd05f5d72e..bbac3067275b502a0f5a8c4b0941853acff88acc 100644 (file)
 
 #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; \