From 525b5f7e41eda02ce90465d0c5c8602006db5ed0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Bialik Date: Tue, 4 Nov 2008 22:42:15 +0200 Subject: [PATCH] Bug 462423: allow changing and choosing mail start page even when it is not set to show at the start. r=mkmelin --- mail/base/content/commandglue.js | 10 ++++------ mail/base/content/mail3PaneWindowCommands.js | 2 +- mail/base/content/mailWindow.js | 7 ++++--- mail/components/preferences/general.js | 6 ------ mail/components/preferences/general.xul | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/mail/base/content/commandglue.js b/mail/base/content/commandglue.js index b135b2ea5f..05da94ba7d 100644 --- a/mail/base/content/commandglue.js +++ b/mail/base/content/commandglue.js @@ -975,15 +975,13 @@ function FolderPaneSelectionChange() ClearThreadPane(); } - if (gAccountCentralLoaded) - UpdateMailToolbar("gAccountCentralLoaded"); - - if (gDisplayStartupPage) + var startpageenabled = gPrefBranch.getBoolPref("mailnews.start_page.enabled"); + if (gDisplayStartupPage && startpageenabled) { loadStartPage(); gDisplayStartupPage = false; - UpdateMailToolbar("gDisplayStartupPage"); - } + } + UpdateMailToolbar("FolderPaneSelectionChange"); } function ClearThreadPane() diff --git a/mail/base/content/mail3PaneWindowCommands.js b/mail/base/content/mail3PaneWindowCommands.js index d7dd5f5d38..54bccac3ef 100644 --- a/mail/base/content/mail3PaneWindowCommands.js +++ b/mail/base/content/mail3PaneWindowCommands.js @@ -383,7 +383,7 @@ var DefaultController = enabled.value = gDBView.navigateStatus((command == "cmd_goBack" || command == "button_goBack") ? nsMsgNavigationType.back : nsMsgNavigationType.forward); return enabled.value; case "cmd_goStartPage": - return pref.getBoolPref("mailnews.start_page.enabled") && !IsMessagePaneCollapsed(); + return !IsMessagePaneCollapsed(); case "cmd_markAllRead": case "cmd_markReadByDate": return IsFolderSelected(); diff --git a/mail/base/content/mailWindow.js b/mail/base/content/mailWindow.js index 591721064a..d824731632 100644 --- a/mail/base/content/mailWindow.js +++ b/mail/base/content/mailWindow.js @@ -548,13 +548,14 @@ function loadStartPage() try { gMessageNotificationBar.clearMsgNotifications(); - var startpageenabled = pref.getBoolPref("mailnews.start_page.enabled"); var startpage = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"] .getService(Components.interfaces.nsIURLFormatter) .formatURLPref(startPageUrlPref()); - // load about:blank as the start page if we are offline or we don't have a start page url... - GetMessagePaneFrame().location.href = startpageenabled && startpage && MailOfflineMgr.isOnline() ? startpage : "about:blank"; + // Load about:blank as the start page if we are offline or we don't have + // a start page url... + GetMessagePaneFrame().location.href = startpage && MailOfflineMgr.isOnline() ? + startpage : "about:blank"; ClearMessageSelection(); } catch (ex) diff --git a/mail/components/preferences/general.js b/mail/components/preferences/general.js index 03bb6b529a..db561635c9 100644 --- a/mail/components/preferences/general.js +++ b/mail/components/preferences/general.js @@ -43,7 +43,6 @@ var gGeneralPane = { init: function () { this.mPane = document.getElementById("paneGeneral"); - this.startPageCheck(); this.updatePlaySound(); }, @@ -86,11 +85,6 @@ var gGeneralPane = { } }, #endif - - startPageCheck: function() - { - document.getElementById("mailnewsStartPageUrl").disabled = !document.getElementById("mailnewsStartPageEnabled").checked; - }, /** * Restores the default start page as the user's start page diff --git a/mail/components/preferences/general.xul b/mail/components/preferences/general.xul index 7155a3b8de..a586f4eeca 100644 --- a/mail/components/preferences/general.xul +++ b/mail/components/preferences/general.xul @@ -88,7 +88,7 @@