I added this handy method to our library of common utils

https://github.com/qgis/pyqgis_wrappers/blob/master/parfait/gui.py#L24

It basically stores the path entered by the user, along with the
caller method, so the next time the user is prompted for files from
that same method, it remembers the last folder. That way, plugin users
just need to use this method instead of doing it the normal qt way,
and they do not have to worry about storing last paths.

The function to find out the caller method name uses introspection and is here:

https://github.com/qgis/pyqgis_wrappers/blob/master/parfait/utils.py#L7

Might need some improvements and testing, but the idea is there, in
case it might be useful

Cheers

2016-02-18 8:49 GMT+01:00 Nathan Woodrow <[email protected]>:
> Thanks Nyall.
>
> I didn't touch ftools and gdal tools because I had a feeling they would go
> away in future
>
>
> On Thu, 18 Feb 2016 5:41 pm Nyall Dawson <[email protected]> wrote:
>>
>>
>> On 18 Feb 2016 18:38, "Paolo Cavallini" <[email protected]> wrote:
>> >
>> > Hi all,
>> > a long standing issue in QGIS is the fact that several commands and core
>> > plugins (not to speak about external plugins) do not honour the "last
>> > used directory rule" for saving files. As a result, the behaviour is
>> > unpredictable and confusing.
>> > I would suggest:
>> > * do a thorough revision of the default destination dir for all commands
>> > (I hope this can be done programmatically)
>> > * maybe adding an option "Always save in the default output directory",
>> > just like the Download dir in Firefox
>> > * making this the default also for external plugins.
>> > Thoughts?
>> > All the best.
>>
>> Nathan did a huge amount of work on that front during this cycle. Do you
>> have specifics of any which don't behave correctly now?
>>
>> Also worth noting that Denis did some work implementing a reusable file
>> picked widget with correct handling for all this. We just need to switch
>> across all the various custom file pickers to this standard widget
>> (hopefully in 2.16?)
>>
>> Nyall
>>
>>
>> > --
>> > Paolo Cavallini - www.faunalia.eu
>> > QGIS & PostGIS courses: http://www.faunalia.eu/training.html
>> > _______________________________________________
>> > Qgis-developer mailing list
>> > [email protected]
>> > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> [email protected]
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> _______________________________________________
> Qgis-developer mailing list
> [email protected]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to