Backout bug 609245 / changeset 9ee393ca9926 due to Windows and Mac orange. CLOSED TREE

This commit is contained in:
Mark Banner 2011-08-04 10:42:11 +01:00
Родитель f51ce851e8
Коммит bdebab7bc1
14 изменённых файлов: 71 добавлений и 293 удалений

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

@ -176,7 +176,6 @@ var DefaultController =
case "cmd_viewClassicMailLayout":
case "cmd_viewWideMailLayout":
case "cmd_viewVerticalMailLayout":
case "cmd_toggleFolderPane":
case "cmd_toggleMessagePane":
case "cmd_viewAllMsgs":
case "cmd_viewUnreadMsgs":
@ -486,7 +485,6 @@ var DefaultController =
case "cmd_viewClassicMailLayout":
case "cmd_viewWideMailLayout":
case "cmd_viewVerticalMailLayout":
case "cmd_toggleFolderPane":
case "cmd_toggleMessagePane":
// this is overridden per-mail tab
return true;
@ -720,9 +718,6 @@ var DefaultController =
case "cmd_viewVerticalMailLayout":
ChangeMailLayoutForCommand(command);
break;
case "cmd_toggleFolderPane":
MsgToggleFolderPane();
break;
case "cmd_toggleMessagePane":
MsgToggleMessagePane();
break;

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

@ -747,7 +747,6 @@ let mailTabType = {
case "cmd_viewClassicMailLayout":
case "cmd_viewWideMailLayout":
case "cmd_viewVerticalMailLayout":
case "cmd_toggleFolderPane":
case "cmd_toggleMessagePane":
return true;
@ -762,7 +761,6 @@ let mailTabType = {
case "cmd_viewClassicMailLayout":
case "cmd_viewWideMailLayout":
case "cmd_viewVerticalMailLayout":
case "cmd_toggleFolderPane":
case "cmd_toggleMessagePane":
// If the thread pane is illegal, these are all disabled
if (!aTab.mode.legalPanes.thread)

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

@ -184,18 +184,13 @@ function view_init()
var isFeed = gFolderDisplay.selectedMessageIsFeed;
let accountCentralDisplayed = gFolderDisplay.isAccountCentralDisplayed;
let messagePaneMenuItem = document.getElementById("menu_showMessage");
var messagePaneMenuItem = document.getElementById("menu_showMessage");
if (!messagePaneMenuItem.hidden) { // Hidden in the standalone msg window.
messagePaneMenuItem.setAttribute("checked",
accountCentralDisplayed ? false : gMessageDisplay.visible);
messagePaneMenuItem.disabled = accountCentralDisplayed;
}
let folderPaneMenuItem = document.getElementById("menu_showFolderPane");
if (!folderPaneMenuItem.hidden) { // Hidden in the standalone msg window.
folderPaneMenuItem.setAttribute("checked", gFolderDisplay.folderPaneVisible);
}
// Disable some menus if account manager is showing
document.getElementById("viewSortMenu").disabled = accountCentralDisplayed;
document.getElementById("viewMessageViewMenu").disabled = accountCentralDisplayed;
@ -206,6 +201,9 @@ function view_init()
var viewsToolbarButton = document.getElementById("mailviews-container");
document.getElementById('viewMessageViewMenu').hidden = !viewsToolbarButton;
// ... and also the separator.
document.getElementById("viewMenuAfterTaskbarSeparator").hidden = !viewsToolbarButton;
// Initialize the Message Body menuitem
document.getElementById('viewBodyMenu').hidden = isFeed;
@ -508,34 +506,6 @@ function InitViewBodyMenu()
}
}
/**
* Expand or collapse the folder pane.
*/
function MsgToggleFolderPane()
{
// Bail without doing anything if we are not a folder tab.
let currentTabInfo = document.getElementById("tabmail").currentTabInfo;
if (currentTabInfo.mode.name != "folder")
return;
togglePaneSplitter("folderpane_splitter");
}
/**
* Expand or collapse the message preview pane.
*/
function MsgToggleMessagePane()
{
// Bail without doing anything if we are not a folder tab.
let currentTabInfo = document.getElementById("tabmail").currentTabInfo;
if (currentTabInfo.mode.name != "folder")
return;
togglePaneSplitter("threadpane-splitter");
ChangeMessagePaneVisibility(IsMessagePaneCollapsed());
SetFocusThreadPaneIfNotOnMessagePane();
}
function SetMenuItemLabel(menuItemId, customLabel)
{
var menuItem = document.getElementById(menuItemId);

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

@ -154,7 +154,6 @@
<command id="cmd_viewClassicMailLayout" oncommand="goDoCommand('cmd_viewClassicMailLayout')" disabled="true"/>
<command id="cmd_viewWideMailLayout" oncommand="goDoCommand('cmd_viewWideMailLayout')" disabled="true"/>
<command id="cmd_viewVerticalMailLayout" oncommand="goDoCommand('cmd_viewVerticalMailLayout')" disabled="true"/>
<command id="cmd_toggleFolderPane" oncommand="goDoCommand('cmd_toggleFolderPane')" disabled="true"/>
<command id="cmd_toggleMessagePane" oncommand="goDoCommand('cmd_toggleMessagePane')" disabled="true"/>
<command id="cmd_viewAllMsgs" oncommand="goDoCommand('cmd_viewAllMsgs')" disabled="true"/>
<command id="cmd_viewUnreadMsgs" oncommand="goDoCommand('cmd_viewUnreadMsgs')" disabled="true"/>
@ -1136,7 +1135,6 @@
<menupopup id="menu_View_Popup" onpopupshowing="view_init();">
<menu id="menu_Toolbars" onpopupshowing="onViewToolbarsPopupShowing(event, 'mail-toolbox');">
<menupopup id="view_toolbars_popup">
<menuitem id="menu_showTaskbar" type="checkbox"/>
<menuseparator id="viewMenuBeforeCustomizeMailToolbarsSeparator"/>
<menuitem id="customizeMailToolbars"
command="cmd_CustomizeMailToolbar"
@ -1144,6 +1142,8 @@
accesskey="&customizeToolbar.accesskey;"/>
</menupopup>
</menu>
<menuitem id="menu_showTaskbar" type="checkbox"/>
<menuseparator id="viewMenuAfterTaskbarSeparator"/>
<menu id="menu_MessagePaneLayout" label="&messagePaneLayoutStyle.label;" accesskey="&messagePaneLayoutStyle.accesskey;">
<menupopup id="view_layout_popup" onpopupshowing="InitViewLayoutStyleMenu(event)">
<menuitem id="messagePaneClassic" type="radio" label="&messagePaneClassic.label;" name="viewlayoutgroup"
@ -1153,8 +1153,6 @@
<menuitem id="messagePaneVertical" type="radio" label="&messagePaneVertical.label;" name="viewlayoutgroup"
accesskey="&messagePaneVertical.accesskey;" command="cmd_viewVerticalMailLayout"/>
<menuseparator id="viewMenuAfterPaneVerticalSeparator"/>
<menuitem id="menu_showFolderPane" type="checkbox" label="&showFolderPaneCmd.label;"
accesskey="&showFolderPaneCmd.accesskey;" command="cmd_toggleFolderPane"/>
<menuitem id="menu_showMessage" type="checkbox" label="&showMessageCmd.label;" key="key_toggleMessagePane"
accesskey="&showMessageCmd.accesskey;" command="cmd_toggleMessagePane"/>
</menupopup>

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

@ -198,22 +198,6 @@ function goToggleToolbar( id, elementID )
}
}
/**
* Toggle a splitter to show or hide some piece of UI (e.g. the message preview
* pane).
*
* @param splitterId the splliter that should be toggled
*/
function togglePaneSplitter(splitterId)
{
var splitter = document.getElementById(splitterId);
var state = splitter.getAttribute("state");
if (state == "collapsed")
splitter.setAttribute("state", "open");
else
splitter.setAttribute("state", "collapsed")
}
// openUILink handles clicks on UI elements that cause URLs to load.
// Firefox and SeaMonkey have a function with the same name,
// so extensions can use this everywhere to open links.

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

@ -49,6 +49,22 @@ Components.utils.import("resource:///modules/MailUtils.js");
//The eventual goal is for this file to go away and its contents to be brought into
//mailWindowOverlay.js. This is currently being done.
function MsgToggleMessagePane()
{
// Bail without doing anything if we are not a folder tab.
let currentTabInfo = document.getElementById("tabmail").currentTabInfo;
if (currentTabInfo.mode.name != "folder")
return;
var splitter = document.getElementById("threadpane-splitter");
var state = splitter.getAttribute("state");
if (state == "collapsed")
splitter.setAttribute("state", "open");
else
splitter.setAttribute("state", "collapsed")
ChangeMessagePaneVisibility(IsMessagePaneCollapsed());
SetFocusThreadPaneIfNotOnMessagePane();
}
// Given a URI we would like to return corresponding message folder here.
// An additonal input param which specifies whether or not to check folder
// attributes (like if there exists a parent or is it a server) is also passed

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

@ -378,20 +378,30 @@ function AbNewMessage()
}
}
/**
* Set up items in the View > Layout menupopup. This function is responsible
* for updating the menu items' state to reflect reality.
*
* @param event the event that caused the View > Layout menupopup to be shown
*/
function InitViewLayoutMenuPopup(event) {
let dirPaneMenuItem = document.getElementById("menu_showDirectoryPane");
dirPaneMenuItem.setAttribute("checked", document.getElementById(
"dirTree-splitter").getAttribute("state") != "collapsed");
let cardPaneMenuItem = document.getElementById("menu_showCardPane");
cardPaneMenuItem.setAttribute("checked", document.getElementById(
"results-splitter").getAttribute("state") != "collapsed");
// XXX todo
// could this be moved into utilityOverlay.js?
function goToggleSplitter( id, elementID )
{
var splitter = document.getElementById( id );
var element = document.getElementById( elementID );
if ( splitter )
{
var attribValue = splitter.getAttribute("state") ;
if ( attribValue == "collapsed" )
{
splitter.setAttribute("state", "open" );
if ( element )
element.setAttribute("checked","true")
}
else
{
splitter.setAttribute("state", "collapsed");
if ( element )
element.setAttribute("checked","false")
}
document.persist(id, 'state');
document.persist(elementID, 'checked');
}
}
// Generate a list of cards from the selected mailing list

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

@ -418,10 +418,6 @@
label="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"
onpopupshowing="onViewToolbarsPopupShowing(event, 'ab-toolbox');">
<menupopup id="view_toolbars_popup">
<menuitem id="menu_showTaskbar"
label="&showTaskbarCmd.label;" accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('status-bar', 'menu_showTaskbar')"
type="checkbox" checked="true"/>
<menuseparator id="viewMenuBeforeCustomizeABToolbarsSeparator"/>
<menuitem id="customizeABToolbars"
command="cmd_CustomizeABToolbar"
@ -429,24 +425,17 @@
accesskey="&customizeToolbar.accesskey;"/>
</menupopup>
</menu>
<menu id="menu_Layout"
label="&layoutMenu.label;"
accesskey="&layoutMenu.accesskey;">
<menupopup id="view_layout_popup"
onpopupshowing="InitViewLayoutMenuPopup(event);">
<menuitem id="menu_showDirectoryPane"
label="&showDirectoryPane.label;"
accesskey="&showDirectoryPane.accesskey;"
oncommand="togglePaneSplitter('dirTree-splitter');"
checked="true" type="checkbox"/>
<menuitem id="menu_showCardPane"
label="&showContactPane2.label;"
accesskey="&showContactPane2.accesskey;"
oncommand="togglePaneSplitter('results-splitter');"
checked="true" type="checkbox"/>
</menupopup>
</menu>
<menuseparator id="viewMenuAfterLayoutSeparator"/>
<menuitem id="menu_showTaskbar"
label="&showTaskbarCmd.label;" accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('status-bar', 'menu_showTaskbar')"
type="checkbox" checked="true"/>
<menuseparator id="viewMenuAfterTaskbarSeparator"/>
<menuitem id="menu_showCardPane"
label="&showContactPane.label;"
accesskey="&showContactPane.accesskey;"
oncommand="goToggleSplitter('results-splitter', 'menu_showCardPane')"
checked="true" type="checkbox"/>
<menuseparator/>
<menu id="menu_ShowNameAs" label="&menu_ShowNameAs.label;" accesskey="&menu_ShowNameAs.accesskey;">
<menupopup id="menu_ShowNameAsPopup">
<menuitem type="radio" name="shownameas"

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

@ -440,18 +440,6 @@
accesskey="&viewToolbarsMenuNew.accesskey;"
onpopupshowing="onViewToolbarsPopupShowing(event, 'compose-toolbox');">
<menupopup id="view_toolbars_popup">
<menuitem id="menu_showFormatToolbar"
type="checkbox"
label="&showFormattingBarCmd.label;"
accesskey="&showFormattingBarCmd.accesskey;"
command="cmd_showFormatToolbar"
checked="true"/>
<menuitem id="menu_showTaskbar"
type="checkbox"
label="&showTaskbarCmd.label;"
accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('status-bar', 'menu_showTaskbar')"
checked="true"/>
<menuseparator id="viewMenuBeforeCustomizeComposeToolbarsSeparator"/>
<menuitem id="customizeComposeToolbars"
label="&customizeToolbar.label;"
@ -459,6 +447,18 @@
command="cmd_CustomizeComposeToolbar"/>
</menupopup>
</menu>
<menuitem id="menu_showFormatToolbar"
type="checkbox"
label="&showFormattingBarCmd.label;"
accesskey="&showFormattingBarCmd.accesskey;"
command="cmd_showFormatToolbar"
checked="true"/>
<menuitem id="menu_showTaskbar"
type="checkbox"
label="&showTaskbarCmd.label;"
accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('status-bar', 'menu_showTaskbar')"
checked="true"/>
<menuitem id="menu_AddressSidebar"
label="&addressSidebar.label;" accesskey="&addressSidebar.accesskey;"
key="key_addressSidebar" observes="viewAddressPicker"/>

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

@ -85,12 +85,8 @@
<!ENTITY showTaskbarCmd.accesskey "S">
<!ENTITY customizeToolbar.label "Customize…">
<!ENTITY customizeToolbar.accesskey "C">
<!ENTITY layoutMenu.label "Layout">
<!ENTITY layoutMenu.accesskey "L">
<!ENTITY showDirectoryPane.label "Directory Pane">
<!ENTITY showDirectoryPane.accesskey "D">
<!ENTITY showContactPane2.label "Contact Pane">
<!ENTITY showContactPane2.accesskey "C">
<!ENTITY showContactPane.label "Contact Summary Pane">
<!ENTITY showContactPane.accesskey "C">
<!ENTITY menu_ShowNameAs.label "Show Name As">
<!ENTITY menu_ShowNameAs.accesskey "n">
<!ENTITY firstLastCmd.label "First, Last">

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

@ -132,8 +132,6 @@
<!ENTITY messagePaneWide.accesskey "W">
<!ENTITY messagePaneVertical.label "Vertical View">
<!ENTITY messagePaneVertical.accesskey "V">
<!ENTITY showFolderPaneCmd.label "Folder Pane">
<!ENTITY showFolderPaneCmd.accesskey "F">
<!ENTITY showMessageCmd.label "Message Pane">
<!ENTITY showMessageCmd.accesskey "M">

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

@ -1,145 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Thunderbird Mail Client.
*
* The Initial Developer of the Original Code is
* the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jim Porter <squibblyflabbetydoo@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Tests for the address book.
*/
var MODULE_NAME = "test-address-book-panes";
var RELATIVE_ROOT = "../shared-modules";
var MODULE_REQUIRES = ["address-book-helpers"];
function setupModule(module) {
let abh = collector.getModule("address-book-helpers");
abh.installInto(module);
// Open the address book main window
abController = open_address_book_window();
}
/**
* Helper function to toggle a pane.
*
* @param splitterId the id of the splitter to toggle
*/
function _help_toggle_pane(splitterId) {
abController.window.togglePaneSplitter(splitterId);
}
/**
* Helper function to check consistency of a pane's state.
*
* @param paneId the id of the pane in question
* @param menuitemId the id of the menuitem corresponding to the pane
* @param visible true if the pane should be visible, false otherwise
*/
function _help_assert_pane_visibility(paneId, menuitemId, visible) {
if (abController.e(paneId).collapsed == visible)
throw new Error(paneId+" pane should be " +
(visible ? "visible" : "hidden"));
abController.window.InitViewLayoutMenuPopup();
if ((abController.e(menuitemId).getAttribute("checked") == "true") != visible)
throw new Error(menuitemId+" menuitem should be " +
(visible ? "checked" : "unchecked"));
}
/**
* Toggle the directory pane.
*/
function toggle_directory_pane() {
_help_toggle_pane("dirTree-splitter");
}
/**
* Toggle the contact pane.
*/
function toggle_contact_pane() {
_help_toggle_pane("results-splitter");
}
/**
* Check that the directory pane is visible or hidden.
*
* @param visible true if the pane should be visible, false otherwise
*/
function assert_directory_pane_visibility(visible) {
_help_assert_pane_visibility("dirTreeBox", "menu_showDirectoryPane", visible);
}
/**
* Check that the contact pane is visible or hidden.
*
* @param visible true if the pane should be visible, false otherwise
*/
function assert_contact_pane_visibility(visible) {
_help_assert_pane_visibility("CardViewOuterBox", "menu_showCardPane",
visible);
}
function test_hide_directory_pane() {
toggle_directory_pane();
assert_directory_pane_visibility(false);
}
function test_show_directory_pane() {
toggle_directory_pane();
assert_directory_pane_visibility(true);
}
function test_hide_contact_pane() {
toggle_contact_pane();
assert_contact_pane_visibility(false);
}
function test_show_contact_pane() {
toggle_contact_pane();
assert_contact_pane_visibility(true);
}
function test_persist_panes() {
toggle_directory_pane();
toggle_contact_pane();
close_address_book_window(abController);
abController = open_address_book_window();
assert_directory_pane_visibility(false);
assert_contact_pane_visibility(false);
}

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

@ -74,13 +74,6 @@ function assert_folder_pane_visible() {
// - the folder pane splitter should not be collapsed
if (mc.e("folderpane_splitter").collapsed === true)
throw new Error("folderpane_splitter should not be collapsed!");
// - the menu item should be checked
// force the view menu to update.
mc.window.view_init();
let paneMenuItem = mc.e("menu_showFolderPane");
if (paneMenuItem.getAttribute("checked") != "true")
throw new Error("The Folder Pane menu item should be checked.");
}
/**
@ -99,22 +92,15 @@ function assert_folder_pane_hidden(aFolderPaneIllegal) {
if (mc.e("folderPaneBox").collapsed === false)
throw new Error("folderPaneBox should be collapsed!");
// force the view menu to update.
mc.window.view_init();
let paneMenuItem = mc.e("menu_showFolderPane");
// - the folder pane splitter should or should not be collapsed, depending on
// aFolderPaneIllegal
if (aFolderPaneIllegal) {
if (mc.e("folderpane_splitter").collapsed === false)
throw new Error("folderpane_splitter should be collapsed!");
if (paneMenuItem.disabled)
throw new Error("The Folder Pane menu item should be disabled.");
}
else {
if (mc.e("folderpane_splitter").collapsed === true)
throw new Error("folderpane_splitter should not be collapsed!");
if (paneMenuItem.getAttribute("checked") == "true")
throw new Error("The Folder Pane menu item should not be checked.");
}
}

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

@ -52,11 +52,8 @@ Cu.import("resource:///modules/Services.jsm");
var collectedAddresses;
var abController;
var windowHelper;
function setupModule() {
windowHelper = collector.getModule("window-helpers");
// Ensure all the directories are initialised.
MailServices.ab.directories;
collectedAddresses = MailServices.ab
@ -70,7 +67,6 @@ function installInto(module) {
module.ensure_card_exists = ensure_card_exists;
module.ensure_no_card_exists = ensure_no_card_exists;
module.open_address_book_window = open_address_book_window;
module.close_address_book_window = close_address_book_window;
module.create_mork_address_book = create_mork_address_book;
module.create_ldap_address_book = create_ldap_address_book;
module.create_contact = create_contact;
@ -164,22 +160,9 @@ function get_cards_in_all_address_books_for_email(aEmailAddress)
function open_address_book_window()
{
abController = mozmill.getAddrbkController();
windowHelper.augment_controller(abController);
return abController;
}
/**
* Closes the address book interface
* @param abc the controller for the address book window to close
* @return the result from wait_for_window_close
*/
function close_address_book_window(abc)
{
windowHelper.plan_for_window_close(abc);
abc.window.close();
return windowHelper.wait_for_window_close(abc);
}
/**
* Creates and returns a Mork-backed address book.
* @param aName the name for the address book