Closed Bug 924530 Opened 8 years ago Closed 6 years ago

Drag-n-drop an address card to Explorer or Finder


(Thunderbird :: Address Book, enhancement)

Not set


(Not tracked)

Thunderbird 43.0


(Reporter: lapsap7+mz, Assigned: neil)


(Blocks 1 open bug)



(1 file, 2 obsolete files)

As stated in the summary, it would be nice to save / export individual contact as vCard.

Once this function is implemented, a lot of possibilities are open to us, eg:
* right-click a contact and save it to vCard in local disk
* drag-n-drop a contact to local disk and it becomes vCard file
* attach a friend's vCard in email
* etc, etc
Attached patch Implement copy to clipboard (obsolete) — Splinter Review
This way of exporting contacts to vCard was easiest to write, so I quite understand if you don't think it's a good idea.
Attachment #8573357 - Flags: review?(mkmelin+mozilla)
Comment on attachment 8573357 [details] [diff] [review]
Implement copy to clipboard

Review of attachment 8573357 [details] [diff] [review]:

This doesn't seem to be very useful (yet) as I can't do anything with that raw vcard string data. Shouldn't you be setting the flavor to text/vcard and such?
Attachment #8573357 - Flags: review?(mkmelin+mozilla) → review-
Drag-n-drop on Windows is semi-automatic: the x-moz-file-promise-url is a URI with the data and the x-moz-file-promise just has to be present for the drop to succeed. (As my URI doesn't have a filename I have to provide a filename too.)

On the Mac you have to provide a flavour data provider as the x-moz-file-promise so I cargo-culted some code but I have no way of testing it.

I couldn't work out what the drag-n-drop support story is on Linux.
Attachment #8585584 - Flags: feedback?
Comment on attachment 8585584 [details] [diff] [review]
Drag-n-drop a single card to Explorer

Bah, I keep forgetting that :mkmelin doesn't work.
Attachment #8585584 - Flags: feedback? → feedback?(mkmelin+mozilla)
Assignee: nobody → neil
Attachment #8585584 - Flags: feedback?(mkmelin+mozilla) → feedback+
I've fixed up the typos and now I can drag-n-drop to Finder too.
Attachment #8585584 - Attachment is obsolete: true
Attachment #8629064 - Flags: review?(mkmelin+mozilla)
Blocks: 20304
Comment on attachment 8629064 [details] [diff] [review]
Drag-n-drop a single card to Explorer or Finder [landed, comment #8]

Review of attachment 8629064 [details] [diff] [review]:

::: mailnews/addrbook/content/abDragDrop.js
@@ +33,5 @@
> +      ofStream.init(localFile, -1, -1, 0);
> +      var converter = Components.classes[";1"].createInstance(Components.interfaces.nsIConverterOutputStream);
> +      converter.init(ofStream, null, 0, 0);
> +      converter.writeString(vCard);
> +      converter.close();

close the ofStream too?
Attachment #8629064 - Flags: review?(mkmelin+mozilla) → review+
(In reply to Magnus Melin from comment #6)
> (From update of attachment 8629064 [details] [diff] [review])
> > +      converter.close();
> close the ofStream too?

The converter already does that for you.
What is the terrible mess that was created in this bug?
One part landed, smashing dragging addresses onto the To and From fields since they are always treated as files now. That will now automatically open the attachment box.
No target milestone set. Pushed 2015-09-20, so that would have been one day before the branch to TB 44, so it landed on TB 43.
Flags: needinfo?(mkmelin+mozilla)
Depends on: 1268238
Note the regression reported in bug 1268238.
Closed: 6 years ago
No longer depends on: 1268238
Resolution: --- → FIXED
Summary: RFE: Implement function to save/export contact as vCard → Drag-n-drop an address card to Explorer or Finder
Target Milestone: --- → Thunderbird 43.0
Attachment #8629064 - Attachment description: Drag-n-drop a single card to Explorer or Finder → Drag-n-drop a single card to Explorer or Finder [landed, comment #8]
Flags: needinfo?(mkmelin+mozilla)
Attachment #8573357 - Attachment is obsolete: true
Depends on: 1268238
Depends on: 1268363
See Also: → 1268363
You need to log in before you can comment on or make changes to this bug.