X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/34e71b99e03119ecc9b644595f66d2c0f86f9ac2..5f95559592dfdbf92b2fc0d39906329facf1729e:/src/vikgoto.c diff --git a/src/vikgoto.c b/src/vikgoto.c index 0b1a851a..233541ef 100644 --- a/src/vikgoto.c +++ b/src/vikgoto.c @@ -2,6 +2,7 @@ * viking -- GPS Data and Topo Analyzer, Explorer, and Manager * * Copyright (C) 2003-2005, Evan Battaglia + * Copyright (C) 2009, Guilhem Bonnefille * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Created by Quy Tonthat */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -42,7 +42,7 @@ static gchar *last_successful_goto_str = NULL; static GList *goto_tools_list = NULL; -int last_goto_tool = -1; +int last_goto_tool = 0; void vik_goto_register ( VikGotoTool *tool ) { @@ -91,6 +91,7 @@ static gboolean prompt_try_again(VikWindow *vw) GtkWidget *goto_label = gtk_label_new(_("I don't know that place. Do you want another goto?")); gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), goto_label, FALSE, FALSE, 5 ); + gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT ); gtk_widget_show_all(dialog); if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) != GTK_RESPONSE_ACCEPT ) @@ -119,8 +120,8 @@ static gchar * a_prompt_for_goto_string(VikWindow *vw) gtk_combo_box_append_text ( GTK_COMBO_BOX( tool_list ), label); current = g_list_next (current); } - /* Set the first provider as default */ - gtk_combo_box_set_active ( GTK_COMBO_BOX( tool_list ), 0); + /* Set the previously selected provider as default */ + gtk_combo_box_set_active ( GTK_COMBO_BOX( tool_list ), last_goto_tool); GtkWidget *goto_label = gtk_label_new(_("Enter address or place name:")); GtkWidget *goto_entry = gtk_entry_new(); @@ -131,6 +132,7 @@ static gchar * a_prompt_for_goto_string(VikWindow *vw) gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), tool_list, FALSE, FALSE, 5 ); gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), goto_label, FALSE, FALSE, 5 ); gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), goto_entry, FALSE, FALSE, 5 ); + gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT ); gtk_widget_show_all(dialog); if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) != GTK_RESPONSE_ACCEPT ) {