From e5d9cf750e7024e0e39d26e597da948fd958fec9 Mon Sep 17 00:00:00 2001 From: "bugzilla%arlen.demon.co.uk" Date: Tue, 5 Apr 2005 16:57:47 +0000 Subject: [PATCH] Bug 288366 Port Thunderbird's View Layout to MailNews - also removed unused function, changed observes= to command= on menuitems, switched to using broadcasters to hide menus and disable keys not needed in messageWindow.xul and fixed a problem when a single message is not selected when switching between views. p=me r=neil.parkwaycc.co.uk sr=bienvenu --- .../content/mail3PaneWindowVertLayout.xul | 4 +- .../resources/content/mailWindowOverlay.js | 17 ++ .../resources/content/mailWindowOverlay.xul | 264 ++++++++++-------- .../base/resources/content/messageWindow.js | 72 ----- .../base/resources/content/messageWindow.xul | 4 +- mailnews/base/resources/content/messenger.xul | 4 +- .../resources/content/msgMail3PaneWindow.js | 8 +- .../base/resources/locale/en-US/messenger.dtd | 9 + 8 files changed, 176 insertions(+), 206 deletions(-) diff --git a/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul b/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul index 869b51fbe919..9aa9335d1215 100644 --- a/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul +++ b/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul @@ -113,6 +113,8 @@ + + @@ -140,7 +142,7 @@ + command="cmd_createFilterFromPopup"/> diff --git a/mailnews/base/resources/content/mailWindowOverlay.js b/mailnews/base/resources/content/mailWindowOverlay.js index e0c6a5f8e2f9..a91656a924f1 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.js +++ b/mailnews/base/resources/content/mailWindowOverlay.js @@ -49,6 +49,10 @@ const MSG_FLAG_MDN_REPORT_SENT = 0x800000; const MDN_DISPOSE_TYPE_DISPLAYED = 0; const MSG_DB_LARGE_COMMIT = 1; +const kClassicMailLayout = 0; +const kWideMailLayout = 1; +const kVerticalMailLayout = 2; + var gMessengerBundle; var gPromptService; var gOfflinePromptsBundle; @@ -185,6 +189,14 @@ function view_init() document.commandDispatcher.updateCommands('create-menu-view'); } +function InitViewLayoutStyleMenu(event) +{ + var paneConfig = GetMailPaneConfig(); + var layoutStyleMenuitem = event.target.childNodes[paneConfig]; + if (layoutStyleMenuitem) + layoutStyleMenuitem.setAttribute("checked", "true"); +} + function setSortByMenuItemCheckState(id, value) { var menuitem = document.getElementById(id); @@ -1437,6 +1449,11 @@ function MsgApplyFilters() filterService.applyFiltersToFolders(tempFilterList, selectedFolders, msgWindow); } +function ChangeMailLayout(newLayout) +{ + gPrefBranch.setIntPref("mail.pane_config.dynamic", newLayout); +} + function MsgViewAllHeaders() { gPrefBranch.setIntPref("mail.show_headers",2); diff --git a/mailnews/base/resources/content/mailWindowOverlay.xul b/mailnews/base/resources/content/mailWindowOverlay.xul index e3f4e7bc9c01..1c991f09695f 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.xul +++ b/mailnews/base/resources/content/mailWindowOverlay.xul @@ -374,8 +374,8 @@ - - + + @@ -569,38 +569,38 @@ type="radio" checked="false" accesskey="&labelCmd0.accesskey;" - observes="cmd_label0"/> + command="cmd_label0"/> + command="cmd_label1"/> + command="cmd_label2"/> + command="cmd_label3"/> + command="cmd_label4"/> + command="cmd_label5"/> @@ -609,37 +609,37 @@ type="checkbox" label="&markAsReadCmd.label;" accesskey="&markAsReadCmd.accesskey;" - observes="cmd_markAsRead"/> + command="cmd_markAsRead"/> + command="cmd_markThreadAsRead"/> + command="cmd_markAllRead"/> + command="cmd_markAsFlagged"/> + command="cmd_markAsJunk"/> + command="cmd_markAsNotJunk"/> - - + + + command="cmd_search"/> + command="cmd_label0"/> + command="cmd_label1"/> + command="cmd_label2"/> + command="cmd_label3"/> + command="cmd_label4"/> + command="cmd_label5"/> @@ -953,29 +953,29 @@ type="checkbox" label="&markAsReadCmd.label;" accesskey="&markAsReadCmd.accesskey;" - observes="cmd_markAsRead"/> + command="cmd_markAsRead"/> + command="cmd_markThreadAsRead"/> + command="cmd_markAllRead"/> + command="cmd_markAsFlagged"/> + command="cmd_markAsJunk"/> + command="cmd_markAsNotJunk"/> @@ -1052,7 +1052,7 @@ @@ -1066,17 +1066,17 @@ + command="cmd_saveAsFile"/> + command="cmd_saveAsTemplate"/> + command="cmd_getNewMessages"/> + command="cmd_getNewMessages"> + command="cmd_getMsgsForAuthAccounts"/>