Bug 452890: move System Defaults from General to Advanced -> General. r=mkmelin

This commit is contained in:
Bryan W Clark (:clarkbw) 2008-11-21 11:33:05 +02:00
Родитель d0c69f6607
Коммит c9f791ce04
4 изменённых файлов: 92 добавлений и 71 удалений

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

@ -70,6 +70,49 @@ var gAdvancedPane = {
}
},
#ifdef HAVE_SHELL_SERVICE
/**
* Checks whether Thunderbird is currently registered with the operating
* system as the default app for mail, rss and news. If Thunderbird is not
* currently the default app, the user is given the option of making it the
* default for each type; otherwise, the user is informed that Thunderbird is
* already the default.
*/
checkDefaultNow: function (aAppType)
{
var nsIShellService = Components.interfaces.nsIShellService;
var shellSvc;
try {
shellSvc = Components.classes["@mozilla.org/mail/shell-service;1"]
.getService(nsIShellService);
} catch (ex) { return; }
// If we are already the default for all the handled types, alert the user.
if (shellSvc.isDefaultClient(false, nsIShellService.MAIL |
nsIShellService.NEWS |
nsIShellService.RSS))
{
var brandBundle = document.getElementById("bundleBrand");
var preferencesBundle = document.getElementById("bundlePreferences");
var brandShortName = brandBundle.getString("brandShortName");
var promptTitle = preferencesBundle.getString("alreadyDefaultClientTitle");
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var promptMessage = preferencesBundle.getFormattedString("alreadyDefault",
[brandShortName]);
psvc.alert(window, promptTitle, promptMessage);
}
else
{
// otherwise, bring up the default client dialog
window.openDialog("chrome://messenger/content/defaultClientDialog.xul",
"Default Client",
"modal,centerscreen,chrome,resizable=no");
}
},
#endif
showConfigEdit: function()
{
document.documentElement.openWindow("Preferences:ConfigManager",

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

@ -40,8 +40,10 @@
<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % advancedDTD SYSTEM "chrome://messenger/locale/preferences/advanced.dtd">
<!ENTITY % generalDTD SYSTEM "chrome://messenger/locale/preferences/general.dtd">
%brandDTD;
%advancedDTD;
%generalDTD;
]>
<overlay id="AdvancedPaneOverlay"
@ -53,9 +55,19 @@
<preferences>
<preference id="mail.preferences.advanced.selectedTabIndex"
name="mail.preferences.advanced.selectedTabIndex" type="int"/>
<!-- General tab -->
<preference id="mailnews.database.global.indexer.enabled"
name="mailnews.database.global.indexer.enabled"
type="bool"/>
#ifdef HAVE_SHELL_SERVICE
<preference id="mail.shell.checkDefaultClient"
name="mail.shell.checkDefaultClient"
type="bool"/>
<preference id="pref.general.disable_button.default_mail"
name="pref.general.disable_button.default_mail"
type="bool"/>
#endif
<!-- Display & Reading tab -->
<preference id="mail.showCondensedAddresses" name="mail.showCondensedAddresses" type="bool"/>
<preference id="mailnews.mark_message_read.auto"
name="mailnews.mark_message_read.auto" type="bool"/>
@ -97,6 +109,10 @@
type="bool"/>
</preferences>
#ifdef HAVE_SHELL_SERVICE
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
#endif
<tabbox id="advancedPrefs" flex="1" onselect="gAdvancedPane.tabSelectionChanged();">
<tabs>
<tab label="&itemGeneral.label;"/>
@ -109,14 +125,6 @@
<tabpanels flex="1">
<!-- General -->
<tabpanel orient="vertical">
<hbox>
<checkbox id="enableGloda"
preference="mailnews.database.global.indexer.enabled"
label="&enableGloda.label;"
accesskey="&enableGloda.accesskey;"/>
</hbox>
<hbox align="center">
<description flex="1">&returnReceiptsInfo.label;</description>
<button label="&showReturnReceipts.label;"
@ -124,12 +132,39 @@
oncommand="gAdvancedPane.showReturnReceipts();"/>
</hbox>
<hbox align="center" pack="start">
<description flex="1">&configEditDesc.label;</description>
<button id="configEditor" label="&configEdit.label;"
accesskey="&configEdit.accesskey;" oncommand="gAdvancedPane.showConfigEdit();"/>
</hbox>
#ifdef HAVE_SHELL_SERVICE
<groupbox id="systemDefaultsGroup" orient="horizontal">
<caption label="&systemDefaults.label;"/>
<hbox id="checkDefaultBox" align="center" flex="1">
<checkbox id="alwaysCheckDefault"
preference="mail.shell.checkDefaultClient"
label="&alwaysCheckDefault.label;"
accesskey="&alwaysCheckDefault.accesskey;" flex="1"/>
<button id="checkDefaultButton" label="&checkNow.label;"
accesskey="&checkNow.accesskey;"
oncommand="gAdvancedPane.checkDefaultNow();"
preference="pref.general.disable_button.default_mail"/>
</hbox>
</groupbox>
#endif
<groupbox>
<caption label="&configEditDesc.label;"/>
<vbox>
<hbox>
<checkbox id="enableGloda"
preference="mailnews.database.global.indexer.enabled"
label="&enableGloda.label;"
accesskey="&enableGloda.accesskey;"/>
</hbox>
</vbox>
<vbox>
<hbox pack="end">
<button id="configEditor" label="&configEdit.label;"
accesskey="&configEdit.accesskey;"
oncommand="gAdvancedPane.showConfigEdit();"/>
</hbox>
</vbox>
</groupbox>
</tabpanel>
<!-- Reading and Display -->

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

@ -46,46 +46,7 @@ var gGeneralPane = {
this.updatePlaySound();
},
#ifdef HAVE_SHELL_SERVICE
/**
* Checks whether Thunderbird is currently registered with the operating
* system as the default app for mail, rss and news. If Thunderbird is not currently the
* default app, the user is given the option of making it the default for each type;
* otherwise, the user is informed that Thunderbird is already the default.
*/
checkDefaultNow: function (aAppType)
{
var nsIShellService = Components.interfaces.nsIShellService;
var shellSvc;
try {
shellSvc = Components.classes["@mozilla.org/mail/shell-service;1"].getService(nsIShellService);
} catch (ex) { return; }
// if we are already the default for all the types we handle, then alert the user.
if (shellSvc.isDefaultClient(false, nsIShellService.MAIL | nsIShellService.NEWS | nsIShellService.RSS))
{
var brandBundle = document.getElementById("bundleBrand");
var preferencesBundle = document.getElementById("bundlePreferences");
var brandShortName = brandBundle.getString("brandShortName");
var promptTitle = preferencesBundle.getString("alreadyDefaultClientTitle");
var promptMessage;
const IPS = Components.interfaces.nsIPromptService;
var psvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(IPS);
promptMessage = preferencesBundle.getFormattedString("alreadyDefault", [brandShortName]);
psvc.alert(window, promptTitle, promptMessage);
}
else
{
// otherwise, bring up the default client dialog
window.openDialog("chrome://messenger/content/defaultClientDialog.xul", "Default Client",
"modal,centerscreen,chrome,resizable=no");
}
},
#endif
/**
* Restores the default start page as the user's start page
*/

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

@ -51,16 +51,12 @@
<script type="application/x-javascript" src="chrome://messenger/content/preferences/general.js"/>
<preferences>
<preference id="mail.shell.checkDefaultClient" name="mail.shell.checkDefaultClient" type="bool"/>
<preference id="mail.pane_config.dynamic" name="mail.pane_config.dynamic" type="int"/>
<preference id="mailnews.reuse_message_window" name="mailnews.reuse_message_window" type="bool"/>
<preference id="mailnews.start_page.enabled" name="mailnews.start_page.enabled" type="bool"/>
<preference id="mailnews.start_page.url" name="mailnews.start_page.url" type="string"/>
<preference id="mail.biff.show_alert" name="mail.biff.show_alert" type="bool"/>
<preference id="mail.biff.play_sound" name="mail.biff.play_sound" type="bool"/>
<preference id="pref.general.disable_button.default_mail"
name="pref.general.disable_button.default_mail"
type="bool"/>
<preference id="mail.biff.play_sound.type" name="mail.biff.play_sound.type" type="int"/>
<preference id="mail.biff.play_sound.url" name="mail.biff.play_sound.url" type="string"/>
#ifdef XP_MACOSX
@ -70,20 +66,6 @@
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
#ifdef HAVE_SHELL_SERVICE
<stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
<groupbox id="systemDefaultsGroup" orient="vertical">
<caption label="&systemDefaults.label;"/>
<hbox id="checkDefaultBox" align="center" flex="1">
<checkbox id="alwaysCheckDefault" preference="mail.shell.checkDefaultClient"
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
flex="1" style="height: &alwaysCheckDefault.height;"/>
<button id="checkDefaultButton" label="&checkNow.label;" accesskey="&checkNow.accesskey;"
oncommand="gGeneralPane.checkDefaultNow();" preference="pref.general.disable_button.default_mail"/>
</hbox>
</groupbox>
#endif
<groupbox>
<caption label="&messengerStartPage.label;"/>
<hbox align="start">