Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2016-01-06 Thread Russ Nelson
Holger Mappt writes:
 > If we never ask for confirmations then you would be able to quit JOSM 
 > while it has modified data.

Indeed, and you'll get the notice about having modified data before
JOSM quits.

The whole point of this is to avoid the "oh crap I just discarded my
edits" moment. When people make that mistake, they usually realize it
within 30 seconds. The trouble is that if you give them the option of
discarding their data, they will take it!

-- 
--my blog is athttp://blog.russnelson.com
Crynwr supports open source software
521 Pleasant Valley Rd. | +1 315-600-8815
Potsdam, NY 13676-3213  | Sheepdog   

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2016-01-02 Thread Holger Mappt
If we never ask for confirmations then you would be able to quit JOSM 
while it has modified data. There can be no notice about saved changes 
at that point. The earliest time to display that notice would be the 
next JOSM start. But the data might have changed on the server in the 
meantime. In the worst case all your edits are worthless because you get 
too many conflicts. To undo the changesets that cause the conflicts is 
not an option.


I agree with you on the conceptional level, but I don't see how it can 
be implemented in a sensible way.



On 2016-01-01 at 21:37 +0100 Russ Nelson wrote:

Never ask for confirmations. It's never the right thing to do unless
you're very short of resources, which we never are these days.

Instead, provide an undo of a layer delete. When they ask to delete a
layer that has changes in it, simply delete it, and pop up a
non-confirmation notice that says "This layer has changes and may be
restored using File/Open Recent".

The problem with a confirmation is that it *really* deletes the data,
which may be the wrong thing. If you're ever at a confirmation point,
clearly somebody might not be thinking correctly, and their answer to
the confirmation might *also* be wrong.

Undo, undo, undo! Never confirm!


___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2016-01-02 Thread Martin Koppenhoefer


sent from a phone

> Am 01.01.2016 um 21:37 schrieb Russ Nelson :
> 
> Never ask for confirmations. It's never the right thing to do unless
> you're very short of resources, which we never are these days.


that's not exactly true, you can always come to the limits, especially when 
working with big datasets like geodata (or think people with outdated machines, 
e.g. in the developing world or in schools).

If you notice you are caching to the disk and try to free up some space by 
deleting a layer, the last thing you'd want is your app copying the layer to an 
undo stack.

cheers,
Martin 
___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2016-01-01 Thread Russ Nelson
Never ask for confirmations. It's never the right thing to do unless
you're very short of resources, which we never are these days.

Instead, provide an undo of a layer delete. When they ask to delete a
layer that has changes in it, simply delete it, and pop up a
non-confirmation notice that says "This layer has changes and may be
restored using File/Open Recent".

The problem with a confirmation is that it *really* deletes the data,
which may be the wrong thing. If you're ever at a confirmation point,
clearly somebody might not be thinking correctly, and their answer to
the confirmation might *also* be wrong.

Undo, undo, undo! Never confirm!

Holger Mappt writes:
 > Hi,
 > 
 > See https://josm.openstreetmap.de/ticket/12075.
 > The idea is to ask for confirmation if a GeoImageLayer with modified 
 > image properties is deleted.  What is the best/right way to do that?
 > 
 > The AbstractModifiableLayer seems to serve that purpose.  GeoImageLayer 
 > could extend AbstractModifiableLayer instead of Layer.  But there is not 
 > a single file associated with the layer but one file per modified image. 
 >   There is not really a "recommended action" for the SaveLayersDialog. 
 > The AbstractModifiableLayer would need to be extended to have something 
 > like isAbleToUploadToServer() and isAbleToSaveToFile() to disable the 
 > according check-boxes of the SaveLayersDialog.  The logic in 
 > Main.saveUnsavedModifications() would need to be changed to consider the 
 > layer if neither requiresSaveToFile() nor requiresUploadToServer() 
 > returns true.  Would it make sense to add something like 
 > requiresSomeAction() to AbstractModifiableLayer and 
 > Main.saveUnsavedModifications()?  The "action" could be a string that is 
 > displayed in the SaveLayersDialog.
 > 
 > Thanks,
 > Holger
 > 
 > ___
 > josm-dev mailing list
 > josm-dev@openstreetmap.org
 > https://lists.openstreetmap.org/listinfo/josm-dev

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2015-12-31 Thread Holger Mappt

Hi Vincent,

The idea behind requiresSomeAction() was to display a message like "use 
the layer context menu to store modified data" to tell the user that 
there is more than "save session", "delete/exit now", and "cancel". 
Kind of an "other ways to handle modified data" information in the 
SaveLayersDialog.  Just as information, not as real Java action.  But it 
might be too much information at that place.


Should I prepare a patch or just create a ticket?

Holger

On 2015-12-30 at 19:08 +0100 Vincent Privat wrote:

isAbleToUploadToServer() and isAbleToSaveToFile() sound fine.

Concerning the "action" string I don't know: what would you propose as
action in your case?

2015-12-28 16:44 GMT+01:00 Holger Mappt:

Would it make sense to add something like requiresSomeAction() to
AbstractModifiableLayer and Main.saveUnsavedModifications()?  The "action"
could be a string that is displayed in the SaveLayersDialog.



___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2015-12-31 Thread Vincent Privat
A ticket with a patch? :)

2015-12-31 16:47 GMT+01:00 Holger Mappt :

> Hi Vincent,
>
> The idea behind requiresSomeAction() was to display a message like "use
> the layer context menu to store modified data" to tell the user that there
> is more than "save session", "delete/exit now", and "cancel". Kind of an
> "other ways to handle modified data" information in the SaveLayersDialog.
> Just as information, not as real Java action.  But it might be too much
> information at that place.
>
> Should I prepare a patch or just create a ticket?
>
> Holger
>
> On 2015-12-30 at 19:08 +0100 Vincent Privat wrote:
>
>> isAbleToUploadToServer() and isAbleToSaveToFile() sound fine.
>>
>> Concerning the "action" string I don't know: what would you propose as
>> action in your case?
>>
>> 2015-12-28 16:44 GMT+01:00 Holger Mappt:
>>
>>> Would it make sense to add something like requiresSomeAction() to
>>> AbstractModifiableLayer and Main.saveUnsavedModifications()?  The
>>> "action"
>>> could be a string that is displayed in the SaveLayersDialog.
>>>
>>
>
___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] How to ask for confirmation at layer deletion or exit?

2015-12-30 Thread Vincent Privat
isAbleToUploadToServer() and isAbleToSaveToFile() sound fine.

Concerning the "action" string I don't know: what would you propose as
action in your case?

2015-12-28 16:44 GMT+01:00 Holger Mappt :

> Hi,
>
> See https://josm.openstreetmap.de/ticket/12075.
> The idea is to ask for confirmation if a GeoImageLayer with modified image
> properties is deleted.  What is the best/right way to do that?
>
> The AbstractModifiableLayer seems to serve that purpose.  GeoImageLayer
> could extend AbstractModifiableLayer instead of Layer.  But there is not a
> single file associated with the layer but one file per modified image.
> There is not really a "recommended action" for the SaveLayersDialog. The
> AbstractModifiableLayer would need to be extended to have something like
> isAbleToUploadToServer() and isAbleToSaveToFile() to disable the according
> check-boxes of the SaveLayersDialog.  The logic in
> Main.saveUnsavedModifications() would need to be changed to consider the
> layer if neither requiresSaveToFile() nor requiresUploadToServer() returns
> true.  Would it make sense to add something like requiresSomeAction() to
> AbstractModifiableLayer and Main.saveUnsavedModifications()?  The "action"
> could be a string that is displayed in the SaveLayersDialog.
>
> Thanks,
> Holger
>
> ___
> josm-dev mailing list
> josm-dev@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/josm-dev
>
___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


[josm-dev] How to ask for confirmation at layer deletion or exit?

2015-12-28 Thread Holger Mappt

Hi,

See https://josm.openstreetmap.de/ticket/12075.
The idea is to ask for confirmation if a GeoImageLayer with modified 
image properties is deleted.  What is the best/right way to do that?


The AbstractModifiableLayer seems to serve that purpose.  GeoImageLayer 
could extend AbstractModifiableLayer instead of Layer.  But there is not 
a single file associated with the layer but one file per modified image. 
 There is not really a "recommended action" for the SaveLayersDialog. 
The AbstractModifiableLayer would need to be extended to have something 
like isAbleToUploadToServer() and isAbleToSaveToFile() to disable the 
according check-boxes of the SaveLayersDialog.  The logic in 
Main.saveUnsavedModifications() would need to be changed to consider the 
layer if neither requiresSaveToFile() nor requiresUploadToServer() 
returns true.  Would it make sense to add something like 
requiresSomeAction() to AbstractModifiableLayer and 
Main.saveUnsavedModifications()?  The "action" could be a string that is 
displayed in the SaveLayersDialog.


Thanks,
Holger

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev