]> git.street.me.uk Git - andy/viking.git/blobdiff - src/datasource_bfilter.c
Add support for kml files.
[andy/viking.git] / src / datasource_bfilter.c
index 2fb1e6c46d912c699177f5b39584c0407e347e00..fb237496296b067ffd3055b229fb3afc6a3c581c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
  *
- * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
+ * Copyright (C) 2003-2007, Evan Battaglia <gtoevan@gmx.net>
  *
  * 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
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include <string.h>
+#include <glib/gi18n.h>
 
 #include "viking.h"
 #include "babel.h"
@@ -40,23 +43,31 @@ VikLayerParamScale simplify_params_scales[] = {
 };
 
 VikLayerParam bfilter_simplify_params[] = {
-  { "numberofpoints", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, "Max number of points:", VIK_LAYER_WIDGET_SPINBUTTON, simplify_params_scales + 0 },
+  { "numberofpoints", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Max number of points:"), VIK_LAYER_WIDGET_SPINBUTTON, simplify_params_scales, NULL },
 };
 
 VikLayerParamData bfilter_simplify_params_defaults[] = {
+  /* Annoyingly 'C' cannot initialize unions properly */
+  /* It's dependent on the standard used or the compiler support... */
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L || __GNUC__
+  { .i = 100 },
+#else
   { 100 },
+#endif
 };
 
 VikDataSourceInterface vik_datasource_bfilter_simplify_interface = {
-  "Simplify All Tracks",
-  "Simplified Tracks",
+  N_("Simplify All Tracks..."),
+  N_("Simplified Tracks"),
   VIK_DATASOURCE_SHELL_CMD,
   VIK_DATASOURCE_CREATENEWLAYER,
   VIK_DATASOURCE_INPUTTYPE_TRWLAYER,
+  TRUE,
   FALSE, /* keep dialog open after success */
   NULL, NULL, NULL,
   (VikDataSourceGetCmdStringFunc)      datasource_bfilter_simplify_get_cmd_string,
   NULL, NULL, NULL,
+  (VikDataSourceOffFunc) NULL,
 
   bfilter_simplify_params,
   sizeof(bfilter_simplify_params)/sizeof(bfilter_simplify_params[0]),
@@ -81,15 +92,17 @@ static void datasource_bfilter_dup_get_cmd_string ( VikLayerParamData *paramdata
 
 
 VikDataSourceInterface vik_datasource_bfilter_dup_interface = {
-  "Remove Duplicate Waypoints",
-  "Remove Duplicate Waypoints",
+  N_("Remove Duplicate Waypoints"),
+  N_("Remove Duplicate Waypoints"),
   VIK_DATASOURCE_SHELL_CMD,
   VIK_DATASOURCE_CREATENEWLAYER,
   VIK_DATASOURCE_INPUTTYPE_TRWLAYER,
+  TRUE,
   FALSE, /* keep dialog open after success */
   NULL, NULL, NULL,
   (VikDataSourceGetCmdStringFunc)      datasource_bfilter_dup_get_cmd_string,
   NULL, NULL, NULL,
+  (VikDataSourceOffFunc) NULL,
 
   NULL, 0, NULL, NULL, 0
 };
@@ -98,7 +111,7 @@ VikDataSourceInterface vik_datasource_bfilter_dup_interface = {
 static void datasource_bfilter_dup_get_cmd_string ( VikLayerParamData *paramdatas, gchar **cmd, gchar **input_file_type, const gchar *input_filename )
 {
   *input_file_type = NULL;
-  *cmd = g_strdup_printf ( "gpsbabel -i gpx -f %s -x dup,loc -o gpx -F -", input_filename );
+  *cmd = g_strdup_printf ( "gpsbabel -i gpx -f %s -x duplicate,location -o gpx -F -", input_filename );
 }
 
 
@@ -111,15 +124,17 @@ static void datasource_bfilter_polygon_get_cmd_string ( VikLayerParamData *param
 
 
 VikDataSourceInterface vik_datasource_bfilter_polygon_interface = {
-  "Waypoints Inside This",
-  "Polygonzied Layer",
+  N_("Waypoints Inside This"),
+  N_("Polygonized Layer"),
   VIK_DATASOURCE_SHELL_CMD,
   VIK_DATASOURCE_CREATENEWLAYER,
   VIK_DATASOURCE_INPUTTYPE_TRWLAYER_TRACK,
+  TRUE,
   FALSE, /* keep dialog open after success */
   NULL, NULL, NULL,
   (VikDataSourceGetCmdStringFunc)      datasource_bfilter_polygon_get_cmd_string,
   NULL, NULL, NULL,
+  (VikDataSourceOffFunc) NULL,
 
   NULL,
   0,
@@ -144,15 +159,17 @@ static void datasource_bfilter_exclude_polygon_get_cmd_string ( VikLayerParamDat
 
 
 VikDataSourceInterface vik_datasource_bfilter_exclude_polygon_interface = {
-  "Waypoints Outside This",
-  "Polygonzied Layer",
+  N_("Waypoints Outside This"),
+  N_("Polygonzied Layer"),
   VIK_DATASOURCE_SHELL_CMD,
   VIK_DATASOURCE_CREATENEWLAYER,
   VIK_DATASOURCE_INPUTTYPE_TRWLAYER_TRACK,
+  TRUE,
   FALSE, /* keep dialog open after success */
   NULL, NULL, NULL,
   (VikDataSourceGetCmdStringFunc)      datasource_bfilter_exclude_polygon_get_cmd_string,
   NULL, NULL, NULL,
+  (VikDataSourceOffFunc) NULL,
 
   NULL,
   0,