joelekstrom / fastmate

A native Fastmail-wrapper for Mac.
MIT License
193 stars 12 forks source link

Add in-app download support #34

Closed mdbraber closed 1 year ago

mdbraber commented 3 years ago

In my forked version (https://github.com/joelekstrom/fastmate/issues/14) I previously integrated in-app download support (not having to go to the default browser). Would you consider including download support in the main version? I've done a probably crude version so open to any suggestions what would be the best way to try and include this

joelekstrom commented 3 years ago

Hi! I'd be happy to include this!

So I haven't explicitly tried your fork - but the reason I haven't given it a go myself is that I would personally like some kind of progress bar during a download, and I haven't figured out a good place for that in Fastmate. Does it work like Safari where you can see a progress bar in the downloads folder? In that case, I'm happy to accept a PR with even a crude version of this. If you would like a PR, then make a clean clone of this repo and copy over the changes related only to the downloads and make a PR for those.

mdbraber commented 2 years ago

@joelekstrom would you consider adding download functionality to a future version?

joelekstrom commented 2 years ago

Absolutely, it's on the TODO-list 😄 if you want to package your implementation up in a PR with only that I'm happy to merge it too

mdbraber commented 2 years ago

I'm ready to repackage my download implementation and start porting from Obj-C to Swift. But when thinking I thought about what would be the most permanent approach. Possibly it would mimic something like the download progress / overview in Safari. Examples I found are: https://github.com/n3d1117/dl-buddy or https://github.com/lcharlick/DownloadManager

The other way to could go simply do what I did now: specific a folder (probably specify it in preferences) and simply download any file to there without a progress indicator.

Any suggestions on a preferred approach (before I start porting code that won't be used)?

joelekstrom commented 2 years ago

Yeah I think the nicest approach would be if it would simply download to ~/Downloads. I know when downloading from Safari there's a progress bar built in in the downloads folder so no custom UI would be needed. Do you know if that's possible?

mdbraber commented 2 years ago

Okay - sounds like a plan. I think using something like NSProgress would be a possibility: https://stackoverflow.com/questions/15018052/how-to-show-a-progress-bar-on-files-icon

joelekstrom commented 2 years ago

What are your thoughts as a user of this? Would you rather have a built-in download manager as your examples there or would a progress on icons be enough? Feel free to take whatever approach solves the problem best/is most inspiring to you. The icon progress thing is just what I would've done to avoid making custom UI 😅

mdbraber commented 2 years ago

As a user I'm more than happy with a download to just a pre-specified folder. It also makes it much easier to implement as that's the code I already have (in Obj-C). I'll take a look at NSProgress, but I'll probably make a PR without that first. It indeed also prevents from having to create a separate UI I agree :-)

mdbraber commented 2 years ago

Check out this PR https://github.com/joelekstrom/fastmate/pull/82

joelekstrom commented 1 year ago

Merged in v1.9.0