]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikgoto.c
GeoRef Layer only works in UTM Projection Mode.
[andy/viking.git] / src / vikgoto.c
index 407883a91ccc6e78d616c6e8990ec1be607270b2..382887d71f7bcac6bb98a4dd44995e5d32cfec84 100644 (file)
@@ -2,6 +2,7 @@
  * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
  *
  * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
+ * Copyright (C) 2009, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
  *
  * 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 <qtonthat@gmail.com>
  */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -32,9 +32,8 @@
 
 #include "viking.h"
 #include "util.h"
-#include "curl_download.h"
-
 #include "vikgototool.h"
+#include "vikgoto.h"
 
 static gchar *last_goto_str = NULL;
 static VikCoord *last_coord = NULL;
@@ -46,9 +45,8 @@ int last_goto_tool = 0;
 
 void vik_goto_register ( VikGotoTool *tool )
 {
-  IS_VIK_GOTO_TOOL( tool );
-
-  goto_tools_list = g_list_append ( goto_tools_list, g_object_ref ( tool ) );
+  if ( IS_VIK_GOTO_TOOL( tool ) )
+    goto_tools_list = g_list_append ( goto_tools_list, g_object_ref ( tool ) );
 }
 
 void vik_goto_unregister_all ()
@@ -91,6 +89,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 )
@@ -131,6 +130,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 ) {
@@ -153,7 +153,7 @@ static gchar *  a_prompt_for_goto_string(VikWindow *vw)
   return(goto_str);   /* goto_str needs to be freed by caller */
 }
 
-void a_vik_goto(VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp)
+void a_vik_goto(VikWindow *vw, VikViewport *vvp)
 {
   VikCoord new_center;
   gchar *s_str;
@@ -181,7 +181,6 @@ void a_vik_goto(VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp)
         g_free(last_successful_goto_str);
       last_successful_goto_str = g_strdup(last_goto_str);
       vik_viewport_set_center_coord(vvp, &new_center);
-      vik_layers_panel_emit_update(vlp);
       more = FALSE;
     }
     else if (!prompt_try_again(vw))