[GRASS-SVN] r32546 - in grass/trunk: gui/wxpython/gui_modules
raster/r.colors
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 5 16:58:03 EDT 2008
Author: martinl
Date: 2008-08-05 16:58:03 -0400 (Tue, 05 Aug 2008)
New Revision: 32546
Modified:
grass/trunk/gui/wxpython/gui_modules/toolbars.py
grass/trunk/raster/r.colors/main.c
Log:
wxGUI/vdigit: disable undo (fix first)
Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py 2008-08-05 19:49:40 UTC (rev 32545)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py 2008-08-05 20:58:03 UTC (rev 32546)
@@ -627,13 +627,16 @@
@param enable False for disable
"""
- if enable:
- if self.toolbar[0].GetToolEnabled(self.undo) is False:
- self.toolbar[0].EnableTool(self.undo, True)
- else:
- if self.toolbar[0].GetToolEnabled(self.undo) is True:
- self.toolbar[0].EnableTool(self.undo, False)
-
+ ### fix undo first...
+
+ # if enable:
+ # if self.toolbar[0].GetToolEnabled(self.undo) is False:
+ # self.toolbar[0].EnableTool(self.undo, True)
+ # else:
+ # if self.toolbar[0].GetToolEnabled(self.undo) is True:
+ # self.toolbar[0].EnableTool(self.undo, False)
+ pass
+
def OnSettings(self, event):
"""Show settings dialog"""
Modified: grass/trunk/raster/r.colors/main.c
===================================================================
--- grass/trunk/raster/r.colors/main.c 2008-08-05 19:49:40 UTC (rev 32545)
+++ grass/trunk/raster/r.colors/main.c 2008-08-05 20:58:03 UTC (rev 32546)
@@ -109,6 +109,7 @@
char *style, *cmap, *cmapset;
char *rules;
int fp;
+ FILE *rules_file;
struct GModule *module;
struct
{
@@ -237,6 +238,7 @@
cmap = opt.rast->answer;
rules = opt.rules->answer;
+ rules_file = NULL;
if (!name)
G_fatal_error(_("No map specified"));
@@ -244,11 +246,11 @@
G_fatal_error(_
("One of \"-i\" or \"-r\" or options \"color\", \"rast\" or \"rules\" must be specified!"));
- if (interactive && (style || rules || cmap))
+ if (interactive && ((strcmp(style, "rules") && rules) || cmap))
G_fatal_error(_
("Interactive mode is incompatible with \"color\", \"rules\", and \"raster\" options"));
- if ((style && (cmap || rules)) || (cmap && rules))
+ if ((strcmp(style, "rules") && (cmap || rules)) || (cmap && rules))
G_fatal_error(_
("\"color\", \"rules\", and \"raster\" options are mutually exclusive"));
@@ -313,7 +315,11 @@
(CELL) max);
}
else if (strcmp(style, "rules") == 0) {
- if (!read_color_rules(stdin, &colors, min, max, fp))
+ rules_file = fopen(rules, "r");
+ if (rules_file == NULL) {
+ G_fatal_error(_("Unable to open rules file <%s>"), rules);
+ }
+ if (!read_color_rules(rules_file, &colors, min, max, fp))
exit(EXIT_FAILURE);
}
else if (find_rule(style))
More information about the grass-commit
mailing list