From 26d5ec23e04736bc4c28ef005f4797c2a312065b Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 6 Aug 2007 17:33:53 +0300 Subject: [PATCH] Connect goto home menu item. Misc other fixes. --- src/cb.c | 4 ++-- src/settings-gui.c | 48 ++++++++++++++++------------------------------ src/ui-common.c | 2 ++ 3 files changed, 20 insertions(+), 34 deletions(-) diff --git a/src/cb.c b/src/cb.c index 3a845eb..b0b9293 100644 --- 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__); diff --git a/src/settings-gui.c b/src/settings-gui.c index 1cae3c3..2279a09 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -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 diff --git a/src/ui-common.c b/src/ui-common.c index 69dbc70..7e3d5a1 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -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", -- 2.39.5