Bug 406387 - Move System Defaults from Main to Advanced - General. r=sspitzer, approval1.9=dsicore

This commit is contained in:
rob_strong@exchangecode.com 2007-12-03 18:38:06 -08:00
Родитель 0df570cddb
Коммит b0132a26a6
8 изменённых файлов: 99 добавлений и 102 удалений

Просмотреть файл

@ -399,4 +399,51 @@ var gAdvancedPane = {
"chrome://pippki/content/device_manager.xul", "chrome://pippki/content/device_manager.xul",
"", null); "", null);
} }
#ifdef HAVE_SHELL_SERVICE
,
// SYSTEM DEFAULTS
/*
* Preferences:
*
* browser.shell.checkDefault
* - true if a default-browser check (and prompt to make it so if necessary)
* occurs at startup, false otherwise
*/
/**
* Checks whether the browser is currently registered with the operating
* system as the default browser. If the browser is not currently the
* default browser, the user is given the option of making it the default;
* otherwise, the user is informed that this browser already is the browser.
*/
checkNow: function ()
{
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
.getService(Components.interfaces.nsIShellService);
var brandBundle = document.getElementById("bundleBrand");
var shellBundle = document.getElementById("bundleShell");
var brandShortName = brandBundle.getString("brandShortName");
var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
var promptMessage;
const IPS = Components.interfaces.nsIPromptService;
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(IPS);
if (!shellSvc.isDefaultBrowser(false)) {
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
[brandShortName]);
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
IPS.STD_YES_NO_BUTTONS,
null, null, null, null, { });
if (rv == 0)
shellSvc.setDefaultBrowser(true, false);
}
else {
promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
[brandShortName]);
psvc.alert(window, promptTitle, promptMessage);
}
}
#endif
}; };

Просмотреть файл

@ -72,6 +72,15 @@
<preference id="general.smoothScroll" name="general.smoothScroll" type="bool"/> <preference id="general.smoothScroll" name="general.smoothScroll" type="bool"/>
<preference id="layout.spellcheckDefault" name="layout.spellcheckDefault" type="int"/> <preference id="layout.spellcheckDefault" name="layout.spellcheckDefault" type="int"/>
#ifdef HAVE_SHELL_SERVICE
<preference id="browser.shell.checkDefaultBrowser"
name="browser.shell.checkDefaultBrowser"
type="bool"/>
<preference id="pref.general.disable_button.default_browser"
name="pref.general.disable_button.default_browser"
type="bool"/>
#endif
<!-- Network tab --> <!-- Network tab -->
<preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/> <preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/>
@ -114,6 +123,11 @@
type="bool"/> type="bool"/>
</preferences> </preferences>
#ifdef HAVE_SHELL_SERVICE
<stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
#endif
<script type="application/x-javascript" src="chrome://browser/content/preferences/advanced.js"/> <script type="application/x-javascript" src="chrome://browser/content/preferences/advanced.js"/>
<tabbox id="advancedPrefs" flex="1" <tabbox id="advancedPrefs" flex="1"
@ -169,6 +183,22 @@
preference="layout.spellcheckDefault"/> preference="layout.spellcheckDefault"/>
</groupbox> </groupbox>
#ifdef HAVE_SHELL_SERVICE
<!-- System Defaults -->
<groupbox id="systemDefaultsGroup" orient="horizontal">
<caption label="&systemDefaults.label;"/>
<hbox id="checkDefaultBox" align="center" flex="1">
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
flex="1"/>
<button id="checkDefaultButton"
label="&checkNow.label;" accesskey="&checkNow.accesskey;"
oncommand="gAdvancedPane.checkNow()"
preference="pref.general.disable_button.default_browser"/>
</hbox>
</groupbox>
#endif
</tabpanel> </tabpanel>
<!-- Network --> <!-- Network -->
@ -200,7 +230,7 @@
aaa:labelledby="useCacheBefore cacheSize useCacheAfter"/> aaa:labelledby="useCacheBefore cacheSize useCacheAfter"/>
<label id="useCacheAfter" flex="1">&useCacheAfter.label;</label> <label id="useCacheAfter" flex="1">&useCacheAfter.label;</label>
<button id="clearCacheButton" icon="clear" <button id="clearCacheButton" icon="clear"
label="&clearCacheNow.label;" label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
oncommand="gAdvancedPane.clearCache();"/> oncommand="gAdvancedPane.clearCache();"/>
</hbox> </hbox>
</groupbox> </groupbox>

Просмотреть файл

@ -466,52 +466,4 @@ var gMainPane = {
const EMFEATURES = "chrome,menubar,extra-chrome,toolbar,dialog=no,resizable"; const EMFEATURES = "chrome,menubar,extra-chrome,toolbar,dialog=no,resizable";
window.openDialog(EMURL, "", EMFEATURES); window.openDialog(EMURL, "", EMFEATURES);
} }
#ifdef HAVE_SHELL_SERVICE
,
// SYSTEM DEFAULTS
/*
* Preferences:
*
* browser.shell.checkDefault
* - true if a default-browser check (and prompt to make it so if necessary)
* occurs at startup, false otherwise
*/
/**
* Checks whether the browser is currently registered with the operating
* system as the default browser. If the browser is not currently the
* default browser, the user is given the option of making it the default;
* otherwise, the user is informed that this browser already is the browser.
*/
checkNow: function ()
{
var shellSvc = Components.classes["@mozilla.org/browser/shell-service;1"]
.getService(Components.interfaces.nsIShellService);
var brandBundle = document.getElementById("bundleBrand");
var shellBundle = document.getElementById("bundleShell");
var brandShortName = brandBundle.getString("brandShortName");
var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
var promptMessage;
const IPS = Components.interfaces.nsIPromptService;
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(IPS);
if (!shellSvc.isDefaultBrowser(false)) {
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
[brandShortName]);
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
IPS.STD_YES_NO_BUTTONS,
null, null, null, null, { });
if (rv == 0)
shellSvc.setDefaultBrowser(true, false);
}
else {
promptMessage = shellBundle.getFormattedString("alreadyDefaultBrowser",
[brandShortName]);
psvc.alert(window, promptTitle, promptMessage);
}
}
#endif
}; };

Просмотреть файл

@ -93,22 +93,9 @@
onchange="gMainPane.displayDownloadDirPref();"/> onchange="gMainPane.displayDownloadDirPref();"/>
<preference id="browser.download.folderList" name="browser.download.folderList" type="int"/> <preference id="browser.download.folderList" name="browser.download.folderList" type="int"/>
<!-- SYSTEM DEFAULTS -->
<preference id="browser.shell.checkDefaultBrowser"
name="browser.shell.checkDefaultBrowser"
type="bool"/>
<preference id="pref.general.disable_button.default_browser"
name="pref.general.disable_button.default_browser"
type="bool"/>
</preferences> </preferences>
<stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/> <stringbundle id="bundlePreferences" src="chrome://browser/locale/preferences/preferences.properties"/>
#ifdef HAVE_SHELL_SERVICE
<stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
#endif
<!-- Startup --> <!-- Startup -->
<groupbox id="startupGroup"> <groupbox id="startupGroup">
@ -195,31 +182,15 @@
</radiogroup> </radiogroup>
</groupbox> </groupbox>
#ifdef HAVE_SHELL_SERVICE
<!-- System Defaults -->
<groupbox id="systemDefaultsGroup" orient="horizontal">
<caption label="&systemDefaults.label;"/>
<hbox id="checkDefaultBox" align="center" flex="1">
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
flex="1"/>
<button id="checkDefaultButton"
label="&checkNow.label;" accesskey="&checkNow.accesskey;"
oncommand="gMainPane.checkNow()"
preference="pref.general.disable_button.default_browser"/>
</hbox>
</groupbox>
#endif
<hbox class="bottomBox"> <hbox class="bottomBox">
<groupbox id="addonsMgrGroup" orient="horizontal" flex="1"> <groupbox id="addonsMgrGroup" orient="horizontal" flex="1">
<caption label="&addonsMgr.label;"/> <caption label="&addonsMgr.label;"/>
<description control="manageAddons" <description control="manageAddons"
#ifdef XP_WIN #ifdef XP_WIN
flex="1">&manageAddonsDesc.label;</description> flex="1">&manageAddonsDescWin.label;</description>
#else #else
flex="1">&manageAddonsDescUnix.label;</description> flex="1">&manageAddonsDescUnix2.label;</description>
#endif #endif
<button id="manageAddons" label="&manageAddons.label;" <button id="manageAddons" label="&manageAddons.label;"
accesskey="&manageAddons.accesskey;" accesskey="&manageAddons.accesskey;"

Просмотреть файл

@ -83,12 +83,12 @@
#endif #endif
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
#ifdef USE_WIN_TITLE_STYLE #ifdef USE_WIN_TITLE_STYLE
style="&prefWin.styleWin;"> style="&prefWin.styleWin2;">
#else #else
#ifdef XP_MACOSX #ifdef XP_MACOSX
style="&prefWin.styleMac;"> style="&prefWin.styleMac2;">
#else #else
style="&prefWin.styleGNOME;"> style="&prefWin.styleGNOME2;">
#endif #endif
#endif #endif

Просмотреть файл

@ -1,5 +1,4 @@
<!-- Note: due to bug 143065, the only remaining accesskeys available to be used <!-- Note: each tab panel must contain unique accesskeys -->
in the Advanced pane are: "j", "o", "q", "z" -->
<!ENTITY generalTab.label "General"> <!ENTITY generalTab.label "General">
@ -21,6 +20,12 @@
<!ENTITY checkSpelling.label "Check my spelling as I type"> <!ENTITY checkSpelling.label "Check my spelling as I type">
<!ENTITY checkSpelling.accesskey "t"> <!ENTITY checkSpelling.accesskey "t">
<!ENTITY systemDefaults.label "System Defaults">
<!ENTITY alwaysCheckDefault.label "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
<!ENTITY alwaysCheckDefault.accesskey "w">
<!ENTITY checkNow.label "Check Now">
<!ENTITY checkNow.accesskey "N">
<!ENTITY networkTab.label "Network"> <!ENTITY networkTab.label "Network">
<!ENTITY connection.label "Connection"> <!ENTITY connection.label "Connection">
@ -41,6 +46,7 @@
<!ENTITY useCacheBefore.accesskey "U"> <!ENTITY useCacheBefore.accesskey "U">
<!ENTITY useCacheAfter.label "MB of space for the cache"> <!ENTITY useCacheAfter.label "MB of space for the cache">
<!ENTITY clearCacheNow.label "Clear Now"> <!ENTITY clearCacheNow.label "Clear Now">
<!ENTITY clearCacheNow.accesskey "C">
<!ENTITY updateTab.label "Update"> <!ENTITY updateTab.label "Update">

Просмотреть файл

@ -30,17 +30,8 @@
<!ENTITY alwaysAsk.label "Always ask me where to save files"> <!ENTITY alwaysAsk.label "Always ask me where to save files">
<!ENTITY alwaysAsk.accesskey "A"> <!ENTITY alwaysAsk.accesskey "A">
<!ENTITY addonsMgr.label "Add-ons">
<!ENTITY systemDefaults.label "System Defaults"> <!ENTITY manageAddonsDescWin.label "Change options for your add-ons">
<!ENTITY manageAddonsDescUnix2.label "Change preferences for your add-ons">
<!ENTITY alwaysCheckDefault.label "Always check to see if &brandShortName; is the default browser on startup"><!--XXX--> <!ENTITY manageAddons.label "Manage Add-ons…">
<!ENTITY alwaysCheckDefault.accesskey "y"> <!ENTITY manageAddons.accesskey "M">
<!ENTITY checkNow.label "Check Now">
<!ENTITY checkNow.accesskey "N">
<!ENTITY addonsMgr.label "Add-ons">
<!ENTITY manageAddonsDesc.label "Change options for your add-ons.">
<!ENTITY manageAddonsDescUnix.label "Change preferences for your add-ons.">
<!ENTITY manageAddons.label "Manage Add-ons…">
<!ENTITY manageAddons.accesskey "M">

Просмотреть файл

@ -3,9 +3,9 @@
<!ENTITY prefWindow.titleGNOME "&brandShortName; Preferences"> <!ENTITY prefWindow.titleGNOME "&brandShortName; Preferences">
<!-- When making changes to prefWindow.styleWin test both Windows Classic and <!-- When making changes to prefWindow.styleWin test both Windows Classic and
Luna since widget heights are different based on the OS theme --> Luna since widget heights are different based on the OS theme -->
<!ENTITY prefWin.styleWin "width: 42em; min-height: 44em;"> <!ENTITY prefWin.styleWin2 "width: 42em; min-height: 39em;">
<!ENTITY prefWin.styleMac "width: 47em; min-height: 45em;"> <!ENTITY prefWin.styleMac2 "width: 47em; min-height: 40em;">
<!ENTITY prefWin.styleGNOME "width: 42em; min-height: 44.5em;"> <!ENTITY prefWin.styleGNOME2 "width: 42em; min-height: 39.5em;">
<!ENTITY paneMain.title "Main"> <!ENTITY paneMain.title "Main">
<!ENTITY paneTabs.title "Tabs"> <!ENTITY paneTabs.title "Tabs">