From c9f791ce0477a4dc7dd30c3f09fb9181a018f32d Mon Sep 17 00:00:00 2001 From: "Bryan W Clark (:clarkbw)" Date: Fri, 21 Nov 2008 11:33:05 +0200 Subject: [PATCH] Bug 452890: move System Defaults from General to Advanced -> General. r=mkmelin --- mail/components/preferences/advanced.js | 43 ++++++++++++++++ mail/components/preferences/advanced.xul | 63 ++++++++++++++++++------ mail/components/preferences/general.js | 39 --------------- mail/components/preferences/general.xul | 18 ------- 4 files changed, 92 insertions(+), 71 deletions(-) diff --git a/mail/components/preferences/advanced.js b/mail/components/preferences/advanced.js index e0414c57dc..63518c1140 100644 --- a/mail/components/preferences/advanced.js +++ b/mail/components/preferences/advanced.js @@ -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", diff --git a/mail/components/preferences/advanced.xul b/mail/components/preferences/advanced.xul index 04931047d2..8131d080ee 100644 --- a/mail/components/preferences/advanced.xul +++ b/mail/components/preferences/advanced.xul @@ -40,8 +40,10 @@ + %brandDTD; %advancedDTD; +%generalDTD; ]> + +#ifdef HAVE_SHELL_SERVICE + + +#endif + @@ -97,6 +109,10 @@ type="bool"/> +#ifdef HAVE_SHELL_SERVICE + +#endif + @@ -109,14 +125,6 @@ - - - - - &returnReceiptsInfo.label;