зеркало из https://github.com/mozilla/gecko-dev.git
Turbo landing:
- Turbo mode should run Mozilla from registry (88844). r=ccarlen sr=ben - Systray menu for turbo should include components (89532). r=syd sr=ben - Installer checkbox needs to turn turbo on properly (96936, 97338). r=ccarlen sr=ben - Add 'Disable Quick Launch' menuitem to turbo systray icon (98770). r=syd sr=ben - Need confirmation dialog when 'Disable Quick Launch' is selected (98805). r=syd sr=ben - Show dialog when last window is closed in turbo mode (89166). r=ccarlen sr=ben and some cleanup.
This commit is contained in:
Родитель
6c67a322c8
Коммит
58867f2e44
|
@ -33,17 +33,14 @@
|
|||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var panel = "chrome://communicator/content/pref/pref-advanced.xul";
|
||||
var _elementIDs = ["advancedJavaAllow", "javascriptEnabled", "advancedMailFTP", "advancedMailFTPAddress",
|
||||
"enableTurbo"];
|
||||
var _elementIDs = ["advancedJavaAllow", "javascriptEnabled", "advancedMailFTP", "advancedMailFTPAddress"];
|
||||
|
||||
function Startup()
|
||||
{
|
||||
function Startup() {
|
||||
ftpCheck();
|
||||
turboCheck();
|
||||
}
|
||||
|
||||
function ftpCheck()
|
||||
{
|
||||
function ftpCheck() {
|
||||
var checked = document.getElementById("advancedMailFTP").checked;
|
||||
var field = document.getElementById("advancedMailFTPAddress");
|
||||
field.disabled = !checked;
|
||||
|
@ -60,7 +57,7 @@
|
|||
* is loaded. The turbo mode setting is not exactly a preference -- setting
|
||||
* the checkbox should (on leaving the prefs with an "Ok") result in a call
|
||||
* to the backend to do the necessary win32 registry twiddling needed for
|
||||
* turbo mode to go into affect. Clearing it should undo this work. We need
|
||||
* turbo mode to go into effect. Clearing it should undo this work. We need
|
||||
* to call the backend to determine if turbo mode is enabled (since we are
|
||||
* required to check for it in a non-trivial way) and then explicitly set the
|
||||
* checkbox here based on what we find. Finally, we have to hide the checkbox
|
||||
|
@ -80,6 +77,11 @@
|
|||
frame.setAttribute("hidden", "true");
|
||||
return;
|
||||
}
|
||||
|
||||
var winhooksService = Components.classes["@mozilla.org/winhooks;1"].getService(Components.interfaces.nsIWindowsHooks);
|
||||
if (winhooksService)
|
||||
document.getElementById("enableTurbo").checked = winhooksService.isStartupTurboEnabled();
|
||||
|
||||
parent.hPrefWindow.registerOKCallbackFunc( saveTurboSetting );
|
||||
}
|
||||
|
||||
|
@ -98,22 +100,18 @@
|
|||
*
|
||||
*/
|
||||
|
||||
function saveTurboSetting()
|
||||
{
|
||||
if ( navigator.platform != "Win32" )
|
||||
function saveTurboSetting() {
|
||||
if (navigator.platform != "Win32")
|
||||
return;
|
||||
|
||||
var acheckbox = document.getElementById("enableTurbo");
|
||||
try {
|
||||
hooks = Components.classes["@mozilla.org/winhooks;1"];
|
||||
if ( hooks )
|
||||
hooks = hooks.getService(Components.interfaces.nsIWindowsHooks);
|
||||
if ( hooks ) {
|
||||
var isEnabled = acheckbox.checked;
|
||||
if ( isEnabled == true )
|
||||
hooks.startupTurboEnable();
|
||||
var turboCheckbox = document.getElementById("enableTurbo");
|
||||
var winhooksService = Components.classes["@mozilla.org/winhooks;1"].getService(Components.interfaces.nsIWindowsHooks);
|
||||
if (winhooksService) {
|
||||
var isEnabled = turboCheckbox.checked;
|
||||
if (isEnabled)
|
||||
winhooksService.startupTurboEnable();
|
||||
else
|
||||
hooks.startupTurboDisable();
|
||||
winhooksService.startupTurboDisable();
|
||||
var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService();
|
||||
appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService );
|
||||
var nativeAppSupport = null;
|
||||
|
@ -125,10 +123,7 @@
|
|||
if (nativeAppSupport)
|
||||
nativeAppSupport.isServerMode = isEnabled;
|
||||
}
|
||||
} catch( ex ) {
|
||||
}
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
|
@ -166,8 +161,7 @@
|
|||
<groupbox orient="vertical" id="perfSettings">
|
||||
<caption id="perfLabel" label="&perfTitle.label;"/>
|
||||
<vbox id="perfBox" align="start">
|
||||
<checkbox id="enableTurbo" label="&enableTurbo.label;" accesskey="&enableTurboCheck.accesskey;"
|
||||
pref="true" preftype="bool" prefstring="browser.turbo.enabled" prefattribute="checked"/>
|
||||
<checkbox id="enableTurbo" label="&enableTurbo.label;" accesskey="&enableTurboCheck.accesskey;"/>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче