[Cuis-dev] Preferennce save/load and actionMap
Gerald Klix
cuis.01 at klix.ch
Thu May 5 13:13:34 PDT 2022
Just one thought before I go to bed:
Take a look at the senders of ActionMap>>#flushEventSystem.
HTH,
Gerald
On May 5 2022, at 10:07 pm, Luciano Notarfrancesco via Cuis-dev <cuis-dev at lists.cuis.st> wrote:
> You can avoid replacing the existing instances by iterating over the preferences you read from the file and setting their values on the existing prefeences.
>
> On Fri, 6 May 2022 at 2:28 AM Hilaire Fernandes via Cuis-dev <cuis-dev at lists.cuis.st (mailto:cuis-dev at lists.cuis.st)> wrote:
> > 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.euhttp://blog.drgeo.eu
> > --
> > Cuis-dev mailing list
> > Cuis-dev at lists.cuis.st (mailto:Cuis-dev at lists.cuis.st)
> > https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220505/269d9866/attachment.htm>
More information about the Cuis-dev
mailing list