Closed Bug 308555 Opened 19 years ago Closed 2 years ago

Move Account Settings to the Mac OS X application menu

Categories

(Thunderbird :: Mail Window Front End, enhancement)

All
macOS
enhancement
Not set
normal

Tracking

(thunderbird_esr91 unaffected)

RESOLVED FIXED
100 Branch
Tracking Status
thunderbird_esr91 --- unaffected

People

(Reporter: mscott, Assigned: Paenglab)

References

(Blocks 1 open bug)

Details

(Keywords: uiwanted)

Attachments

(2 files, 5 obsolete files)

It'd be nice if the account settings menu under Tools was moved to the
application men on Mac OS X next to the Preferences menu item.

I saw that Asaf had a similar patch for the update menu item for Firefox and
Thunderbird so maybe it wouldn't be hard to do this.

I'll cc him in case he's interested in working on this. Unlike the update menu
case, this menu item is completely static :)
Target Milestone: --- → Thunderbird1.1
Scott, is it really important for 1.5? We have plans to make it possible (i.e.
without really evil hacks) in the 1.9 timeframe.
Assignee: mscott → bugs.mano
then it can wait, it looked like a small change to the menu os x toolbar code
based on the update change which is why i wanted to through it outthere. 
Target Milestone: Thunderbird1.1 → Thunderbird2.0
Also, don't we have a bug on moving the account setting to the Preferences
window? this is the right approach imho.
I was confused by the last comment, what's the right approach? What was going on
in the check for updates patch or something different during the 1.9 time frame? 
The update patch (other than being very static ;) ) makes widget/ depend on Fx's
and Tbird's XUL, this kind of approach might be OK for the branch, only.

By "Right approach", I referred to mereging the Account Settings prefs into the
main preferences window, assuming it was already in the 2.0 bucket...
OS: Windows XP → MacOS X
Hardware: PC → Macintosh
I wouldn't be adverse to a branch only patch to move it over for the branch.

I would love to have the acocunt manager and options dialog merged of course.
Hopefully that will happen one day if we can get enough UI design work done for 2.0.
Target Milestone: Thunderbird2.0 → Thunderbird 3
QA Contact: front-end
Bryan, thoughts?
Flags: wanted-thunderbird3?
Keywords: uiwanted
I think this can only be done in widget/src/cocoa. Fwiw, Mail has account settings in the main prefs.
Hardware: PowerPC → All
Until somebody implements the right approach, could we please have what the title of this suggests implemented? That doesn't seem to involve much work, and would certainly make layout of Thunderbird menu in OS X more logical.
I am sure patches would be welcome
Severity: normal → enhancement
(In reply to comment #10)
> Until somebody implements the right approach, could we please have what the
> title of this suggests implemented? That doesn't seem to involve much work, and

The application menu is done by the widget code in mozilla-central. Iirc, you'd need to modify the widget code to handle a new xul menuitem. So, it is some work and I also beleive that the current implementation needs a re-write in order to become more generic.
Flags: wanted-thunderbird3?
Blocks: tb-mac
Assignee: asaf → nobody

Is this something we want to do?

Some time ago I tried this. Then it worked besides the issue that in composer the Tools menu is shown but empty.

I had to update the patch and it is now untested because I'd have to change from artifact builds to normal builds.

Alessandro, what do you think about this?

Attachment #9222756 - Flags: feedback?(alessandro)

Remove the menuseparator in our menu.

Assignee: nobody → richard.marti

I did now a full build and found a build issue. Fixed now.

M-C did some changes in Mac menu. Now in Composer the Tools still has the AM menuitem, probably because it's the only item in this menu. The Address Book doesn't have this item because it has other menu items in it.

The problem I have is that the item is now in the application menu but it doesn't open the AM.

Mark, I know you have asked for this change sometime ago. I don't know how to make this working on Mac I've never programmed on Mac. Maybe you can help? The skeleton is done and hopefully only a fine tuning is needed.

Attachment #9222756 - Attachment is obsolete: true
Attachment #9222756 - Flags: feedback?(alessandro)
Attachment #9222777 - Flags: feedback?(standard8)
Attachment #9222777 - Flags: feedback?(alessandro)

I'm okay with having the Account Settings menu in the macos Application menu.
I'm not sure I'd be too helpful in reviewing it unfortunately.

Attachment #9222777 - Attachment is patch: true
Attachment #9222777 - Flags: feedback?(alessandro) → feedback+
Comment on attachment 9222777 [details] [diff] [review]
308555-mac-move-account-settings.patch for M-C

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

I'm sorry for having not got back to this much sooner...

The patch seems to work, but fails to call `MsgAccountManager()` from the hidden window because accountUtils.js isn't loaded in there:

`JavaScript error: chrome://messenger/content/hiddenWindowMac.xhtml, line 1: ReferenceError: MsgAccountManager is not defined`

You can also see this without the patch if you minimise any Thunderbird windows and then go to Tools -> Account Settings.

Unfortunately we can't simply add accountUtils.js to be loaded via hiddenWindowMac.xhtml, because it assumes there's a full message window loaded and hence fails. Probably the best alternative would be to add a function to hiddenWindowMac.js that locates the most recently used window (or opens a new one) and calls `window.MsgAccountManager(null)` on that instead.

Not sure if you've done that before, but something similar to this:

https://searchfox.org/comm-central/rev/44aa77c6da7c13b659667b96eb3c149e2096d0f1/mail/base/content/aboutDialog.js#106-128

One comment in-line, not sure if that's necessary to make the patch work, but probably helps with memory leaks maybe.

::: widget/cocoa/nsMenuBarX.mm
@@ +106,5 @@
>    }
>    if (sQuitItemContent == mQuitItemContent) {
>      sQuitItemContent = nullptr;
>    }
> +  if (sPrefItemContent == mAccountItemContent) {

Should be `sAccountItemContent`
Attachment #9222777 - Flags: feedback?(standard8) → feedback+
Attached file M-C-part (obsolete) —
Attachment #9222777 - Attachment is obsolete: true

Alex, please could have a look what is wrong/missing?

When I remove the "get selected folder" part (https://searchfox.org/comm-central/source/mailnews/base/prefs/content/accountUtils.js#157-170) the Account Manager tab opens. So it is not an issue of not finding the window.

With adding folderPane.js to the hiddenWindowMac.xhtml I advanced a bit. But now I get a accountManager is undefined error in mailWindowOverlay.js. I thought it is defined from other files but it seems not. So what am I missing here?

Attachment #9222757 - Attachment is obsolete: true
Flags: needinfo?(alessandro)

I haven't tested this thoroughly because I can't do a full build on macOS, but I don't think adding accountUtils.js and folderPane.js to the hiddenWindowMac.xhtml is correct. As Mark said, those files assume that a window is always available so this wouldn't work.

Did you try following the suggestion from Mark by using something similar to this method? https://searchfox.org/comm-central/rev/44aa77c6da7c13b659667b96eb3c149e2096d0f1/mail/base/content/aboutDialog.js#106-128
I think something like that should be used in a new function inside hiddenWindowMac.js.

Flags: needinfo?(alessandro)

As I wrote already this seems not to be a problem of a not available window, the menu is shown when the window is active. Without the "get selected folder" part it works. It seems when this part runs it can't get the needed information, but why?

When I add accountUtils.js and folderPane.js it goes further but is now stuck on "accountManager is undefined".

This is all I can do with my knowledge. Maybe someone other can go further with my patches.

Assignee: richard.marti → nobody

(In reply to Richard Marti (:Paenglab) from comment #22)

As I wrote already this seems not to be a problem of a not available window, the menu is shown when the window is active. Without the "get selected folder" part it works. It seems when this part runs it can't get the needed information, but why?

I believe the menu bar is actually formed in the hidden window - on Mac this is a window that's there all the time in the background but you never see any UI for it. So when you minimise Thunderbird or have no other Thunderbird windows open, the hidden window is there and gives you access to the menu bar.

When I add accountUtils.js and folderPane.js it goes further but is now stuck on "accountManager is undefined".

The problem with adding those scripts, is that you're then trying to run them in the hidden window. The hidden window doesn't have most of the chrome UI and js that the main window has. So for example there is no folder pane to find the selected folder.

If let mainWindow = Services.wm.getMostRecentBrowserWindow(); returns a window (vs undefined) that window will be the most recently touched main window by the user.

mainWindow.focus();
mainWindow.MsgAccountManager();

This should then focus it & open the account manager - you might need to check if it un-minimises as well, I think it will.

(note: getMostRecentBrowserWindow() is a shorthand for getMostRecentWindow("mail:3pane");.

If mainWindow doesn't exist, then we need to open one. Based on the combination of those two code snippets, I think this would work:

  window.openDialog(
    "chrome://messenger/content/messenger.xhtml",
    "_blank",
    "chrome,dialog=no,all",
    null,
    {
      tabType: "contentTab",
      tabParams: { url: "about:accountsettings" },
    }
  );
Blocks: 1737172
Depends on: 1758360
No longer blocks: 1737172

Richard, I've just posted a patch on bug 1758360 to fix opening of the account settings menu when no other window is open. This also fixes it for when this patch displays it in the application menu. It can land independently of this bug, since it fixes its own issue, hence I separated it out.

Do you think you could drive the m-c patch in? My only comment is that I think Account Settings should be below the Settings option in the menu.

Flags: needinfo?(richard.marti)

(In reply to Mark Banner (:standard8) from comment #24)

Do you think you could drive the m-c patch in? My only comment is that I think Account Settings should be below the Settings option in the menu.

I can do this. With your patch there is probably only a change in messengercompose.xhtml needed. But then we have an empty Tools menu in composer (if I remember correctly when I built this last time. I do normally artifact builds because full builds are too slow on my Mac).

Alex, would it be okay when this lands on M-C and we have an entry in Thunderbird and Tools menu in composer after the M-C check-in?
We now have the AM entry everywhere above the Settings entry. Should we move it below in the Thunderbird menu only like Mark proposes?

Flags: needinfo?(richard.marti) → needinfo?(alessandro)

My only comment is that I think Account Settings should be below the Settings option in the menu

When you say "option menu" do you mean the macOS menu that opens up when you click on "Thunderbird", or do you mean the main app menu?
If it's in the Thunderbird Menu, I think it makes sense.

Flags: needinfo?(alessandro)
Assignee: nobody → richard.marti
Status: NEW → ASSIGNED
Attachment #9260466 - Attachment is obsolete: true
Keywords: leave-open
Target Milestone: Thunderbird 3 → 99 Branch
Pushed by richard.marti@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f6a476e4ef2d
On Mac move the "Account Settings" menuitem to the Thunderbird menu. r=mstange
Target Milestone: 99 Branch → 100 Branch
Attachment #9260472 - Attachment is obsolete: true

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/3a8886dac372
Hide the Account Settings in composer Tools menu. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Regressions: 1759280
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: