grass-svn2git / grass-issues-test

0 stars 0 forks source link

Save current working directory in wxGUI workspace and use it #31

Open grass-svn2git opened 5 years ago

grass-svn2git commented 5 years ago

Reported by @wenzeslaus on 6 Jun 2018 14:28 UTC When user changes current working directory in GUI, saves workspace, and reopens the same workspace, everything is there (especially after we have https://trac.osgeo.org/grass/ticket/2604) but the current working directory is the system default.

The current working directory should be stored in the workspace and then applied when starting.

It is not clear to me if only the GUI work dir should be changed or if also the command line should be changed (if it is during startup, it should be possible to change it for command line as well - considering that we need to read the workspace file for https://trac.osgeo.org/grass/ticket/2604).

Migrated-From: https://trac.osgeo.org/grass/ticket/3573

grass-svn2git commented 5 years ago

Comment by @mlennert on 6 Jun 2018 14:49 UTC Replying to [ticket:3573 wenzeslaus]:

When user changes current working directory in GUI, saves workspace, and reopens the same workspace, everything is there (especially after we have https://trac.osgeo.org/grass/ticket/2604) but the current working directory is the system default.

The current working directory should be stored in the workspace and then applied when starting.

It is not clear to me if only the GUI work dir should be changed or if also the command line should be changed (if it is during startup, it should be possible to change it for command line as well - considering that we need to read the workspace file for https://trac.osgeo.org/grass/ticket/2604).

I have to admin that I never even noticed that we had this option. I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS ? In the GUI I understand it to mean the directory that is opened by default in any file system widgets. Does it have any other effect ?

grass-svn2git commented 5 years ago

Comment by @wenzeslaus on 6 Jun 2018 17:26 UTC Replying to [comment:1 mlennert]:

I have to admin that I never even noticed that we had this option.

Accessible from Setting or using cd command in the Console tab (you basically get some consistency between terminal and Console tab).

I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS?

It means just the same thing it means in the command line. Every program has current working directory (or whatever we want to call it). cd and $PWD or pwd in Linux command line, os.getcwd() and os.chdir() in Python.

In the GUI I understand it to mean the directory that is opened by default in any file system widgets.

Right. (At least that's how it works on Linux.) I usually forget about this behavior. This might be nice for some users and strange (but not necessarily confusing) to some others.

Does it have any other effect?

You can put all your files for import and all color tables for one project into one directory (and perhaps subdirs) and then just cd there and you don't need to use full path just a relative one. I guess that's clear, but the point is that it applies for terminal as well as the GUI Console tab. It is also advantageous when people are following commands in a list of instructions - you need to deal with specifying the path just once (and the exported files will be in the directory set at the beginning).

grass-svn2git commented 5 years ago

Comment by @wenzeslaus on 6 Jun 2018 17:27 UTC I meant to link https://trac.osgeo.org/grass/ticket/3575 not https://trac.osgeo.org/grass/ticket/2604 although that's also related.

grass-svn2git commented 5 years ago

Comment by @mlennert on 7 Jun 2018 08:05 UTC Replying to [comment:2 wenzeslaus]:

Replying to [comment:1 mlennert]:

I have to admin that I never even noticed that we had this option.

Accessible from Setting or using cd command in the Console tab (you basically get some consistency between terminal and Console tab).

I don't know what you mean by consistency, but when I cd in the console this (obviously) has no impact on the terminal pwd.

I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS?

It means just the same thing it means in the command line. Every program has current working directory (or whatever we want to call it). cd and $PWD or pwd in Linux command line, os.getcwd() and os.chdir() in Python.

Yes, but here we have to be careful to be clear that when we say "program", we mean the GUI, not any GRASS module launched from anywhere.

In the GUI I understand it to mean the directory that is opened by default in any file system widgets.

Right. (At least that's how it works on Linux.) I usually forget about this behavior. This might be nice for some users and strange (but not necessarily confusing) to some others.

It is very nice, as I've had situations where I had to save multiple image versions of the GUI screen into one directory and had to navigate to that directory each time. Now I know that I can cd into that directory in the console and thus make it the GUI's pwd. :-)

Does it have any other effect?

You can put all your files for import and all color tables for one project into one directory (and perhaps subdirs) and then just cd there and you don't need to use full path just a relative one. I guess that's clear, but the point is that it applies for terminal as well as the GUI Console tab.

I don't know what you mean by "it applies" ? How ? IIUC your ticket, you are pleading for that it should ? But this would only be for the situation where the pwd is stored in a workspace, or ?

It is also advantageous when people are following commands in a list of instructions - you need to deal with specifying the path just once (and the exported files will be in the directory set at the beginning).

But you have to be very careful to make sure that all commands are executed either only in the console/GUI or only in the terminal...

grass-svn2git commented 5 years ago

Comment by @wenzeslaus on 7 Jun 2018 16:11 UTC Replying to [comment:4 mlennert]:

Replying to [comment:2 wenzeslaus]:

Replying to [comment:1 mlennert]:

I have to admin that I never even noticed that we had this option.

Accessible from Setting or using cd command in the Console tab (you basically get some consistency between terminal and Console tab).

I don't know what you mean by consistency, but when I cd in the console this (obviously) has no impact on the terminal pwd.

Consistency in that the directory can be changed both for terminal and for the Console in GUI.

I find this a bit weird, first of all because I don't know what the "current working directory" actually means in GRASS GIS?

It means just the same thing it means in the command line. Every program has current working directory (or whatever we want to call it). cd and $PWD or pwd in Linux command line, os.getcwd() and os.chdir() in Python.

Yes, but here we have to be careful to be clear that when we say "program", we mean the GUI, not any GRASS module launched from anywhere.

That's definitively something we could improve: putting it to a better place in menu, giving a better message when the change happens, ...

Does it have any other effect?

You can put all your files for import and all color tables for one project into one directory (and perhaps subdirs) and then just cd there and you don't need to use full path just a relative one. I guess that's clear, but the point is that it applies for terminal as well as the GUI Console tab.

I don't know what you mean by "it applies" ? How ? IIUC your ticket, you are pleading for that it should ? But this would only be for the situation where the pwd is stored in a workspace, or ?

The functionality to change the directory is already in GUI, so the benefits of it apply to GUI Console as well as terminal (where is it natively).

This ticket is just for the storing and loading from workspace.

It is also advantageous when people are following commands in a list of instructions - you need to deal with specifying the path just once (and the exported files will be in the directory set at the beginning).

But you have to be very careful to make sure that all commands are executed either only in the console/GUI or only in the terminal...

I switch between them all the time, but I don't see beginners doing that.

grass-svn2git commented 5 years ago

Comment by @wenzeslaus on 17 Sep 2018 03:53 UTC The triplet database/location/mapset is now (v7.7) saved in the workspace (https://trac.osgeo.org/grass/ticket/3575). Adding also directory would give the user by opening a workspace the full previously set state in relation to access to data (GRASS maps and general files).