Bug 319850: Make F1 open the respective Help topic by firing dialoghelp in prefwindows. r=mano
authorSteffen Wilberg <steffen.wilberg@web.de>
Thu, 18 Dec 2008 20:50:49 +0100
changeset 22914 f7e763f81f1f20b7b20fd00447af463fc6f3ba58
parent 22913 d2c8c94565499ffae6e200092bb15c1debc56dfb
child 22915 d20515d542c9e5d3e90d86e6bc8940a7f4dbe99f
push idunknown
push userunknown
push dateunknown
reviewersmano
bugs319850
milestone1.9.2a1pre
Bug 319850: Make F1 open the respective Help topic by firing dialoghelp in prefwindows. r=mano
toolkit/content/widgets/preferences.xml
toolkit/locales/en-US/chrome/global/globalKeys.dtd
toolkit/locales/jar.mn
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -1,11 +1,16 @@
 <?xml version="1.0"?>
 
-<!DOCTYPE bindings SYSTEM "chrome://global/locale/preferences.dtd">
+<!DOCTYPE bindings [
+  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
+  %preferencesDTD;
+  <!ENTITY % globalKeysDTD SYSTEM "chrome://global/locale/globalKeys.dtd">
+  %globalKeysDTD;
+]>
 
 <bindings id="preferencesBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xbl="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 #
 # = Preferences Window Framework
@@ -1099,16 +1104,26 @@
           this.showPane(pane);
         }
       </handler>
 
       <handler event="keypress" key="&windowClose.key;" modifiers="accel" phase="capturing">
         if (this.instantApply)
           window.close();
       </handler>
+
+      <handler event="keypress"
+#ifdef XP_MACOSX
+               key="&openHelpMac.commandkey;" modifiers="accel"
+#else
+               keycode="&openHelp.commandkey;"
+#endif
+               phase="capturing">
+        this._fireEvent("dialoghelp", this);
+      </handler>
     </handlers>
   </binding>
   
   <binding id="prefpane">
     <resources>
       <stylesheet src="chrome://global/skin/preferences.css"/>
     </resources>
     <content>
new file mode 100644
--- /dev/null
+++ b/toolkit/locales/en-US/chrome/global/globalKeys.dtd
@@ -0,0 +1,2 @@
+<!ENTITY openHelp.commandkey     "VK_F1">
+<!ENTITY openHelpMac.commandkey  "?">
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -23,16 +23,17 @@
 + locale/@AB_CD@/global/editMenuOverlay.dtd             (%chrome/global/editMenuOverlay.dtd)
   locale/@AB_CD@/global/filefield.properties            (%chrome/global/filefield.properties)
   locale/@AB_CD@/global/filepicker.dtd                  (%chrome/global/filepicker.dtd)
   locale/@AB_CD@/global/filepicker.properties           (%chrome/global/filepicker.properties)
   locale/@AB_CD@/global/findbar.dtd                     (%chrome/global/findbar.dtd)
   locale/@AB_CD@/global/findbar.properties              (%chrome/global/findbar.properties)
 + locale/@AB_CD@/global/finddialog.dtd                  (%chrome/global/finddialog.dtd)
 + locale/@AB_CD@/global/finddialog.properties           (%chrome/global/finddialog.properties)
+  locale/@AB_CD@/global/globalKeys.dtd                  (%chrome/global/globalKeys.dtd)
 + locale/@AB_CD@/global/intl.css                        (%chrome/global/intl.css)
 + locale/@AB_CD@/global/intl.properties                 (%chrome/global/intl.properties)
 + locale/@AB_CD@/global/keys.properties                 (%chrome/global/keys.properties)
 + locale/@AB_CD@/global/languageNames.properties        (%chrome/global/languageNames.properties)
   locale/@AB_CD@/global/license.dtd                     (%chrome/global/license.dtd)
   locale/@AB_CD@/global/mozilla.dtd                     (%chrome/global/mozilla.dtd)
   locale/@AB_CD@/global/notification.dtd                (%chrome/global/notification.dtd)
   locale/@AB_CD@/global/preferences.dtd                 (%chrome/global/preferences.dtd)