]> err.no Git - mapper/commitdiff
Connect goto home menu item. Misc other fixes.
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 6 Aug 2007 14:33:53 +0000 (17:33 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 6 Aug 2007 14:33:53 +0000 (17:33 +0300)
src/cb.c
src/settings-gui.c
src/ui-common.c

index 3a845eb012dce266a0b5f0de4625d31d702aca35..b0b92935670ed7348612712b3a98069bbf4b420d 100644 (file)
--- a/src/cb.c
+++ b/src/cb.c
@@ -444,6 +444,7 @@ gboolean menu_cb_goto_home(GtkAction * action)
 
        latlon2unit(_home.lat, _home.lon, unitx, unity);
        map_center_unit(unitx, unity);
+    map_set_autozoom(FALSE);
 
        vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
        return TRUE;
@@ -476,8 +477,7 @@ gboolean menu_cb_goto_nextway(GtkAction * action)
                map_center_unit(_next_way->point->unitx,
                                _next_way->point->unity);
        } else {
-               MACRO_BANNER_SHOW_INFO(_window,
-                                      _("There is no next waypoint."));
+               MACRO_BANNER_SHOW_INFO(_window, _("There is no next waypoint."));
        }
 
        vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
index 1cae3c36673910ffe3bd3323557fae31ccc7c59e..2279a09618bad79b7c4bbc3f7f154b9ee3d531cf 100644 (file)
@@ -146,16 +146,12 @@ settings_dialog_hardkeys(GtkWidget * widget, GtkWidget * parent)
                for (i = 0; i < CUSTOM_KEY_ENUM_COUNT; i++) {
                        gint j;
                        for (j = i + 1; j < CUSTOM_KEY_ENUM_COUNT; j++) {
-                               if (gtk_combo_box_get_active
-                                   (GTK_COMBO_BOX(bdi.cmb[i]))
-                                   ==
-                                   gtk_combo_box_get_active(GTK_COMBO_BOX
-                                                            (bdi.cmb[j]))) {
+                               if (gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[i]))
+                                   == gtk_combo_box_get_active(GTK_COMBO_BOX(bdi.cmb[j]))) {
                                        GtkWidget *confirm;
                                        gchar *buffer =
                                            g_strdup_printf("%s:\n    %s\n%s",
-                                                           _
-                                                           ("The following action is mapped to multiple keys"),
+                                                           _("The following action is mapped to multiple keys"),
                                                            CUSTOM_ACTION_TEXT
                                                            [gtk_combo_box_get_active
                                                             (GTK_COMBO_BOX
@@ -322,51 +318,40 @@ settings_dialog_colors(GtkWidget * widget, GtkWidget * parent)
 
        gtk_widget_show_all(dialog);
 
-       while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
-               GdkColor *color;
+       if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+               GdkColor *color=NULL;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_MARK]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]),color);
                _color[COLORABLE_MARK] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_MARK_VELOCITY]) ,color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]) ,color);
                _color[COLORABLE_MARK_VELOCITY] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_MARK_OLD]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]),color);
                _color[COLORABLE_MARK_OLD] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_TRACK]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]),color);
                _color[COLORABLE_TRACK] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_TRACK_MARK]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]),color);
                _color[COLORABLE_TRACK_MARK] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_TRACK_BREAK]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),color);
                _color[COLORABLE_TRACK_BREAK] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_ROUTE]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),color);
                _color[COLORABLE_ROUTE] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_ROUTE_WAY]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),color);
                _color[COLORABLE_ROUTE_WAY] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_ROUTE_BREAK]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),color);
                _color[COLORABLE_ROUTE_BREAK] = *color;
 
-               gtk_color_button_get_color(GTK_COLOR_BUTTON
-                                                 (cdi.col[COLORABLE_POI]),color);
+               gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),color);
                _color[COLORABLE_POI] = *color;
 
                update_gcs();
-               break;
        }
 
        gtk_widget_destroy(dialog);
@@ -725,7 +710,7 @@ settings_dialog(void)
        gtk_widget_hide(lbl_voice_pitch);
        gtk_widget_hide(num_voice_pitch);
 
-       while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
+       if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
                /* Set _rcvr_mac if necessary. */
                if (!*gtk_entry_get_text(GTK_ENTRY(txt_rcvr_mac))) {
                        /* User specified no rcvr mac - set _rcvr_mac to NULL. */
@@ -797,7 +782,6 @@ settings_dialog(void)
                update_gcs();
 
                config_save();
-               break;
        }
 
 #ifndef WITH_HILDON
index 69dbc70b9f8c5f0ca1d4ef32ff4d2182bbf62dba..7e3d5a1fe86728e98a3d0bdb70657955f225b505 100644 (file)
@@ -472,6 +472,8 @@ static void menu_init()
                         G_CALLBACK(menu_cb_ac_none), NULL);
 
        /* 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_latlon), "activate",
                         G_CALLBACK(menu_cb_goto_latlon), NULL);
        g_signal_connect(G_OBJECT(_menu_goto_gps), "activate",