Modify

Opened 5 years ago

Closed 5 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 5 years ago.
SplinexMapModeOverride.patch (1.0 KB) - added by kolesar 5 years ago.
MapModePreferenceChangedListener.2.patch (5.1 KB) - added by kolesar 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by kolesar

Changed 5 years ago by kolesar

comment:1 Changed 5 years ago by bastiK

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 Changed 5 years ago by kolesar

Great idea, thanks. I will update patch soon.

comment:3 Changed 5 years ago by kolesar

Attached new patch.

Last edited 5 years ago by kolesar (previous) (diff)

Changed 5 years ago by kolesar

comment:4 Changed 5 years ago by Don-vip

Milestone: 16.02

comment:5 Changed 5 years ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.