Tutorial Start

From Apache OpenOffice Wiki
Revision as of 16:04, 28 December 2008 by Bobban (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Hack! Tutorial_Help

Hack what ? We would have to start with what's available to hack first :-)

In general, the functionality of the top-level projects is in-

sw - is the OpenOffice.org Writer
sc - is the OpenOffice.org Calc
sd - is the OpenOffice.org Impress and Draw

And where functionality is common for all these applications, it is usually held in one of the desktop, framework, svtools, svx, and sfx2 projects.

The objective of this hack is to attach a keyboard accelerator to the About Dialog, so similar to how Ctrl+N launches a New Document, we'll add in a Ctrl+T to launch the About Dialog.

The accelerator keys are in: \officecfg\registry\data\org\openoffice\Office\Accelerators.xcu

We want to add a global accelerator, and these are in the top section of this file. This section is within the "Primary Keys" and "Global" nodes. Just to stick to the convention of the keys being in alphabetical order scroll down to the entry for the "S" key (this is the binding for CTRL + S):

  <node oor:name="S_MOD1" oor:op="replace">
   <prop oor:name="Command">
    <value xml:lang="en-US">.uno:Save</value>
   </prop>
  </node>

Now you will notice that below this is an entry such as:

  <node oor:name="S_SHIFT_MOD1" oor:op="replace">
   <prop oor:name="Command">
    <value xml:lang="en-US">.uno:SaveAs</value>
   </prop>
  </node>

This is the CTRL + SHIFT + S binding. So, below that add:

  <node oor:name="T_MOD1" oor:op="replace">
   <prop oor:name="Command">
    <value xml:lang="en-US">.uno:About</value>
   </prop>
  </node>

You can copy your changed Accelerators.xcu file directly into the install directory (\OpenOffice.org 3\Basis\share\registry\data\org\openoffice\Office\Accelerators.xcu).

Or, you can build the module and rebuild the installer (this assumed you have previously fully built it, if not then just do the usual build --all -P4 from the instsetoo module). From the $SRCROOT\officecfg directory call "build", then "deliver" to send the changed Accelerators.xcu file to the solenv module. Then change to the instsetoo module and call "build", then install.

Run OOo, CRTL + T should now show the About dialog. Awesome!!!


accelerator-about.diff Next: Tutorial_Toolbar
Personal tools