瀏覽代碼

update display modules to https://trac.osgeo.org/grass/changeset/63747 (no need to check return code of D_open_driver()) - part 2

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63758 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 年之前
父節點
當前提交
086eeeb158

+ 2 - 3
display/d.colortable/main.c

@@ -134,9 +134,8 @@ int main(int argc, char **argv)
 	G_fatal_error(_("Color file for <%s> not available"), map_name);
     if (Rast_read_fp_range(map_name, "", &fp_range) == -1)
 	G_fatal_error(_("Range file for <%s> not available"), map_name);
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    
+    D_open_driver();
 
     D_setup_unity(0);
     D_get_src(&t, &b, &l, &r);

+ 1 - 3
display/d.font/main.c

@@ -81,9 +81,7 @@ int main(int argc, char **argv)
 	exit(EXIT_FAILURE);
 
     /* load the font */
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
 
     if (flag1->answer) {	/* List font names */
 	print_font_list(stdout, 0);

+ 1 - 3
display/d.geodesic/main.c

@@ -84,9 +84,7 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("%s - illegal longitude"), parm.coor->answers[3]);
 
 
-    if (D_open_driver() != 0)
-      	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     line_color = D_translate_color(parm.lcolor->answer);
     if (!line_color)

+ 1 - 3
display/d.grid/main.c

@@ -249,9 +249,7 @@ int main(int argc, char **argv)
     }
 
     /* Setup driver and check important information */
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     /* Parse and select grid color */
     colorg = D_parse_color(opt1->answer, FALSE);

+ 1 - 3
display/d.histogram/main.c

@@ -180,9 +180,7 @@ int main(int argc, char **argv)
 
     /* set up the graphics driver and initialize its color-table */
 
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     D_setup_unity(0);			/* 0 = don't clear frame */
     D_get_src(&t, &b, &l, &r);

+ 1 - 3
display/d.labels/main.c

@@ -113,9 +113,7 @@ int main(int argc, char **argv)
     if (infile == NULL)
 	G_fatal_error(_("Unable to open label file <%s>"), label_name);
 
-    if (D_open_driver() != 0)
-      	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     D_setup(0);
 

+ 1 - 3
display/d.linegraph/main.c

@@ -264,9 +264,7 @@ int main(int argc, char **argv)
     }
 
     /* get coordinates of current screen window, in pixels */
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     D_setup_unity(0);
     D_get_src(&t, &b, &l, &r);

+ 2 - 3
display/d.mon/start.c

@@ -22,9 +22,8 @@ void start(const char *name, const char *output)
     G_add_error_handler(error_handler, (char *)name);
     
     if (!output) {
-        if (D_open_driver() != 0)
-            G_fatal_error(_("No graphics device selected. "
-                            "Use d.mon to select graphics device."));
+        D_open_driver();
+        
         output_name = D_get_file();
         if (!output_name) 
             return;

+ 1 - 3
display/d.path/main.c

@@ -150,9 +150,7 @@ int main(int argc, char **argv)
 	G_fatal_error(_("%s - illegal y value"), coor_opt->answers[3]);
 
 
-    if (D_open_driver() != 0)
-      	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     color = G_standard_color_rgb(BLACK);
     if (G_str_to_color(color_opt->answer, &r, &g, &b)) {

+ 1 - 3
display/d.rast.num/main.c

@@ -217,9 +217,7 @@ int main(int argc, char **argv)
 
     /* Setup driver and check important information */
 
-    if (D_open_driver() != 0)
-      	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     if (opt.font->answer)
 	D_font(opt.font->answer);

+ 1 - 3
display/d.rast/main.c

@@ -93,9 +93,7 @@ int main(int argc, char **argv)
     overlay = !flag_n->answer;
     invert = flag_i->answer;
 
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
 
     fp = Rast_map_is_fp(name, "");
     if (vallist->answer) {

+ 1 - 3
display/d.rhumbline/main.c

@@ -84,9 +84,7 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("%s - illegal longitude"), parm.coor->answers[3]);
 
 
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     line_color = D_translate_color(parm.lcolor->answer);
     if (!line_color)

+ 1 - 3
display/d.thematic.area/main.c

@@ -362,9 +362,7 @@ int main(int argc, char **argv)
 
     if (!nodraw_flag->answer) {
 	/* Now's let's prepare the actual plotting */
-	if (D_open_driver() != 0)
-	    G_fatal_error(_("No graphics device selected. "
-			    "Use d.mon to select graphics device."));
+        D_open_driver();
 	
 	D_setup(0);
 

+ 1 - 3
display/d.vect.chart/main.c

@@ -244,9 +244,7 @@ int main(int argc, char **argv)
     if (ctype_opt->answer[0] == 'b')
 	ctype = CTYPE_BAR;
 
-    if (D_open_driver() != 0)
-	G_fatal_error(_("No graphics device selected. "
-			"Use d.mon to select graphics device."));
+    D_open_driver();
     
     /* should we plot the maximum reference on bar plots? */
     if (max_reference_opt->answer != NULL) {