Opened 16 years ago

Closed 16 years ago

#500 closed enhancement (fixed)

GUI menu item to swtich GUIs

Reported by: hamish Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: Default Version: 6.4.0 RCs
Keywords: gui Cc:
CPU: All Platform: All

Description

Hi,

currently there is no easy way to switch the default GUI from a GUI.

e.g. from the native windows build you typically don't start from a command prompt so grass64 -wxpython isn't an easy option. If you know how you can do Config -> Settings -> GRASS working environment -> Change settings -> GRASS variable to set -> "GRASS_GUI=wxpython" in the GUI, but that's hardly something that someone could figure out on their own.

To make this easier, I've added a new flag to g.gui to update default GUI but do not launch it. (done in r35972, r35973)

The GUI menus would need to launch "g.gui -n --ui", or a wrapper fn for g.gui (bash/python template: 'g.gui --script') with the -nu flags hardcoded and only the type pulldown menu available. Then exit with a "you need to restart grass to see the effect" message.

Hamish

Change History (9)

comment:1 by hamish, 16 years ago

Hi,

I added a new g.change.gui wrapper script to develbr6 in r36027.

strangely it only works for me from the command line, which is not very helpful as it is intended to be used from the GUI menu.

?? Hamish

comment:2 by hamish, 16 years ago

further g.change.gui & added to devbr6 menus in r36030.

please test! (especially to/from wxPy gui where I haven't tested it at all)

note .grassrc6 file will only be updated when you exit GRASS cleanly, but g.gisenv setting will be updated immediately. (earlier strangeness was probably just me looking in the wrong place)

Hamish

comment:3 by hamish, 16 years ago

more weirdness, I can't change it from the d.m GUI or from the command prompt with --ui. But it works from from gis.m and the command line with an argument.

I just get a red "X" in the output tab.

?? Hamish

comment:4 by hamish, 16 years ago

back/ported to relbr64 and trunk in r36093, r36094; weirdness remains: I can't change it from the d.m GUI or from the command prompt with --ui using g.change.gui.sh. But it works fine from from gis.m and the command line with an argument.

In d.m I just get a red "X" in the output tab.

oh well, it works in d.m if I pass it plain g.gui instead of the simplified g.change.gui.sh wrapper script (done in r36095, r36096), and I doubt anyone will try $GISBASE/etc/gui/scripts/g.change.gui.sh very often from the CLI as "g.gui" is somewhat easier to type.

shrug. Hamish

comment:5 by hamish, 16 years ago

ah, I understand the g.parser weirdness now. The script is not in the path so it can't find itself when it goes to run the second pass.

I'll try a patch like:

if [ "$1" != "@ARGS_PARSED@" ] ; then
+   if [ ! -z `$0` ] ; then
+       PATH="$PATH:$GISBASE/etc/gui/scripts"
+       export PATH
+   fi
    exec g.parser "$0" "$@"
fi

(untested)

Hamish

comment:6 by hamish, 16 years ago

I tried the following patch, it seemed to work from the commandline with --ui, but still not from d.m.

Index: gui/scripts/g.change.gui.sh
===================================================================
--- gui/scripts/g.change.gui.sh (revision 36060)
+++ gui/scripts/g.change.gui.sh (working copy)
@@ -41,6 +41,11 @@
     exit 1
 fi
 
+if [ ! -x "`which $(basename "$0")`" ] ; then
+    PATH="$PATH:$GISBASE/etc/gui/scripts"
+    export PATH
+fi
+
 if [ "$1" != "@ARGS_PARSED@" ] ; then
     exec g.parser "$0" "$@"
 fi

???

Running it from the wxPython GUI still needs to be tested by someone please. Config -> Working enviro -> Change default GUI

Also, I was thinking it could be useful to add an entry after 'Help->About system' like 'Help->Show system environment' which would run "set" and dump the results to the Output window. It would help in debugging.

Hamish

comment:7 by cmbarton, 16 years ago

This works from the wxPython GUI--at least to switch to the current TclTK GIS manager. I haven't tested with old dm.

Tested on Mac OSX Intel.

Michael

comment:8 by hamish, 16 years ago

not working in the latest wingrass installer, see bug #553.

Hamish

comment:9 by hamish, 16 years ago

Resolution: fixed
Status: newclosed

it's not working on wingrass, but it's a generic Makefile problem.

closing this ticket as it's done.

H

Note: See TracTickets for help on using tickets.