#include "garminsymbols.h"
#include "degrees_converters.h"
#include "authors.h"
+#include "googlesearch.h"
#include <stdlib.h>
#include <string.h>
commentlabel = gtk_label_new ("Comment:");
commententry = gtk_entry_new ();
+ gchar *cmt = a_googlesearch_get_search_string_for_this_place(parent);
+ if (cmt)
+ gtk_entry_set_text(GTK_ENTRY(commententry), cmt);
imagelabel = gtk_label_new ("Image:");
imageentry = vik_file_entry_new ();
#define GOOGLE_SEARCH_PATTERN_2 ",lng: "
static gchar *last_search_str = NULL;
+static VikCoord *last_coord = NULL;
+static gchar *last_successful_search_str = NULL;
+
+gchar * a_googlesearch_get_search_string_for_this_place(VikWindow *vw)
+{
+ VikViewport *vvp = vik_window_viewport(vw);
+ VikCoord *cur_center = vik_viewport_get_center(vvp);
+ if (vik_coord_equals(cur_center, last_coord)) {
+ return(last_successful_search_str);
+ }
+ else
+ return NULL;
+}
static gboolean prompt_try_again(VikWindow *vw)
{
vik_coord_load_from_latlon ( coord, vik_viewport_get_coord_mode(vvp), &ll );
+ if (last_coord)
+ g_free(last_coord);
+ last_coord = g_malloc(sizeof(VikCoord));
+ *last_coord = *coord;
+ if (last_successful_search_str)
+ g_free(last_successful_search_str);
+ last_successful_search_str = g_strdup(last_search_str);
+
done:
g_free(escaped_srch_str);
g_free(uri);
#define __VIK_GOOGLESEARCH_H
extern void a_google_search(VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp);
-
+gchar * a_googlesearch_get_search_string_for_this_place(VikWindow *vw);
#endif
return vw_type;
}
+VikViewport * vik_window_viewport(VikWindow *vw)
+{
+ return(vw->viking_vvp);
+}
+
void vik_window_selected_layer(VikWindow *vw, VikLayer *vl)
{
int i, j, tool_count;
void vik_window_open_file ( VikWindow *vw, const gchar *filename, gboolean changefilename );
struct _VikLayer;
void vik_window_selected_layer(VikWindow *vw, struct _VikLayer *vl);
+struct _VikViewport * vik_window_viewport(VikWindow *vw);
G_END_DECLS