Modify

Opened 10 years ago

Closed 10 years ago

#12417 closed defect (fixed)

[patch] mapmodes did not listen to preferences change

Reported by: kolesar Owned by: team
Priority: normal Milestone: 16.02
Component: Core Version:
Keywords: Cc:

Description

Some mapmodes cached preferences by their readPreferences() method and did not refresh them later. Some of them called this method on entering mode but it is not enough. When a user changes a setting of a tool it is usually active already. Therefore mapmodes should update their cached preferences on preference change.

I have modified MapMode to be PreferenceChangedListener. Also modified readPreferences() method in the affected mapmodes from private to protected for overriding.

Splinex plugin was also affected, attached a separate patchfile.

Attachments (3)

MapModePreferenceChangedListener.patch (5.0 KB ) - added by kolesar 10 years ago.
SplinexMapModeOverride.patch (1.0 KB ) - added by kolesar 10 years ago.
MapModePreferenceChangedListener.2.patch (5.1 KB ) - added by kolesar 10 years ago.

Download all attachments as: .zip

Change History (8)

by kolesar, 10 years ago

comment:1 by bastiK, 10 years ago

The inactive mapmodes need not be on alert all the time. Why not register PreferenceChangedListener & fire readPreferences on enterMode and unregister on exitMode?

comment:2 by kolesar, 10 years ago

Great idea, thanks. I will update patch soon.

comment:3 by kolesar, 10 years ago

This action opens the relation that was closed last time. It works as an undo for closing relation editor. Similar to History / Recently closed windows / <first entry> Ctrl+Shift+T in web browsers.

I did not want to complicate existing Edit button and popping up last closed seemed to be a good trade-off. I will update this patch to remember a list of recently closed relations and shortcut will pop up first entry. This way shortcut can be pressed repeatedly, similar to browser tabs.

Version 0, edited 10 years ago by kolesar (next)

comment:4 by Don-vip, 10 years ago

Milestone: 16.02

comment:5 by Don-vip, 10 years ago

Resolution: fixed
Status: newclosed

In 9572/josm:

fix #12417 - mapmodes did not listen to preferences change (patch by kolesar)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.