Re: [QGIS-Developer] shp file from /tmp file are seen as memory-layers?

2019-12-03 Thread Alessandro Pasotti
On Tue, Dec 3, 2019 at 10:58 AM Richard Duivenvoorde 
wrote:

> On 03/12/2019 09.50, Nyall Dawson wrote:
> >> Is this by design? Or is it a bug because there is 'tmp' in the path?
> >> I tested also to put it in ~/tmp but then it is OK...
>
> > By design -- it was added because many of the processing providers
> > which rely on 3rd party utilities (e.g. grass, saga) put temporary
> > outputs there, and users weren't getting any warnings that these are
> > just temporary. Basically the warning which previously showed only for
> > memory layers has been extended to include anything inside the
> > operating system's temporary folder (i.e. /tmp, but not ~/tmp on
> > Linux).
>
> Ah, thanks Nyall. I understand the reasoning, and agree...
>
> Though it does not feel as perfect yet:
>
> The memory tooltip of this layer says:
>  "Temporary Layer Only. Contents will be discarded after closing QGIS"
> But compared to a real memory layer, it is still there if you reopen the
> project (or quit/open QGIS).
> So it seems we mix two concepts?
>
> Thinking out loud here, I know this will all cost time/energy, so I
> understand if this is ignored...
>
> What about leaving out the 'memory' icon, and only warn users IF they
> have layers in temporary places? And instead of:
> "This project includes one or more temporary layers. These layers are
> not permanently saved and their contents will be lost. Are you sure you
> want to proceed?"
> Something like:
> "This project includes one or more layers which are saved in temporary
> directories". If you want to keep that data, please save or copy the
> data to non-temporary dirs" ?
>
> Or as bonus: maybe thing of some icon for these processing output
> layers: maybe the little 'gear'-icon we use for processing?
> In the case of a processing output I will then see the little gear icons
> (AND get the warning).
> In my usecase I will only get the warning (and I will ignore it :-) )
>
> As said: I understand there are probably more important things to do,
> just wanted to think about it a little...
>
> Regards,
>
> Richard Duivenvoorde
>
>
Hi Richard,

I agree with you that in-memory layer and file-based layers stored in
temporary folders are two different things and we should try to not mix the
concepts.

>From a UX perspective they both deserve a warning/icon that reminds the
user that they will be eventually lost if not action is taken, we just need
to make sure that the user understands the difference.

I'd open a question dialog in both cases when the layers are unloaded but I
would choose a (slightly?) different icon to mark the memory and tmp layers
and certainly a different tooltip message.


Cheers


-- 
Alessandro Pasotti
w3:   www.itopen.it
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] shp file from /tmp file are seen as memory-layers?

2019-12-03 Thread Richard Duivenvoorde
On 03/12/2019 09.50, Nyall Dawson wrote:
>> Is this by design? Or is it a bug because there is 'tmp' in the path?
>> I tested also to put it in ~/tmp but then it is OK...

> By design -- it was added because many of the processing providers
> which rely on 3rd party utilities (e.g. grass, saga) put temporary
> outputs there, and users weren't getting any warnings that these are
> just temporary. Basically the warning which previously showed only for
> memory layers has been extended to include anything inside the
> operating system's temporary folder (i.e. /tmp, but not ~/tmp on
> Linux).

Ah, thanks Nyall. I understand the reasoning, and agree...

Though it does not feel as perfect yet:

The memory tooltip of this layer says:
 "Temporary Layer Only. Contents will be discarded after closing QGIS"
But compared to a real memory layer, it is still there if you reopen the
project (or quit/open QGIS).
So it seems we mix two concepts?

Thinking out loud here, I know this will all cost time/energy, so I
understand if this is ignored...

What about leaving out the 'memory' icon, and only warn users IF they
have layers in temporary places? And instead of:
"This project includes one or more temporary layers. These layers are
not permanently saved and their contents will be lost. Are you sure you
want to proceed?"
Something like:
"This project includes one or more layers which are saved in temporary
directories". If you want to keep that data, please save or copy the
data to non-temporary dirs" ?

Or as bonus: maybe thing of some icon for these processing output
layers: maybe the little 'gear'-icon we use for processing?
In the case of a processing output I will then see the little gear icons
(AND get the warning).
In my usecase I will only get the warning (and I will ignore it :-) )

As said: I understand there are probably more important things to do,
just wanted to think about it a little...

Regards,

Richard Duivenvoorde


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] shp file from /tmp file are seen as memory-layers?

2019-12-03 Thread Nyall Dawson
On Tue, 3 Dec 2019 at 18:43, Richard Duivenvoorde  wrote:
>
> Hi,
>
> Wanting to test something temporarily, I copy an (arbitrary) shp file to
> my /tmp dir (on Linux).
>
> I open the shp file (via the Data Source Manager) and browse/open the
> shp in the /tmp dir.
>
> The shp opens fine, BUT in the layermanager I see the little 'memory'
> icon, as if this is a memory layer??
>
> Also: if I try to close the project (after or before saving it), I get
> the warning "This project includes one or more temporary layers. These
> layers are not permanently saved and their contents will be lost. Are
> you sure you want to proceed?"
>
> Strangely, if I reopen a saved project, the shp (as memory layer) is
> opened fine.
>
> BUT... these are not really temporary layers.. these are real shapes
> (well, in my /tmp dir, but... as long as I do not restart they are there
> and should work... I think).
>
> Is this by design? Or is it a bug because there is 'tmp' in the path?
> I tested also to put it in ~/tmp but then it is OK...

By design -- it was added because many of the processing providers
which rely on 3rd party utilities (e.g. grass, saga) put temporary
outputs there, and users weren't getting any warnings that these are
just temporary. Basically the warning which previously showed only for
memory layers has been extended to include anything inside the
operating system's temporary folder (i.e. /tmp, but not ~/tmp on
Linux).

Nyall


>
> Regards,
>
> Richard Duivenvoorde
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer