[Thuban-list] Re: adding layers

Bernhard Herzog bh at intevation.de
Thu Aug 21 12:24:20 CEST 2003

Jonathan Coles <jonathan at jpcoles.com> writes:

> On Wed, 2003-08-20 at 16:15, Jan-Oliver Wagner wrote:
>> On Wed, Aug 20, 2003 at 01:15:58PM -0400, Fidel Serrano wrote:
>> > when adding layers to a sesion, the open file dialog starts allways
>> > in the same folder (my documents for example), it is posible,
>> > modifing the style of the file dialog to make it remember the
>> > folder from where you got the previus layer archive...
>> I will look into this to see whether we get it into the 0.9 release
>> (though it is being finalized these days).

I for one probably won't have time.

> This may be as easy as setting the wxCHANGE_DIR flag in the constructor
> of wxFileDialog.

IMO that's the wrong approach. An application should never change the
current working directory because the interpretation of relative
filenames changes which can lead to all kinds of subtle bugs. Thuban
makes sure in several places that it does have absolute filenames but
there may be places where it doesn't do that.

A better way is to simply remember the directory of the last file opened
and pass that as the default directory to the dialog. Then you could
also remember different directories for different purposes, e.g. one for
.thuban files, one for shapefiles, one for projection files, etc.


Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
Thuban                                  http://thuban.intevation.org/

More information about the Thuban-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)