From: jkkn Date: Fri, 2 Nov 2007 02:55:17 +0000 (+0000) Subject: mac instant apply fixes X-Git-Url: https://git.jkkn.net/?a=commitdiff_plain;h=45c91349a266e34cfb7d5cb86dee232645949ebe;p=tv2developer mac instant apply fixes --- diff --git a/content/browser_overlay.xul b/content/browser_overlay.xul index 7570721..f8cd06e 100755 --- a/content/browser_overlay.xul +++ b/content/browser_overlay.xul @@ -14,10 +14,10 @@ + oncommand="TV2Developer.openOptionsDialog(event)" /> + oncommand="window.openDialog('chrome://tv2developer/content/about.xul','tv2about','modal,centerscreen,chrome,resizable=no')" /> diff --git a/content/options.js b/content/options.js index 86528dc..1543dea 100755 --- a/content/options.js +++ b/content/options.js @@ -2,21 +2,22 @@ var TV2Options = { _keyBranch: null, + _prefBranch: null, _hackEnabled: false, init: function() { var hacks = document.getElementById('mac-hacks'); - this._keyBranch = - Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService) - .getBranch('ui.key.'); + var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); + this._keyBranch = prefs.getBranch('ui.key.'); + this._prefBranch = prefs.getBranch('browser.preferences.'); // we show the options for hacing accesskeys if user has set a preference or accesskeys are disabled this._hackEnabled = this._keyBranch.prefHasUserValue('menuAccessKey') || - (this._keyBranch.getIntPref('menuAccessKey') == -1); + (this._keyBranch.getIntPref('menuAccessKey') == 0); if (!this._hackEnabled) { hacks.style.display = 'none'; } else { document.getElementById('mac-accesskeys').checked = - (this._keyBranch.getIntPref('menuAccessKey') != -1); + (this._keyBranch.getIntPref('menuAccessKey') != 0); } }, @@ -29,6 +30,11 @@ var TV2Options = { this._keyBranch.clearUserPref('menuAccessKey'); } } + }, + + update: function() { + var instantApply = this._prefBranch.getBoolPref("instantApply", false); + if (instantApply) this.save(); } } \ No newline at end of file diff --git a/content/options.xul b/content/options.xul index 37acd15..e8f2407 100755 --- a/content/options.xul +++ b/content/options.xul @@ -6,8 +6,7 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="&optionsDialog.title;" onload="TV2Options.init()" - ondialogaccept="TV2Options.save()" - > + ondialogaccept="TV2Options.save()">