Sfoglia il codice sorgente

d.vect: add flag to not put the layer in legend, see https://trac.osgeo.org/grass/ticket/3122

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69115 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 anni fa
parent
commit
ab48c77eb0
1 ha cambiato i file con 12 aggiunte e 4 eliminazioni
  1. 12 4
      display/d.vect/main.c

+ 12 - 4
display/d.vect/main.c

@@ -55,7 +55,7 @@ int main(int argc, char **argv)
     struct Option *width_opt, *wcolumn_opt, *wscale_opt;
     struct Option *leglab_opt;
     struct Option *icon_line_opt, *icon_area_opt;
-    struct Flag *id_flag, *cats_acolors_flag, *sqrt_flag;
+    struct Flag *id_flag, *cats_acolors_flag, *sqrt_flag, *legend_flag;
     char *desc;
     
     struct cat_list *Clist;
@@ -324,6 +324,11 @@ int main(int argc, char **argv)
 	  "instead of circle radius");
     sqrt_flag->guisection = _("Symbols");
 
+    legend_flag = G_define_flag();
+    legend_flag->key = 'l';
+    legend_flag->label = _("Do not add this layer to vector legend");
+    legend_flag->guisection = _("Legend");
+
     /* Check command line */
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
@@ -453,10 +458,13 @@ int main(int argc, char **argv)
 		stat += display_dir(&Map, type, Clist, chcat, size);
 	}
 
-	write_into_legfile(&Map, type, leglab_opt->answer, map_name,
-			   icon_opt->answer, size_opt->answer, color_opt->answer,
-			   fcolor_opt->answer, width_opt->answer, icon_area_opt->answer,
+	if (!legend_flag->answer) {
+		write_into_legfile(&Map, type, leglab_opt->answer, map_name,
+			   icon_opt->answer, size_opt->answer, 
+			   color_opt->answer, fcolor_opt->answer, 
+			   width_opt->answer, icon_area_opt->answer,
 			   icon_line_opt->answer);
+	}
 
 	/* reset line width: Do we need to get line width from display
 	 * driver (not implemented)?  It will help restore previous line