[Cuis-dev] Preferennce save/load and actionMap

Hilaire Fernandes hilaire at drgeo.eu
Thu May 5 12:28:47 PDT 2022


Hi,

When saved then loaded, the preferences installed with event listener 
lost the event listener:

PreferenceNG initialize.
(PreferenceNG instanceAt: #guiElementsSize ) actionMap
==> an 
IdentityDictionary(#preferenceChanged->WeakMessageSend(#defaultFontSize: 
-> PreferenceNG) )

PreferenceNG saveAllTo: '/tmp/pref' asFileEntry.
PreferenceNG loadFrom: '/tmp/pref' asFileEntry.

(PreferenceNG instanceAt: #guiElementsSize ) actionMap
==> nil

To save all the preference, I use a naive:

PreferenceNG>>saveAllTo: aFileEntry
" Save all the preferences to a file "
     SmartRefStream dumpOnFile: aFileEntry object: ThePreferences

To load, the counter part:

PreferenceNG>>loadFrom: aFileEntry
" Load all preferences from file, it replaces entirely the existing 
preferences "
     ThePreferences _ SmartRefStream restoreFromFile: aFileEntry

This is not surprise as the actionMap is stored in another object, the 
class ActiveModel.

I have some ideas to solve the problem but I am interested to read other 
ideas.

Thanks

Hilaire

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220505/4d0b2701/attachment.htm>


More information about the Cuis-dev mailing list