Hi Andreas,
Now the problems of immediate changes after modifying a key could be
solved by adding changes listener on the m_xCfg root node.
Currently one problem: the listener couldn't be notified after the
m_xCfg has been renewed in the AcceleratorConfiguration::Reset().
Because when the configuration is only reopened , but no such
operations like setPropertyValue(), insert/removeByName()...so some
instances like svtools/acceleratorexecute couldn't be notified. Shall I
implement some methods like addResetListener/removeResetListener ?
Regards
Yan
Hello Andreas,
Currently I cannt see the immediate changes after clicking "Modify" or
"Reset" in the tabpage:Customize->Keyboard without shutdowning OOo. I
debugged this and found that:
e.g:
1)
change F2->About OpenOffice.org, click "OK".
The impl_ts_save/load(XNameAccess) will be triggered, and the KeyEvent
"KEY_F2" will be set to Command "About OpenOffice.org".
2)
then change F2->e.g.Edit Macros, click "OK".
3)
click "F2" in the keyboard,the impl_ts_save/load(XNameAccess) will not
be triggered and the ::getCommandByKey(KEY_F2) still returns "About
OpenOffice.org".
a) After impl_ts_load() all interface methods getXXX() works on read
cache ...
b) then the user calls it's first setXXX() method and he will do that
many times (without saving it changes immediately).
So we create a copy of read cache on demand and name it write cache.
The method impl_getCFG() capsulate that for you.
It returns a reference(!) to an internal member. But the caller of
impl_getCFG() does not know if he got the read or the write cache.
c) in impl_ts_save() we write the content of write cache back to the
configuration on disc and remove the member write cache.
Why so complicated ?
During runtime of OOo there exists more then one instance of
AcceleratorConfiguration ! Every menu hold one instance, every toolbar
hold one instance, the shortcut implementation itself holds its own
instance and so on. If every instance write its data directly to the
configuration on disc everytimes the user calls one setXXX() method
you will see those changes immediately on other documents or windows.
so the instances(m_aReadCache) of customizations dialogs and
svtools/AcceleraterExecute is different.?
since "KEY_F2" has been assigned to a new Command, and we defined the
Accelerators.xcs as Command-KEYs, so "KEY_F2" must be removed from the
original Command.?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]