Last Comment Bug 271730 - UI elements/widgets/controls in compose window should be disabled while the message is being sent (e.g. send button, options menu and attachments pane still wrongly enabled)
: UI elements/widgets/controls in compose window should be disabled while the m...
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Message Compose Window (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Thunderbird 19.0
Assigned To: :aceman
:
Mentors:
: 461425 750059 (view as bug list)
Depends on: 798833
Blocks: 806535 431217 528793
  Show dependency treegraph
 
Reported: 2004-11-25 07:16 PST by :aceman
Modified: 2014-01-05 23:32 PST (History)
11 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
WIP patch (14.24 KB, patch)
2012-10-06 09:58 PDT, :aceman
no flags Details | Diff | Review
screenshot of disabled compose window (45.57 KB, image/png)
2012-10-06 10:25 PDT, :aceman
bwinton: feedback+
Details
patch v2 (14.17 KB, patch)
2012-10-18 11:36 PDT, :aceman
mkmelin+mozilla: review-
Details | Diff | Review
patch v3 (14.83 KB, patch)
2012-10-20 15:33 PDT, :aceman
mkmelin+mozilla: review+
Details | Diff | Review
patch v4 (14.84 KB, patch)
2012-10-21 06:42 PDT, :aceman
bwinton: ui‑review+
Details | Diff | Review
patch v5 (22.38 KB, patch)
2012-10-23 10:02 PDT, :aceman
mkmelin+mozilla: review+
bwinton: ui‑review+
Details | Diff | Review

Description :aceman 2004-11-25 07:16:01 PST
User-Agent:       Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Build Identifier: Mozilla 1.7.3

.

Reproducible: Always
Steps to Reproduce:
1.Compose a message
2.Click send
3.The progress bar window appears
4.Click into the compose window
Actual Results:  
The widgets (e.g. the sender selection box) are active and can be used.


Expected Results:  
The compose window should be disabled and do not allow the user to do anything 
to the message, while the sending is in progress.

I see this in Mozilla 1.7.3, but I couldn't find a better component than this. 
The new bugzilla categorization is strange.
Comment 1 Gervase Markham [:gerv] 2005-09-27 01:52:09 PDT
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Comment 2 Gervase Markham [:gerv] 2005-10-13 10:22:20 PDT
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Comment 3 :aceman 2008-08-30 11:40:01 PDT
I can still reproduce this with thunderbird 2.0.0.16. I don't know how serious it is. The widgets are still functional, but selecting many "dangerous" actions does nothing. E.g. clicking "attach file" does nothing. But "save attachment" seems to work, opens save file dialog. On the other hand I found a problematic case: when the message sending was at 100% I hit "save as draft". That popped up a progress bar of "copying message" which did spin forever. Nevertheless, the message was sent correctly and stored in the sent messages folder.
Comment 4 :aceman 2008-08-30 11:57:22 PDT
I forgot to add, that I had to 'cancel' the spinning dialog and then nothing was copied to the drafs folder.
Comment 5 Wayne Mery (:wsmwk, NI for questions) 2009-06-14 08:53:58 PDT
Roberto, do you also see this bug?

xref bug 461425 - while sending a message I still can attach files.
Comment 6 Roberto Zingales 2009-06-16 08:04:46 PDT
Absolutely YES, I confirm reproductibility of Bug 271730, with Thunderbird version 2.0.0.21 (20090302) Italian, under VISTA X64 OS (and 6Gigabytes of DDR3 RAM :-) 

I tested it by adding a big attachment to a message, so I had enough time to test the widgets while sending the message.
The results are : I can still change the "security" status of the message, with unpredictable results, I think. I can change the option "sign the message", or "encrypt the message". I can also press the save button, and the save dialog box shows up.

I can also still change the signature with the button of the "signature swith" add-on, and the signature seems to change on the fly, don't know with which results on the actual sent message.

I confirm that I can still add new attachments to the message while the message is already in the "sending phase"!

TIP:Under the file menu, if I press "close" (or "exit" in english, I use the italian version of thunderbird) while yet sending a message, a correct dialog box shows up alerting me that the message is in "sending phase", therefore if I close it then it would not be sent correctly.

thanks for letting me help to Thunderbird development.
Comment 7 Thomas D. (currently busy elsewhere; needinfo?me) 2010-06-19 10:23:18 PDT
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1

confirming for 3.1rc2
with same symptoms as in comment 6, it's unpredictable what will happen when user changes the mail *while* sending...
Comment 8 Thomas D. (currently busy elsewhere; needinfo?me) 2012-05-07 01:23:24 PDT
*** Bug 461425 has been marked as a duplicate of this bug. ***
Comment 9 Thomas D. (currently busy elsewhere; needinfo?me) 2012-05-07 01:54:27 PDT
*** Bug 750059 has been marked as a duplicate of this bug. ***
Comment 10 :aceman 2012-05-07 03:50:51 PDT
Is it possible to set "disabled" state on the whole window? ;)
Comment 11 :aceman 2012-10-04 17:36:45 PDT
This could be made a bit better by fixing some items. Many already base their .isEnabled on the state of !gWindowLock, that is set to true when a send/save is in progress. But many of them do not because they come from various overlays that know nothing about gWindowLock and so their .isEnabled function does not take it into account.

It is possible to unconditionally disable all 'command' elements and all elements with 'oncommand'. But then there is the problem when the send is cancelled how to enable them again. 'command's can be run through doUpdateCommand(), but I don't know what to do with the others. Refactoring all the items to use commands would be a big task and still does not catch all the overlays.

I'll need to find out some other tricks.
Comment 12 :aceman 2012-10-05 00:19:08 PDT
I mean the difficulty stems from the fact that gWindowLock facility probably wanted to achieve to allow us to selectively disable only dangerous items and leave others enabled (think Help, Prefs, Account settings, Address book). But then it does not cover overlayed items that don't get disabled.

But if bwinton/mkmelin accepts a solution that we just forcefully disable ALL menuitems+toolbabuttons (we could have enumerated exceptions, e.g. Help menu), storing their state and restore the state after send then I do not need the .isEnabled to work properly (even to exist). The we could just kill the gWindowLock facility.

What do you think?
Comment 13 :aceman 2012-10-06 09:58:13 PDT
Created attachment 668792 [details] [diff] [review]
WIP patch

So I am almost done with a WIP patch for my proposal. I could not completely remove gWindowLock, because some of the widgets still respond to clicks (e.g. the attachmentlist) even when disabled. So I've left it in so that their .isEnabled() returns false when we are in the lock mode. 
I couldn't disable the 2 text dropdowns (on HTML toolbar), they have oncommand on menupopup, not menulist...

Another thing missing is the disabling of the <editor> element, the main message body. That one doesn't have a 'disabled' property and still can be edited while the save/send progress dialog is up. It even enables buttons like Copy when a part of the text is selected. What solution would you propose for this?
As a brutal hack I collapse the editor while sending. But we need to refine that to not scare the user much :)
Comment 14 :aceman 2012-10-06 10:25:20 PDT
Created attachment 668796 [details]
screenshot of disabled compose window

I added all the available buttons from the palette. This also shows how the editor turns out when collapsed (it just gets grey and empty).
Comment 15 Mike Conley (:mconley) - (needinfo me!) 2012-10-10 23:02:22 PDT
Comment on attachment 668792 [details] [diff] [review]
WIP patch

Steal
Comment 16 Blake Winton (:bwinton) (:☕️) 2012-10-11 06:25:09 PDT
Comment on attachment 668796 [details]
screenshot of disabled compose window

That seems okay.  I don't think we want to collapse the editor, though.  The XUL editor page (https://developer.mozilla.org/en-US/docs/XUL/editor) makes me wonder if we can use "editor.contentDocument.designMode = 'off';" to prevent editing…

Other than that, it seems reasonable to me.  f+
Comment 17 Magnus Melin 2012-10-11 13:03:52 PDT
Comment on attachment 668792 [details] [diff] [review]
WIP patch

Review of attachment 668792 [details] [diff] [review]:
-----------------------------------------------------------------

Seems to have bitrotten.
Comment 18 :aceman 2012-10-11 14:09:13 PDT
Yes, the patch will be changed to not collapse the editor. See bug 798833, Neil says the editor should already get disabled (readonly) but it has a bug.
Comment 19 :aceman 2012-10-18 11:36:20 PDT
Created attachment 672878 [details] [diff] [review]
patch v2
Comment 20 Magnus Melin 2012-10-20 11:25:21 PDT
Comment on attachment 672878 [details] [diff] [review]
patch v2

Review of attachment 672878 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/components/compose/content/MsgComposeCommands.js
@@ +169,5 @@
> + * The elements to operate on are marked with the "disableonsend" attribute.
> + * This includes elements like the address list, attachment list, subject
> + * and message body.
> + *
> + * @param aLock  True = disable items. False = enable items.

True and False lowercase (here and elsewhere)

@@ +171,5 @@
> + * and message body.
> + *
> + * @param aLock  True = disable items. False = enable items.
> + */
> +function updateEditableFields(aLock)

Instead of aLock, why not use a more descriptive name, like aDisable

@@ +892,5 @@
> + */
> +function updateAllItems(aLock)
> +{
> +  let commandItems = [];
> +  appendNodes(document.getElementsByTagName("menu"), commandItems);

Relying on function side effects on in-parameters isn't good style in JavaScript.

I think appendNodes is ugly and not needed. Maybe you can use array forEach or something for the results to make it short and clean...
Comment 21 :aceman 2012-10-20 14:44:49 PDT
document.getElementsByTagName() returns an HTMLCollection, not an array, so it does not have the array functions.
Comment 22 :aceman 2012-10-20 15:33:54 PDT
Created attachment 673633 [details] [diff] [review]
patch v3

But let's try an array of HTMLCollections.
Comment 23 Magnus Melin 2012-10-21 02:34:14 PDT
Comment on attachment 673633 [details] [diff] [review]
patch v3

Review of attachment 673633 [details] [diff] [review]:
-----------------------------------------------------------------

This looks better! r=mkmelin

::: mail/components/compose/content/MsgComposeCommands.js
@@ +899,5 @@
> +          if (!commandItem.hasAttribute("stateBeforeSend")) {
> +            commandItem.setAttribute("stateBeforeSend", commandItem.disabled);
> +            commandItem.disabled = true;
> +          }
> +        } else {

else on new line
Comment 24 :aceman 2012-10-21 06:42:30 PDT
Created attachment 673686 [details] [diff] [review]
patch v4
Comment 25 Blake Winton (:bwinton) (:☕️) 2012-10-22 13:57:43 PDT
Comment on attachment 673686 [details] [diff] [review]
patch v4

># HG changeset patch
># Parent dee6670c667f5906eee09fa3f441729a1f19f45a
># User aceman <acelists@atlas.sk>
>Bug 271730 - Disable all UI elements while a message is being sent/saved in the compose window. r=mkmelin, ui-r=bwinton
>
>diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js
>--- a/mail/components/compose/content/MsgComposeCommands.js
>+++ b/mail/components/compose/content/MsgComposeCommands.js
>@@ -159,32 +159,34 @@ function ReleaseGlobalVariables()
>     gLDAPSession = null;
>     Components.utils.forceGC();
>   }
>   gCharsetConvertManager = null;
>   gMsgCompose = null;
>   gMailSession = null;
> }
> 
>-function disableEditableFields()
>+/**
>+ * Disables or enables editable elements in the window.
>+ * The elements to operate on are marked with the "disableonsend" attribute.
>+ * This includes elements like the address list, attachment list, subject
>+ * and message body.
>+ *
>+ * @param aDisable  true = disable items. false = enable items.
>+ */
>+function updateEditableFields(aDisable)
> {
>-  gMsgCompose.editor.flags |= nsIPlaintextEditorMail.eEditorReadonlyMask;
>-  var disableElements = document.getElementsByAttribute("disableonsend", "true");
>-  for (let i = 0; i < disableElements.length; i++)
>-    disableElements[i].setAttribute('disabled', 'true');
>-
>-}
>-
>-function enableEditableFields()
>-{
>-  gMsgCompose.editor.flags &= ~nsIPlaintextEditorMail.eEditorReadonlyMask;
>-  var enableElements = document.getElementsByAttribute("disableonsend", "true");
>-  for (let i = 0; i < enableElements.length; i++)
>-    enableElements[i].removeAttribute('disabled');
>-
>+  if (aDisable)
>+    gMsgCompose.editor.flags |= nsIPlaintextEditorMail.eEditorReadonlyMask;
>+  else
>+    gMsgCompose.editor.flags &= ~nsIPlaintextEditorMail.eEditorReadonlyMask;
>+
>+  let elements = document.getElementsByAttribute("disableonsend", "true");
>+  for (let i = 0; i < elements.length; i++)
>+    elements[i].disabled = aDisable;
> }
> 
> var gComposeRecyclingListener = {
>   onClose: function() {
>     //Reset recipients and attachments
>     ReleaseAutoCompleteState();
>     awResetAllRows();
>     RemoveAllAttachments();
>@@ -195,17 +197,17 @@ var gComposeRecyclingListener = {
> 
>     //Clear the subject
>     GetMsgSubjectElement().value = "";
>     // be sure to clear the transaction manager for the subject
>     GetMsgSubjectElement().editor.transactionManager.clear();
>     SetComposeWindowTitle();
> 
>     SetContentAndBodyAsUnmodified();
>-    disableEditableFields();
>+    updateEditableFields(true);
>     ReleaseGlobalVariables();
> 
>     // Clear the focus
>     awGetInputElement(1).removeAttribute('focused');
> 
>     //Reset Boxes size
>     document.getElementById("headers-box").removeAttribute("height");
>     document.getElementById("appcontent").removeAttribute("height");
>@@ -268,19 +270,17 @@ var stateListener = {
> 
>   NotifyComposeBodyReady: function() {
>     if (gMsgCompose.composeHTML)
>       loadHTMLMsgPrefs();
>     AdjustFocus();
>   },
> 
>   ComposeProcessDone: function(aResult) {
>-    gWindowLocked = false;
>-    enableEditableFields();
>-    updateComposeItems();
>+    ToggleWindowLock(false);
> 
>     if (aResult== Components.results.NS_OK)
>     {
>       if (!gAutoSaving)
>         SetContentAndBodyAsUnmodified();
> 
>       if (gCloseWindowAfterSave)
>       {
>@@ -863,21 +863,63 @@ function updateComposeItems()
>       goUpdateCommand("cmd_indent");
>       goUpdateCommand("cmd_outdent");
>       goUpdateCommand("cmd_align");
>       goUpdateCommand("cmd_smiley");
>     }
> 
>     // Options Menu
>     goUpdateCommand("cmd_spelling");
>+
>     // Workaround to update 'Quote' toolbar button. (See bug 609926.)
>     goUpdateCommand("cmd_quoteMessage");
>   } catch(e) {}
> }
> 
>+/**
>+ * Disables or restores all toolbar items (menus/buttons) in the window.
>+ *
>+ * @param aDisable  true = disable all items. false = restore items to the state
>+ *                  stored before disabling them.
>+ */
>+function updateAllItems(aDisable)
>+{
>+  // This array will contain HTMLCollection objects as members.
>+  let commandItemCollections = [];
>+  commandItemCollections.push(document.getElementsByTagName("menu"));
>+  commandItemCollections.push(document.getElementsByTagName("toolbarbutton"));
>+  commandItemCollections.push(document.getElementsByAttribute("command", "*"));
>+  commandItemCollections.push(document.getElementsByAttribute("oncommand", "*"));
>+  for each (let itemCollection in commandItemCollections) {
>+    for (let item = 0; item < itemCollection.length; item++) {
>+      let commandItem = itemCollection[item];
>+      if ("disabled" in commandItem) {
>+        if (aDisable) {
>+          // Any element can appear multiple times in the commandItemCollections
>+          // list so only act on it if we didn't already set the "stateBeforeSend"
>+          // attribute on previous visit.
>+          if (!commandItem.hasAttribute("stateBeforeSend")) {
>+            commandItem.setAttribute("stateBeforeSend", commandItem.disabled);
>+            commandItem.disabled = true;
>+          }
>+        }
>+        else {
>+          // Any element can appear multiple times in the commandItemCollections
>+          // list so only act on it if it still has the "stateBeforeSend"
>+          // attribute.
>+          if (commandItem.hasAttribute("stateBeforeSend")) {
>+            commandItem.disabled = commandItem.getAttribute("stateBeforeSend") == "true";
>+            commandItem.removeAttribute("stateBeforeSend");
>+          }
>+        }
>+      }
>+    }
>+  }
>+}
>+
> function openEditorContextMenu(popup)
> {
>   gSpellChecker.clearSuggestionsFromMenu();
>   gSpellChecker.initFromEvent(document.popupRangeParent, document.popupRangeOffset);
>   var onMisspelling = gSpellChecker.overMisspelling;
>   document.getElementById('spellCheckSuggestionsSeparator').hidden = !onMisspelling;
>   document.getElementById('spellCheckAddToDictionary').hidden = !onMisspelling;
>   document.getElementById('spellCheckIgnoreWord').hidden = !onMisspelling;
>@@ -1798,20 +1840,30 @@ function DoCommandClose()
> 
> function DoCommandPrint()
> {
>   try {
>     PrintUtils.print();
>   } catch(ex) {dump("#PRINT ERROR: " + ex + "\n");}
> }
> 
>-function ToggleWindowLock()
>+/**
>+ * Locks/Unlocks the window widgets while a message is being saved/sent.
>+ * Locking means to disable all possible items in the window so that
>+ * the user can't click/activate anything.
>+ *
>+ * @param aDisable  true = lock the window. false = unlock the window.
>+ */
>+function ToggleWindowLock(aDisable)
> {
>-  gWindowLocked = !gWindowLocked;
>-  updateComposeItems();
>+  gWindowLocked = aDisable;
>+  updateAllItems(aDisable);
>+  updateEditableFields(aDisable);
>+  if (!aDisable)
>+    updateComposeItems();
> }
> 
> /* This function will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */
> function GetArgs(originalData)
> {
>   var args = new Object();
> 
>   if (originalData == "")
>@@ -1884,17 +1936,17 @@ function ComposeFieldsReady()
>           = gMsgCompose.wrapLength;
>     }
>     catch (e) {
>       dump("### textEditor.wrapWidth exception text: " + e + " - failed\n");
>     }
>   }
>   CompFields2Recipients(gMsgCompose.compFields);
>   SetComposeWindowTitle();
>-  enableEditableFields();
>+  updateEditableFields(false);
> }
> 
> // checks if the passed in string is a mailto url, if it is, generates nsIMsgComposeParams
> // for the url and returns them.
> function handleMailtoArgs(mailtoUrl)
> {
>   // see if the string is a mailto url....do this by checking the first 7 characters of the string
>   if (/^mailto:/i.test(mailtoUrl))
>@@ -2812,23 +2864,21 @@ function GenericSendMessage(msgType)
>     event.initEvent("compose-send-message", false, true);
>     var msgcomposeWindow = document.getElementById("msgcomposeWindow");
>     msgcomposeWindow.setAttribute("msgtype", msgType);
>     msgcomposeWindow.dispatchEvent(event);
>     if (event.defaultPrevented)
>       throw Components.results.NS_ERROR_ABORT;
> 
>     gAutoSaving = (msgType == nsIMsgCompDeliverMode.AutoSaveAsDraft);
>+
>     // disable the ui if we're not auto-saving
>     if (!gAutoSaving)
>-    {
>-      gWindowLocked = true;
>-      disableEditableFields();
>-      updateComposeItems();
>-    }
>+      ToggleWindowLock(true);
>+
>     // If we're auto saving, mark the body as not changed here, and not
>     // when the save is done, because the user might change it between now
>     // and when the save is done.
>     else
>     {
>       SetContentAndBodyAsUnmodified();
>     }
> 
>@@ -2841,19 +2891,17 @@ function GenericSendMessage(msgType)
>     }
>     msgWindow.domWindow = window;
>     msgWindow.rootDocShell.allowAuth = true;
>     gMsgCompose.SendMsg(msgType, getCurrentIdentity(),
>                         getCurrentAccountKey(), msgWindow, progress);
>   }
>   catch (ex) {
>     Components.utils.reportError("GenericSendMessage FAILED: " + ex);
>-    gWindowLocked = false;
>-    enableEditableFields();
>-    updateComposeItems();
>+    ToggleWindowLock(false);
>   }
>   if (gMsgCompose && originalCharset != gMsgCompose.compFields.characterSet)
>     SetDocumentCharacterSet(gMsgCompose.compFields.characterSet);
> }
> 
> function CheckValidEmailAddress(to, cc, bcc)
> {
>   var invalidStr = null;
>diff --git a/mail/components/compose/content/addressingWidgetOverlay.js b/mail/components/compose/content/addressingWidgetOverlay.js
>--- a/mail/components/compose/content/addressingWidgetOverlay.js
>+++ b/mail/components/compose/content/addressingWidgetOverlay.js
>@@ -425,17 +425,17 @@ function awDeleteRow(rowToDelete)
>   for (var row = rowToDelete + 1; row <= maxRecipients; row ++)
>     awSetInputAndPopupId(awGetInputElement(row), awGetPopupElement(row), (row-1));
> 
>   awTestRowSequence();
> }
> 
> function awClickEmptySpace(target, setFocus)
> {
>-  if (target == null ||
>+  if (document.getElementById("addressCol2#1").disabled || target == null ||
>       (target.localName != "listboxbody" &&
>       target.localName != "listcell" &&
>       target.localName != "listitem"))
>     return;
> 
>   var lastInput = awGetInputElement(top.MAX_RECIPIENTS);
> 
>   if ( lastInput && lastInput.value )
>diff --git a/mail/components/compose/content/messengercompose.xul b/mail/components/compose/content/messengercompose.xul
>--- a/mail/components/compose/content/messengercompose.xul
>+++ b/mail/components/compose/content/messengercompose.xul
>@@ -95,16 +95,17 @@
>               oncommandupdate="goUpdatePasteMenuItems()"/>
> 
>   <commandset id="commonEditorMenuItems"/>
>   <commandset id="composerMenuItems"/>
>   <commandset id="composerEditMenuItems"/>
>   <commandset id="composerStyleMenuItems"/>
>   <commandset id="composerTableMenuItems"/>
>   <commandset id="composerListMenuItems"/>
>+
>   <!-- File Menu -->
>   <command id="cmd_new" oncommand="goDoCommand('cmd_newMessage')"/>
>   <command id="cmd_attachFile" oncommand="goDoCommand('cmd_attachFile')"/>
>   <command id="cmd_attachCloud" oncommand="attachToCloud(event.target.cloudProvider); event.stopPropagation();"/>
>   <command id="cmd_attachPage" oncommand="goDoCommand('cmd_attachPage')"/>
>   <command id="cmd_attachVCard" checked="false" oncommand="ToggleAttachVCard(event.target)"/>
>   <command id="cmd_close" oncommand="goDoCommand('cmd_close')"/>
>   <command id="cmd_saveDefault" oncommand="goDoCommand('cmd_saveDefault')"/>
>@@ -737,17 +738,17 @@
>                    command="cmd_copy"
>                    tooltiptext="&copyButton.tooltip;"/>
>     <toolbarbutton id="paste-button" class="toolbarbutton-1"
>                    label="&pasteCmd.label;"
>                    command="cmd_paste"
>                    tooltiptext="&pasteButton.tooltip;"/>
> 
>     <toolbaritem id="priority-button" align="center" pack="center">
>-      <label value="&priorityButton.label;"/>
>+      <label value="&priorityButton.label;" control="priorityMenu-button"/>
>       <menulist id="priorityMenu-button" value="Normal" oncommand="PriorityMenuSelect(event.target);">
>         <menupopup id="priorityMenu-buttonPopup">
>           <menuitem name="priority" label="&highestPriorityCmd.label;" value="Highest"  id="list_priotity_highest"/>
>           <menuitem name="priority" label="&highPriorityCmd.label;"    value="High"     id="list_priority_high"/>
>           <menuitem name="priority" label="&normalPriorityCmd.label;"  value="Normal"   id="list_priority_normal"/>
>           <menuitem name="priority" label="&lowPriorityCmd.label;"     value="Low"      id="list_priority_low"/>
>           <menuitem name="priority" label="&lowestPriorityCmd.label;"  value="Lowest"   id="list_priority_lowest"/>
>         </menupopup>
>@@ -792,23 +793,25 @@
>              ondragdrop="nsDragAndDrop.drop(event, envelopeDragObserver);"
>              ondragexit="nsDragAndDrop.dragExit(event, envelopeDragObserver);">
>       <hbox id="msgheaderstoolbar-box" flex="1">
>         <vbox flex="1" id="addresses-box">
>           <hbox id="top-gradient-box">
>             <hbox align="center" pack="end" style="&headersSpace.style;">
>               <label value="&fromAddr.label;" accesskey="&fromAddr.accesskey;" control="msgIdentity"/>
>             </hbox>
>-            <menulist id="msgIdentity" type="description" flex="1" oncommand="LoadIdentity(false);">
>+            <menulist id="msgIdentity" type="description" flex="1"
>+                      oncommand="LoadIdentity(false);" disableonsend="true">
>               <menupopup id="msgIdentityPopup"/>
>             </menulist>
>           </hbox>
>           <listbox id="addressingWidget" flex="1" seltype="multiple" rows="4"
>                    onkeydown="awKeyDown(event, this)"
>-                   onclick="awClickEmptySpace(event.originalTarget, true)">
>+                   onclick="awClickEmptySpace(event.originalTarget, true)"
>+                   disableonsend="true">
>             <listcols>
>               <listcol id="typecol-addressingWidget" style="&headersSpace.style;"/>
>               <listcol id="textcol-addressingWidget" flex="1"/>
>             </listcols>
>             <listitem class="addressingWidgetItem" allowevents="true">
>               <listcell class="addressingWidgetCell" align="stretch">
>                 <menulist id="addressCol1#1" disableonsend="true"
>                           class="aw-menulist menulist-compact" flex="1"
>@@ -853,16 +856,17 @@
>         <splitter id="attachmentbucket-sizer" collapsed="true" collapse="after"/>
>         <vbox id="attachments-box" collapsed="true" persist="width">
>           <hbox>
>             <label id="attachmentBucketCount" control="attachmentBucket"
>                    crop="right" accesskey="&attachments.accesskey;" flex="1"/>
>             <label id="attachmentBucketSize"/>
>           </hbox>
>           <attachmentlist orient="vertical" id="attachmentBucket"
>+                          disableonsend="true"
>                           seltype="multiple" flex="1" height="0"
>                           context="msgComposeAttachmentListContext"
>                           itemcontext="msgComposeAttachmentItemContext"
>                           onclick="AttachmentBucketClicked(event);"
>                           ondraggesture="nsDragAndDrop.startDrag(event, attachmentBucketDNDObserver);"/>
>         </vbox>
>       </hbox>
>     </toolbar>
Comment 26 Blake Winton (:bwinton) (:☕️) 2012-10-22 14:06:11 PDT
Ugh, bugzilla sucks.

The gist of what I was trying to write is "ui-r=me, if you also disable the HTML formatting controls."

Thanks,
Blake.
Comment 27 :aceman 2012-10-23 10:02:36 PDT
Created attachment 674262 [details] [diff] [review]
patch v5

These were a bit more questionable changes so please look at those parts again.

I fixed the 2 font formatting menus (moving the oncommand from menupopup up to menulist, but it seems to still work). - for mkmelin

And also the color picker icons (3rd item on the HTML toolbar). That one was hard, it isn't disabled even when the whole toolbar is (e.g. when cursor is not in the msg body), but that is for a different bug. But I added some new disabled style for it in the themes. - for bwinton
Comment 28 Magnus Melin 2012-10-27 11:48:02 PDT
Comment on attachment 674262 [details] [diff] [review]
patch v5

Review of attachment 674262 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good! r=mkmelin
Comment 29 Blake Winton (:bwinton) (:☕️) 2012-10-29 08:05:57 PDT
Comment on attachment 674262 [details] [diff] [review]
patch v5

ui-r=me, and thank you for this!

One thing I noticed, though, was that the toolbar was re-enabled for the "Saving to sent folder" step.  That seemed odd, and if you could fix that too, I'ld appreciate it.  (But if you wanted to do it in a separate bug, I'ld be fine with that, too.  ;)

Thanks,
Blake.
Comment 30 :aceman 2012-10-29 08:19:03 PDT
I have not noticed such a "Saving to sent folder" step. When does it happen? Is it on IMAP server?
Comment 31 Blake Winton (:bwinton) (:☕️) 2012-10-29 08:26:27 PDT
After sending.  Yes.

The message comes from mxr.mozilla.org/comm-central/source/mail/locales/en-US/chrome/messenger/messengercompose/composeMsgs.properties#112  Hopefully you can track back the usage of that identifier, to see where it's getting called.  :)

Thanks,
Blake.
Comment 32 :aceman 2012-10-29 13:32:49 PDT
It seems to be loaded here:
http://mxr.mozilla.org/comm-central/source/mailnews/compose/src/nsMsgSend.cpp#4518

A completely different c++ file where I do not know how to hook into. Off to a new bug :)
Comment 33 Ryan VanderMeulen [:RyanVM] 2012-10-30 07:14:28 PDT
https://hg.mozilla.org/comm-central/rev/1829954844d1

Note You need to log in before you can comment on or make changes to this bug.