[GRASS-SVN] r30156 - in grass/trunk: general/g.gui gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 14 15:24:53 EST 2008


Author: hamish
Date: 2008-02-14 15:24:53 -0500 (Thu, 14 Feb 2008)
New Revision: 30156

Modified:
   grass/trunk/general/g.gui/main.c
   grass/trunk/gui/wxpython/wxgui
Log:
g.gui updates

Modified: grass/trunk/general/g.gui/main.c
===================================================================
--- grass/trunk/general/g.gui/main.c	2008-02-14 19:26:09 UTC (rev 30155)
+++ grass/trunk/general/g.gui/main.c	2008-02-14 20:24:53 UTC (rev 30156)
@@ -51,24 +51,24 @@
 	type->answer = "tcltk";
     }
 
-    rc_file = G_define_option();
-    rc_file->key = "rc";
-    rc_file->type = TYPE_STRING;
+    rc_file = G_define_standard_option(G_OPT_F_INPUT);
+    rc_file->key = "workspace";
     rc_file->required = NO;
-    rc_file->description = _("Name of manager settings file (.grc)");
+    rc_file->description = _("Name of workspace file");
 
     oneoff = G_define_flag();
     oneoff->key         = 'u';
-    oneoff->description = _("Do not modify default GUI setting");
+    oneoff->description = _("Update default GUI setting");
 
     if (argc > 1 && G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    if (gui_type_env && !oneoff->answer) {
-	if (strcmp(gui_type_env, type->answer) != 0) {
-	    G_message(_("<%s> is now the default GUI"), type->answer);
-	    G_setenv("GRASS_GUI", type->answer);
-	}
+
+    if ( ( (gui_type_env && oneoff->answer) &&
+	    strcmp(gui_type_env, type->answer) != 0 ) || !gui_type_env ) {
+	G_message(_("<%s> is now the default GUI"), type->answer);
+	G_setenv("GRASS_GUI", type->answer);
+
     }
 
     if (strcmp(type->answer, "oldtcltk") == 0) {
@@ -89,7 +89,7 @@
     }
     else if (strcmp(type->answer, "wxpython") == 0) {
 	if (rc_file->answer) {
-	    G_spawn("wxgui", "dmrc=%s", rc_file->answer, NULL);
+	    G_spawn("wxgui", "workspace=%s", rc_file->answer, NULL);
 	}
 	else {
 	    G_system("wxgui");

Modified: grass/trunk/gui/wxpython/wxgui
===================================================================
--- grass/trunk/gui/wxpython/wxgui	2008-02-14 19:26:09 UTC (rev 30155)
+++ grass/trunk/gui/wxpython/wxgui	2008-02-14 20:24:53 UTC (rev 30156)
@@ -5,7 +5,7 @@
 #%  keywords: general, gui
 #% End
 #%option
-#% key: dmrc
+#% key: workspace
 #% type: string
 #% description: Name of Layer Manager settings file (.grc)
 #% required : no
@@ -25,9 +25,9 @@
   exec g.parser "$0" "$@"
 fi
 
-if test -n "$GIS_OPT_DMRC" ; then
+if test -n "$GIS_OPT_WORKSPACE" ; then
     # load workspace file
-    python "$GISBASE/etc/wxpython/wxgui.py" "--workspace" "$GIS_OPT_DMRC" &
+    python "$GISBASE/etc/wxpython/wxgui.py" "--workspace" "$GIS_OPT_WORKSPACE" &
 else
     python "$GISBASE/etc/wxpython/wxgui.py" &
 fi



More information about the grass-commit mailing list