Closed Bug 255560 Opened 20 years ago Closed 19 years ago

[Mac] should allow Thunderbird to become the default email/news/feed aggregator application

Categories

(Thunderbird :: Preferences, defect, P2)

PowerPC
macOS
defect

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird1.1

People

(Reporter: CaptainN, Assigned: asaf)

References

Details

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3

There should be a "Use Thunderbird as the default mail application" check box in
Mail & Newsgroups preferences under General Preferences above the "Remember the
last selected message" check box.

Currently there is none.

Reproducible: Always
Steps to Reproduce:
1. Open the preferences dialog
2. Notice that the default mail application checkbox is missing.



Expected Results:  
There should be a checkbox to set the default application.
[Background Note: As of Mac OS 10.3 "Panther" the settings for default email
client and web browser were relocated to the Preferences windows for Mail.app
and Safari. Previously the default settings were available in System Preferences.]

 I believe this preference is available in the Windows build and I agree that it
is necessary to include this preference in the Mac build. Rather than a
checkbox, it might be better as a popup menu (with the current selection showing
the current default client), consistent with Mail.app.
(In reply to comment #1)
>  I believe this preference is available in the Windows build

Indeed. Confirming and marking as new per above comments. Maybe it is an
enhancement request.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I suggested a checkbox because that is how it is in the windows build, and I
thought it should be consistent accross platforms.

The other method would be cool as well though.
QA Contact: marcia
Summary: There should be a "Use Thunderbird as the default mail application" check box in preferences → [Mac] There should be a "Use Thunderbird as the default mail application" check box in preferences
Setting TM to 1.0, as I would really like this to happen. Currently you actually
have to set up a mail.app account (at least I did) in order to make Tbird the
default. It would be great if we could make life easy for Mac users.
Target Milestone: --- → Thunderbird1.0
actually, i should have nominated this first so it gets on the radar.
Flags: blocking-aviary1.0?
minusing for 1.0. We won't be doing this until it gets done for Firefox.
Plussing for the mac release
Flags: blocking-aviary1.0mac+
Flags: blocking-aviary1.0?
Flags: blocking-aviary1.0-
Depends on: 233871
apparently there isn't going to be a mac special release of firefox 1.0 where
this gets fixed so we can't piggy back off it. Moving to 1.1 when the firefox
work for this is now scheduled to occurr.
Target Milestone: Thunderbird1.0 → Thunderbird1.1
Adding Mitchell and Asa to the cc list and switching to TM 1.0.  This was
discussed briefly at the office today - Asa, Mitchell and I feel this should be
in the 1.0 bucket even though we don't have a FF fix to piggy back off of. 
Because you have to set up a mail account in mail.app, it is particulary
troublesome for potential Tbird users to switch over. 
Target Milestone: Thunderbird1.1 → Thunderbird1.0
sorry guys there's no way we can do this without all of the underlying firefox
stuff to piggy back off of.


moving off of the 1.0 bucket.

If we really wanted this we wouldn't have gotten rid of the firefox mac 1.0
release bugs.
Flags: blocking-aviary1.0mac+ → blocking-aviary1.0mac-
Target Milestone: Thunderbird1.0 → Thunderbird1.1
Confirming. Windows 2000 sp4, on first start of Mozilla 1.73 after uninstalling
Thunderbird, prompted with "Mozilla is no longer your default browser..."
dialog. On clicking in that dialog to reinstate Moz as default, it takes over
file-type associations not only for opening html, but also for editing html, and
for gif, jpeg and png (same as on original install of Mozilla), tho these were
set otherwise prior to installing Thunderbird. Thunderbird should not affect any
file type associations without permission.
Oops, #10 posted in wrong bug, sorry, please delete if possible. Intended to be
posted under another bug - the page switched from one bug to another when I
logged in.
*** Bug 270989 has been marked as a duplicate of this bug. ***
Flags: blocking-aviary1.1?
clearing request for bugs already in the 1.1 bucket. 
Flags: blocking-aviary1.1?
clarifying summary for easier querying, and also since the issue here is to
really allow mac tbird to set itself as the default email client.

previous summary: There should be a "Use Thunderbird as the default mail
application" check box in preferences
Summary: [Mac] There should be a "Use Thunderbird as the default mail application" check box in preferences → [Mac] should allow Thunderbird to become the default email application
Version: unspecified → Trunk
Depends on: 274374
mscott: I was planing to take this bug, but it seems thunderbird handles the
default client stuff in a different way (from firefox). Do you have a plan to
revise that?  If not, where should the mac implementation code go to?
i was thinking about adding a shell directory, moving the gnome stuff from
components\gnome to the shell directory then adding the mac os x files there as
well, so directory wise it would look like firefox. 
Taking, assuming you've a bug on comment 16 (please cc me, thanks).
Assignee: mscott → bugs.mano
Priority: -- → P2
Status: NEW → ASSIGNED
Depends on: 298927
Depends on: 300655
Ok, Asaf. We should be good to go to start this stuff. Everything is under
mail\components\shell now. We can create the Mac shell service files right next
to the gnome ones in this directory. 

You can use the gnome integration as a template. The mac shell service is going
to have to implement: nsIMapiRegistry
http://lxr.mozilla.org/mozilla/source/mailnews/base/public/nsIMapiRegistry.idl

which is the interface Windows and Unix both use to set/unset default mail and
news status. 

Once the shell service is in place for Mac OS X, we then want to expose the UI
in preferences by modifying general.xul/general.js. I think this will be as easy
as just changing the existing ifdef MOZ_WIDGET_GTK2 ifdefs in these two files to
one that includes Mac OS X and GTK2. 

Let me know if you need help or have questions. 
Attached patch work in progress (obsolete) — Splinter Review
I can't actually test it yet since I can't build at mail/components/build, the
inclusion of <CoreFoundation/CoreFoundation.h> is causing this:
ld: Undefined symbols:
_CFBundleCopyBundleURL
_CFBundleCreate
_CFBundleGetIdentifier
_CFBundleGetMainBundle
_CFRelease
_CFRetain
_CFStringCompare
__LSCopyDefaultSchemeHandlerURL
__LSSaveAndRefresh
__LSSetDefaultSchemeHandlerURL
___CFStringMakeConstantString
make[1]: *** [libmailcomps.dylib] Error 1
make: *** [all] Error 2
awesome news.

Try adding:

# Need to link to CoreFoundation for Mac Migrators (PList reading code)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += \
  $(TK_LIBS) \
  $(NULL)
endif

just above the rules.mk line in mail\components\build\Makefile.in

That should fix your linking problem. 
Yeah, bsmedberg point me to that lib earlier today, thanks anyway.
Attached patch patch (obsolete) — Splinter Review
ready for reviews.

This also adds support for setting the default feed:// uris handler.
(FYI, Safari sets itself to be the default handler of feed:// uris starting
from v2.0 (10.4)).
Attachment #189867 - Attachment is obsolete: true
Attachment #189902 - Flags: superreview?(mscott)
Attachment #189902 - Flags: review?(jhpedemonte)
Blocks: branching1.8
Summary: [Mac] should allow Thunderbird to become the default email application → [Mac] should allow Thunderbird to become the default email/news/feed aggregator application
Comment on attachment 189902 [details] [diff] [review]
patch

+#ifdef XP_MACOSX
+// whether to check if we're the default news client on startup (Mac only)
+pref("mail.checkDefaultFeed", false);
+#endif

That should be "the default RSS/Atom client".

Is there any reason why the "feed:" support should be Mac only?  Could Gnome
use it, too?

-    else 
+    else
     {
-      isDefault = mapiReg.isDefaultMailClient;
-      str = "Mail";
+      isDefault = mapiReg.isDefaultFeedClient;
+      str = "Feed";

You should explicitly look for "kFeedApp", just to be safe:
    else if (appType == kFeedApp)

	 else
-	   mapiReg.isDefaultMailClient = true;
+	   mapiReg.isDefaultFeedClient = true;

Same here.

+nsresult nsMailMacIntegration::SetAsDefaultHandlerForProtocol(CFStringRef
aScheme)

Nit: exceeds 80 chars.	Try:
  nsresult
  nsMailMacIntegration::SetAsDefaultHandlerForProtocol(CFStringRef aScheme)

+NS_IMETHODIMP
+nsMailMacIntegration::ShowMailIntegrationDialog(nsIDOMWindow* aParentWindow)

So this function will show up to 3 separate dialogs, right?  Is there anyway to
show only one dialog, with up to 3 checkboxes for mail/news/feed?  Just a
thought.

+#define NS_MAILMACINTEGRATION_CID \
+{0xbddef0f4, 0x5e2d, 0x4846, {0xbd, 0xec, 0x86, 0xd0, 0x78, 0x1d, 0x8d, 0xed}}

This is the same as NS_MAILGNOMEINTEGRATION_CID.  You should get a new CID.

+<!ENTITY feedApplication.label 	    "Feed aggregator">

No accesskey?

+setDefaultFeed=%S is not currently set as your default feed aggregator.  Would
you like to make it your default news application?

That should be "Would you like to make it your default feed aggregator
application?"
(In reply to comment #24)

> Is there any reason why the "feed:" support should be Mac only?  Could Gnome
> use it, too?

Blame bryner, i don't know why there's no gnome implementaion.


> +<!ENTITY feedApplication.label 	    "Feed aggregator">
> 
> No accesskey?

Setting an accesskey for mac-only stuff doesn't make too much sense

> +setDefaultFeed=%S is not currently set as your default feed aggregator.  Would
> you like to make it your default news application?
> 

hehe
(In reply to comment #24)
> +NS_IMETHODIMP
> +nsMailMacIntegration::ShowMailIntegrationDialog(nsIDOMWindow* aParentWindow)

> So this function will show up to 3 separate dialogs, right? 

By default you are getting no dialogs. You need to turn on each of them.

> Is there anyway to
> show only one dialog, with up to 3 checkboxes for mail/news/feed?  Just a
> thought.

Sounds reasonable to me, but not in this bug ;)
Attached patch patch (obsolete) — Splinter Review
Attachment #189902 - Attachment is obsolete: true
Attachment #189917 - Flags: superreview?(mscott)
Attachment #189917 - Flags: review?(jhpedemonte)
Attachment #189902 - Flags: superreview?(mscott)
Attachment #189902 - Flags: review?(jhpedemonte)
Attachment #189902 - Flags: review-
Comment on attachment 189917 [details] [diff] [review]
patch

+	 if (appType == kMailApp)
+	   mapiReg.isDefaultMailClient = true;
+	 if (appType == kNewsApp)
	   mapiReg.isDefaultNewsClient = true;
	 else
-	   mapiReg.isDefaultMailClient = true;
+	   mapiReg.isDefaultFeedClient = true;

That should be:
    if (appType == kMailApp)
      ...
    _else_ if (appType == kNewsApp)
      ...
    else _if (appType == kFeedApp)_
      ...

>> Is there anyway to
>> show only one dialog, with up to 3 checkboxes for mail/news/feed?  Just a
>> thought.
>
>Sounds reasonable to me, but not in this bug ;)

OK, we should open a bug on that, then.

With that change above, r=jhpedemonte.
Attachment #189917 - Flags: review?(jhpedemonte) → review+
Comment on attachment 189917 [details] [diff] [review]
patch

Thanks for working on this. Great stuff so far. Some usability comments after
running with the patch:

1) We should never be asking the user at startup to become the default news or
feed client. When I first started up the app with the patch, I got three
dialogs asking about default status. One dialog asking about mail is what we do
on Windows and we should do the same here. News and feed status can be set from
the preferences dialog.

2) The changes to the options UI (three rows consisting of a check box and a
button on each row) made the general pane too tall. In particular, when I
switch between the Display panel and the General panel, I get a big block of
white space after the Play a sound item that looks really weird. How can we
compress this?

On Windows, we just have a simple check box next to each app type which
reflects if it is currently the default app or not. i.e. a single row of:

Make Thunderbird the default application for:
[ ] Mail  [X] News [X] RSS Feeds

Can we do something similar here to save all the space the current design
wastes?
(In reply to comment #29)
> (From update of attachment 189917 [details] [diff] [review] [edit])
> Thanks for working on this. Great stuff so far. Some usability comments after
> running with the patch:
> 
> 1) We should never be asking the user at startup to become the default news or
> feed client. When I first started up the app with the patch, I got three
> dialogs asking about default status. One dialog asking about mail is what we do
> on Windows and we should do the same here. News and feed status can be set from
> the preferences dialog.
>

With the current patch, you only get one dialog at statup, unless you change
your preferences. Note that it's already our behavior on GNOME (i.e.
checkDefaultMail is on, checkDefaultNews is off).

> 2) The changes to the options UI (three rows consisting of a check box and a
> button on each row) made the general pane too tall. In particular, when I
> switch between the Display panel and the General panel, I get a big block of
> white space after the Play a sound item that looks really weird. How can we
> compress this?
> 
> On Windows, we just have a simple check box next to each app type which
> reflects if it is currently the default app or not. i.e. a single row of:
> 
> Make Thunderbird the default application for:
> [ ] Mail  [X] News [X] RSS Feeds
> 
> Can we do something similar here to save all the space the current design
> wastes?

hmm, and what does happen if I uncheck any of them, does it restore the previous
default handler!? How is checkDefaultMail/checkDefaultNews exposed on windows?

We'll have to have at least one button (for the three of them, not sure about
either its place or its labeling) since we don't have OK/Cancel buttons in
instantApply mode....
(In reply to comment #30)
> With the current patch, you only get one dialog at statup, unless you change
> your preferences. Note that it's already our behavior on GNOME (i.e.
> checkDefaultMail is on, checkDefaultNews is off).

Weird. When I ran this for the first time (fresh tree with just this patch), I
was asked for all three, one dialog after another. 
That's weird, look at the all-thunderbird.js changes...

As for the pref ui, another option is to move these bits (for gnome/mac only)
into a child-prefwindow (of the general pane); considering that:
1) It's not a "pref" you tweak often
2) It would be better to handle all of this in a modal dialog
3) The most-important functionality (default mail client) is exposed on startup,

It might be the better way to expose it.
Scott, a UI ascii table of the desired UI would be very useful :)
Whiteboard: [needed to branch?]
Asaf, I like your suggestion of a child dialog for Mac and Unix. Let's go with
that. I wonder if we should have the mail setting in the main window and then a
button for the child window which lists all three of them (or at least news and
feeds).

Your right, the windows code has knowledge of the previous client so it can
easily unsent itself, that's why its UI is different and makes more sense for
Windows. That probably isn't practical for OS X and Linux. 
hrm, when I patch a clean tree with the last patch and make in mozilla/mail/, i get:
make[3]: *** No rule to make target `../../../dist/lib/libshellservice_s.a',
needed by `libmailcomps.dylib'.  Stop.
make[2]: *** [libs] Error 2
make[1]: *** [libs] Error 2
make: *** [all] Error 2

However, if I first build mozilla/mail/components/shell, the error is gone.
You need to edit the following line in mozilla/mail/components/Makefile.in:
 47 ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2)
 48 DIRS += shell
 49 endif
Attached patch patchSplinter Review
The dialog itself still needs some love, but we can tweak it later.
Attachment #189917 - Attachment is obsolete: true
Attachment #190588 - Flags: superreview?(mscott)
Attachment #190588 - Flags: review?(mscott)
Attachment #189917 - Flags: superreview?(mscott)
Comment on attachment 190588 [details] [diff] [review]
patch

This looks a lot better.

1) Let's change the general panel string to read: "Thunderbird should check to
see if it is the default mail client when starting."

2) I applied the patch, started up, clicked check now for default mail client
and it confirmed I was the default client. Then I quit, loaded up Firefox,
clicked on a mailto url and discovered that Thunderbird did not start up nor
did it open up a compose window for the mailto url.

So the patch looks good but doesn't seem to be working, at least not for me :).
2) is really wfm, any case you have another Thunderbird.app on this machine?
(which might be horked)?
er, s/case/chance.
this was my debug build obviously. I do have an optimized build on the machine,
but it was not running nor does it have any code to make it the default mail
application.

Note if I leave the app running and click on the mailto url in firefox, it works
fine. The problem is when thunderbird isn't running at all. 
Here's an interesting tidbit.

If I start up mail.app and look in the preferences panel for the default mail
app, it says:

"Thunderbird copy.appX(1.0+)"

Could the fact that I'm running it inside of the debugger be confusing how we
register the app? Why would it say copy?
WFM either way...

It can be a g5-optimized build of tbird 0.9 too... Launch services doesn't
differ between various bundles of the same application, so it might pick a
broken one in the case where there is no open instance of tbird.

In the case where there is an open instance, Launch Service will open the
external link in that instance; if there's not, it picks the first entry of your
application from its database (baseed on the bundle identefier).
BTW, it's mentioned in the patch:
+nsresult
+nsMailMacIntegration::IsDefaultHandlerForProtocol(CFStringRef aScheme,
+                                                  PRBool *aIsDefault)
+{
+  // Since neither Launch Services nor Internet Config actually differ between 
+  // bundles which have the same bundle identifier (That is, if we set our
+  // URL of our bundle as the default handler for the given protocol,
+  // Launch Service might return the URL of another thunderbird bundle as the
+  // defualt handler for that protocol), we are comparing the identifiers of the
+  // bundles rather than their URLs.


FYI, Firefox, Safari, Mail.app and Camino has the same issue (due to the same
"bug").
I made Mail.app the default again, then started  my debug thunderbird build
straight from the desktop, bypassing the debugger competely.

got reprompted about making the default app and selected Yes.

I then quit and clicked on a mailto url in firefox. still no luck.
Well, nothing of that would change the order of Thunderbird bundles registred in
the Launch Services database. You might need to completely delete the other
thunderbird copy.

If it doesn't help, please poke me in moznet.
How do I delete things from the launch services database?
http://www.macosxcocktail.com/ claims it can rebuild it

Another (easier, less risky) option is to delete the bundle itself, and then run
(not in a debuger) the other one.
Comment on attachment 190588 [details] [diff] [review]
patch

assuming you fix the string per comment 38, let's get this in for testing.
Thanks again for putting this together.
Attachment #190588 - Flags: superreview?(mscott)
Attachment #190588 - Flags: superreview+
Attachment #190588 - Flags: review?(mscott)
Attachment #190588 - Flags: review+
Attachment #190588 - Flags: approval1.8b4?
(In reply to comment #49)
> (From update of attachment 190588 [details] [diff] [review] [edit])
> assuming you fix the string per comment 38, let's get this in for testing.
> Thanks again for putting this together.

Thanks, Should I also change the string in the sub dialog itself?
Attachment #190588 - Flags: approval1.8b4? → approval1.8b4+
(In reply to comment #49)
> (From update of attachment 190588 [details] [diff] [review] [edit])
> assuming you fix the string per comment 38, let's get this in for testing.
> Thanks again for putting this together.

With that fix, checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [needed to branch?]
Flags: blocking-aviary1.0mac-
Flags: blocking-aviary1.0-
Verified with Mac trunk build 2005-08-02-05-trunk
Status: RESOLVED → VERIFIED
*** Bug 299072 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: