diff --git a/mozilla/mail/app/profile/mailnews.js b/mozilla/mail/app/profile/mailnews.js index cadf6850d79..1d390b43b5d 100644 --- a/mozilla/mail/app/profile/mailnews.js +++ b/mozilla/mail/app/profile/mailnews.js @@ -128,6 +128,7 @@ pref("mail.strictly_mime_headers", true); pref("mail.file_attach_binary", false); pref("mail.show_headers", 1); // some pref("mail.pane_config", 0); +pref("mail.pane_config.dynamic", 0); // new pref used for dynamic pane configuration pref("mail.addr_book.mapit_url.format", "chrome://messenger-region/locale/region.properties"); // the format for "mail.addr_book.quicksearchquery.format" is: @@ -290,12 +291,6 @@ pref("mailnews.start_page.enabled", true); pref("mailnews.remember_selected_message", true); -pref("mail.toolbars.showbutton.file", true); -pref("mail.toolbars.showbutton.next", true); -pref("mail.toolbars.showbutton.junk", true); -pref("mail.toolbars.showbutton.print", true); -pref("mail.toolbars.showbutton.stop", true); - pref("mailnews.account_central_page.url", "chrome://messenger/locale/messenger.properties"); /* default prefs for Mozilla 5.0 */ diff --git a/mozilla/mail/base/content/aboutDialog.xul b/mozilla/mail/base/content/aboutDialog.xul index b4bfc66952e..4185abbdc33 100644 --- a/mozilla/mail/base/content/aboutDialog.xul +++ b/mozilla/mail/base/content/aboutDialog.xul @@ -47,6 +47,7 @@ diff --git a/mozilla/mail/base/content/commandglue.js b/mozilla/mail/base/content/commandglue.js index 2fd9b85085d..5965959b9e7 100644 --- a/mozilla/mail/base/content/commandglue.js +++ b/mozilla/mail/base/content/commandglue.js @@ -621,7 +621,7 @@ function CreateDBView(msgFolder, viewType, viewFlags, sortType, sortOrder) // based on the collapsed state of the thread pane/message pane splitter, // suppress message display if appropriate. - gDBView.suppressMsgDisplay = IsThreadAndMessagePaneSplitterCollapsed(); + gDBView.suppressMsgDisplay = IsMessagePaneCollapsed(); UpdateSortIndicators(gCurSortType, sortOrder); } @@ -658,8 +658,13 @@ function GetSelectedFolderResource() return GetFolderResource(folderTree, startIndex.value); } -function NotifyChangedMessagePaneVisibility(now_hidden) +function ChangeMessagePaneVisibility(now_hidden) { + if (gDBView) { + // the collapsed state is the state after we released the mouse + // so we take it as it is + gDBView.suppressMsgDisplay = now_hidden; + } var event = document.createEvent('Events'); if (now_hidden) { event.initEvent('messagepane-hide', false, true); @@ -674,11 +679,7 @@ function OnMouseUpThreadAndMessagePaneSplitter() { // the collapsed state is the state after we released the mouse // so we take it as it is - var now_hidden = IsThreadAndMessagePaneSplitterCollapsed(); - if (gDBView) { - gDBView.suppressMsgDisplay = now_hidden; - } - NotifyChangedMessagePaneVisibility(now_hidden); + ChangeMessagePaneVisibility(IsMessagePaneCollapsed()); } function FolderPaneSelectionChange() diff --git a/mozilla/mail/base/content/mailTasksOverlay.xul b/mozilla/mail/base/content/mailTasksOverlay.xul index c27c0ae3431..06cd42a1647 100644 --- a/mozilla/mail/base/content/mailTasksOverlay.xul +++ b/mozilla/mail/base/content/mailTasksOverlay.xul @@ -14,19 +14,7 @@ // which is included by most clients. function toMessengerWindow() { - var pref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - var windowDoc = "chrome://messenger/content/messenger.xul"; - try - { - var layoutType = pref.getIntPref("mail.pane_config"); - windowDoc = !layoutType ? "chrome://messenger/content/messenger.xul" : - "chrome://messenger/content/mail3PaneWindowVertLayout.xul"; - } - catch(ex) - { - } - toOpenWindowByType("mail:3pane", windowDoc); + toOpenWindowByType("mail:3pane", "chrome://messenger/content/"); } function toAddressBook() diff --git a/mozilla/mail/base/content/mailWindow.js b/mozilla/mail/base/content/mailWindow.js index 517f5a0fe58..076085b0e92 100644 --- a/mozilla/mail/base/content/mailWindow.js +++ b/mozilla/mail/base/content/mailWindow.js @@ -58,12 +58,8 @@ var folderDataSource; var accountCentralBox = null; var gSearchBox = null; -var gThreadPane = null; -var gThreadPaneSplitter = null; -var gMessagePaneBox = null; var gAccountCentralLoaded = false; var gFakeAccountPageLoaded = false; -var gPaneConfig = null; //End progress and Status variables // for checking if the folder loaded is Draft or Unsent which msg is editable @@ -188,10 +184,6 @@ function CreateMailWindowGlobals() accountCentralBox = document.getElementById("accountCentralBox"); gSearchBox = document.getElementById("searchBox"); - gThreadPane = document.getElementById("threadTree"); - gThreadPaneSplitter = document.getElementById("threadpane-splitter"); - gMessagePaneBox = document.getElementById("messagepanebox"); - gPaneConfig = pref.getIntPref("mail.pane_config"); } function InitMsgWindow() @@ -496,26 +488,19 @@ function loadStartPage() { // Load iframe in the AccountCentral box with corresponding page function ShowAccountCentral() { - var acctCentralPage = pref.getComplexValue("mailnews.account_central_page.url", - Components.interfaces.nsIPrefLocalizedString).data; - gSearchBox.setAttribute("collapsed", "true"); - gThreadPane.setAttribute("collapsed", "true"); - gMessagePaneBox.setAttribute("collapsed", "true"); - accountCentralBox.removeAttribute("collapsed"); - window.frames["accountCentralPane"].location = acctCentralPage; - gAccountCentralLoaded = true; - try { - switch (gPaneConfig) - { - case 0: - break; - - case 1: - gThreadPaneSplitter.setAttribute("collapsed", "true"); - break; - } + var acctCentralPage = pref.getComplexValue("mailnews.account_central_page.url", + Components.interfaces.nsIPrefLocalizedString).data; + GetMessagePane().collapsed = true; + document.getElementById("threadpane-splitter").collapsed = true; + gSearchBox.collapsed = true; + GetThreadTree().collapsed = true; + document.getElementById("accountCentralBox").collapsed = false; + window.frames["accountCentralPane"].location = acctCentralPage; + if (!IsFolderPaneCollapsed()) + GetFolderTree().focus(); + gAccountCentralLoaded = true; } catch (ex) { @@ -529,24 +514,16 @@ function ShowAccountCentral() // box and display message box. function HideAccountCentral() { - gSearchBox.removeAttribute("collapsed"); - gThreadPane.removeAttribute("collapsed"); - gMessagePaneBox.removeAttribute("collapsed"); - accountCentralBox.setAttribute("collapsed", "true"); - window.frames["accountCentralPane"].location = "about:blank"; - gAccountCentralLoaded = false; - try { - switch (gPaneConfig) - { - case 0: - break; - - case 1: - gThreadPaneSplitter.removeAttribute("collapsed"); - break; - } + window.frames["accountCentralPane"].location = "about:blank"; + document.getElementById("accountCentralBox").collapsed = true; + GetThreadTree().collapsed = false; + gSearchBox.collapsed = false; + var threadPaneSplitter = document.getElementById("threadpane-splitter"); + threadPaneSplitter.collapsed = false; + GetMessagePane().collapsed = threadPaneSplitter.getAttribute("state") == "collapsed"; + gAccountCentralLoaded = false; } catch (ex) { @@ -635,42 +612,3 @@ function SetKeywords(aKeywords) // cache the keywords gLastKeywords = aKeywords; } - -function ShowHideToolBarButtons() -{ - return; -} - -function AddToolBarPrefListener() -{ - try { - var pbi = pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal); - pbi.addObserver(gMailToolBarPrefListener.domain, gMailToolBarPrefListener, false); - } catch(ex) { - dump("Failed to observe prefs: " + ex + "\n"); - } -} - -function RemoveToolBarPrefListener() -{ - try { - var pbi = pref.QueryInterface(Components.interfaces.nsIPrefBranchInternal); - pbi.removeObserver(gMailToolBarPrefListener.domain, gMailToolBarPrefListener); - } catch(ex) { - dump("Failed to remove pref observer: " + ex + "\n"); - } -} - -// Pref listener constants -const gMailToolBarPrefListener = -{ - domain: "mail.toolbars.showbutton", - observe: function(subject, topic, prefName) - { - // verify that we're changing a button pref - if (topic != "nsPref:changed") - return; - - document.getElementById("button-" + prefName.substr(this.domain.length+1)).hidden = !(pref.getBoolPref(prefName)); - } -}; diff --git a/mozilla/mail/base/content/mailWindowOverlay.js b/mozilla/mail/base/content/mailWindowOverlay.js index a7431ba9dec..e7dccf02a9e 100644 --- a/mozilla/mail/base/content/mailWindowOverlay.js +++ b/mozilla/mail/base/content/mailWindowOverlay.js @@ -169,7 +169,8 @@ function view_init() { var message_menuitem_hidden = message_menuitem.getAttribute("hidden"); if(message_menuitem_hidden != "true"){ - message_menuitem.setAttribute('checked',!IsThreadAndMessagePaneSplitterCollapsed()); + message_menuitem.setAttribute('checked', !IsMessagePaneCollapsed()); + message_menuitem.setAttribute('disabled', gAccountCentralLoaded); } } @@ -1100,12 +1101,8 @@ function MsgOpenNewWindowForFolder(uri, key) // will return the message that is highlighted. uriToOpen = GetSelectedFolderURI(); - if (uriToOpen) { - // get the messenger window open service and ask it to open a new window for us - var mailWindowService = Components.classes["@mozilla.org/messenger/windowservice;1"].getService(Components.interfaces.nsIMessengerWindowService); - if (mailWindowService) - mailWindowService.openMessengerWindowWithUri("mail:3pane", uriToOpen, keyToSelect); - } + if (uriToOpen) + window.openDialog("chrome://messenger/content/", "_blank", "chrome,all,dialog=no", uriToOpen, keyToSelect); } // passing in the view, so this will work for search and the thread pane diff --git a/mozilla/mail/base/content/messageWindow.js b/mozilla/mail/base/content/messageWindow.js index 3dd01d62e9a..59903cb1633 100644 --- a/mozilla/mail/base/content/messageWindow.js +++ b/mozilla/mail/base/content/messageWindow.js @@ -255,8 +255,6 @@ function delayedOnLoadMessageWindow() AddMailOfflineObserver(); CreateMailWindowGlobals(); CreateMessageWindowGlobals(); - AddToolBarPrefListener(); - ShowHideToolBarButtons() verifyAccounts(null); InitMsgWindow(); @@ -477,7 +475,6 @@ function HideMenus() function OnUnloadMessageWindow() { - RemoveToolBarPrefListener(); // FIX ME - later we will be able to use onunload from the overlay OnUnloadMsgHeaderPane(); diff --git a/mozilla/mail/base/content/messenger.xul b/mozilla/mail/base/content/messenger.xul index ba7097ade31..cf19642f7e3 100644 --- a/mozilla/mail/base/content/messenger.xul +++ b/mozilla/mail/base/content/messenger.xul @@ -94,7 +94,6 @@ events="focus" oncommandupdate="FocusRingUpdate_Mail()"/> - @@ -104,7 +103,6 @@ - @@ -140,14 +138,19 @@ - - + + + + + + + - - - - -