Re: [Viking-devel] [RFC] Geocaching: geotoad

2013-03-21 Thread Guilhem Bonnefille
2013/3/21 Robert Norris rw_nor...@hotmail.com


  [snip]
  Not yet tested geotoad.

 Feels a little quicker - it's own local caching mechanism is probably
 better the the geo*tools, but still takes a while overall.
 Would be nice to display the text feedback of progress in Viking.


Perhaps an add to acquire related dialog? Something like the progress
dialog of synaptic:
- main part of the dialog is a progress bar
- a folded part can be opened to display a text area with the raw output.


 Geotoad doesn't seem to write the final geocache to stdout only to a named
 file, but should be more cross platform than the geo*tools bash scripts.


Perhaps an add to geotoad directly. Something like the standard '-' as
filename.


 The other nice thing is at least it's one program.


Yes.


 I'd suggest changing to it and making Geocache part of the default build.
 (Then I won't forget to update the file when types change!)


Why not. Furthermore, we can certainly adapt dynamically the viking's UI
when geotoad is in PATH or not. Would certainly be better for user
experience and for packagers.


 I've attached the little hack to get Geotoad working with Viking, I hope
 that can start you off. It works for me.


Thanks. I will give an eye as soon as possible.

-- 
Guilhem BONNEFILLE
-=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com
-=- mailto:guilhem.bonnefi...@gmail.com
-=- http://nathguil.free.fr/
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

[Viking-devel] [RFC] Geocaching: geotoad

2013-03-20 Thread Guilhem Bonnefille
Hi,

In order to provide fun to my children while hiking, I plan to play
geocaching.

I notice viking has some stuff in tools subdirectory. But it seems to be a
part of a dedicated project. Any reason for this? Why not simply use it as
gpsbabel, ie as a dedicated external project? Nevertheless, I noticed this
project is not in Debian archive. Probably need a help.

I also notice an other similar project, called geotoad:
https://code.google.com/p/geotoad/wiki/README#Command-Line_Syntax
I think geotoad is the one packaged for my N900 (yes, I also installed a
geocaching tool for my n900).

Perhaps can we give choice to user which backend tool he wants to use?

Note: I only test the tool packaged in viking. And it is really slow. Not
yet tested geotoad.

-- 
Guilhem BONNEFILLE
-=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com
-=- mailto:guilhem.bonnefi...@gmail.com
-=- http://nathguil.free.fr/
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Re: [Viking-devel] [RFC] Geocaching: geotoad

2013-03-20 Thread Robert Norris

 Hi, 
  
 In order to provide fun to my children while hiking, I plan to play  
 geocaching. 
  
 I notice viking has some stuff in tools subdirectory. But it seems to  
 be a part of a dedicated project. Any reason for this? Why not simply  
 use it as gpsbabel, ie as a dedicated external project? Nevertheless, I  
 noticed this project is not in Debian archive. Probably need a help. 

Since it was just a couple of public domain shell scripts I thought it wouldn't 
harm to chuck it in the repository.
Especially as they're not packaged any where else.
 
 I also notice an other similar project, called geotoad: 
 https://code.google.com/p/geotoad/wiki/README#Command-Line_Syntax 
 I think geotoad is the one packaged for my N900 (yes, I also installed  
 a geocaching tool for my n900). 
  
 Perhaps can we give choice to user which backend tool he wants to use? 

Probably not - unless you want to deal with how each external program has 
different options.
I say pick one and stick with it.
 
 Note: I only test the tool packaged in viking. And it is really slow.  

Yes, it's really slow - but that's the draw back of having to screen scrape 
each individual geocache result to learn any detail about it.

 Not yet tested geotoad.

Feels a little quicker - it's own local caching mechanism is probably better 
the the geo*tools, but still takes a while overall.
Would be nice to display the text feedback of progress in Viking.

Geotoad doesn't seem to write the final geocache to stdout only to a named 
file, but should be more cross platform than the geo*tools bash scripts.

The other nice thing is at least it's one program.

I'd suggest changing to it and making Geocache part of the default build. (Then 
I won't forget to update the file when types change!)

I've attached the little hack to get Geotoad working with Viking, I hope that 
can start you off. It works for me.

  diff --git a/src/datasource_gc.c b/src/datasource_gc.c
index 14df1e2..7ad4d55 100644
--- a/src/datasource_gc.c
+++ b/src/datasource_gc.c
@@ -33,7 +33,8 @@
 #include preferences.h
 
 // Could have an array of programs instead...
-#define GC_PROGRAM1 geo-nearest
+#define GC_PROGRAM1 geotoad
+//#define GC_PROGRAM1 geo-nearest
 #define GC_PROGRAM2 geo-html2gpx
 
 /* params will be geocaching.username, geocaching.password */
@@ -107,24 +108,26 @@ static gpointer datasource_gc_init ( )
 static gchar *datasource_gc_check_existence ()
 {
   gboolean OK1 = FALSE;
-  gboolean OK2 = FALSE;
+  //gboolean OK2 = FALSE;
 
   gchar *location1 = g_find_program_in_path(GC_PROGRAM1);
   if ( location1 ) {
 g_free(location1);
 OK1 = TRUE;
   }
-
+  /*
   gchar *location2 = g_find_program_in_path(GC_PROGRAM2);
   if ( location2 ) {
 g_free(location2);
 OK2 = TRUE;
   }
-
-  if ( OK1  OK2 )
+  */
+  //if ( OK1  OK2 )
+  if ( OK1 )
 return NULL;
 
-  return g_strdup_printf(_(Can't find %s or %s in path! Check that you have installed it correctly.), GC_PROGRAM1, GC_PROGRAM2);
+  //return g_strdup_printf(_(Can't find %s or %s in path! Check that you have installed it correctly.), GC_PROGRAM1, GC_PROGRAM2);
+  return g_strdup_printf(_(Can't find %s in path! Check that you have installed it correctly.), GC_PROGRAM1);
 }
 
 static void datasource_gc_draw_circle ( datasource_gc_widgets_t *widgets )
@@ -191,7 +194,7 @@ static void datasource_gc_add_setup_widgets ( GtkWidget *dialog, VikViewport *vv
   center_label = gtk_label_new (_(Centered around:));
   widgets-center_entry = gtk_entry_new();
   miles_radius_label = gtk_label_new (Miles Radius:);
-  widgets-miles_radius_spin = gtk_spin_button_new ( GTK_ADJUSTMENT(gtk_adjustment_new( 5, 1, 1000, 1, 20, 0 )), 25, 1 );
+  widgets-miles_radius_spin = gtk_spin_button_new ( GTK_ADJUSTMENT(gtk_adjustment_new( 2, 0, 100, 1, 20, 1 )), 10, 1 );
 
   vik_coord_to_latlon ( vik_viewport_get_center(vvp), ll );
   s_ll = g_strdup_printf(%f,%f, ll.lat, ll.lon );
@@ -235,14 +238,19 @@ static void datasource_gc_get_cmd_string ( datasource_gc_widgets_t *widgets, gch
   // 3. Converts webpages into a single waypoint file, ignoring zero location waypoints '-z'
   //   Probably as they are premium member only geocaches and user is only a basic member
   //  Final output is piped into GPSbabel - hence removal of *html is done at beginning of the command sequence
-  *cmd = g_strdup_printf( rm -f ~/.geo/caches/*html ; %s -P -n%d -r%.1fM -u %s -p %s %.4f %.4f ; %s -z ~/.geo/caches/*html ,
+  //  *cmd = g_strdup_printf( rm -f ~/.geo/caches/*html ; %s -P -n%d -r%.1fM -u %s -p %s %.4f %.4f ; %s -z ~/.geo/caches/*html ,
+
+  // Geotoad limits per page - not sure how many per page ATM pick 10 as something close...
+  gint number = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(widgets-num_spin) );
+  // ATM I can't see how (if it even can) output to stdout :(
+  *cmd = g_strdup_printf( %s -L %d -y %.1f -u %s -p %s -q coord \%.4f %.4f\ -o /tmp/geotoad$$ ; cat /tmp/geotoad$$,