Infocatcher / Download_Panel_Tweaker

Some tweaks for built-in download panel, restartless extension for Firefox
https://addons.mozilla.org/addon/download-panel-tweaker/
Other
9 stars 2 forks source link

Could it allow using the middle button to clear items from the list? #9

Open AlexVallat opened 11 years ago

AlexVallat commented 11 years ago

It would be nice if the middle mouse button could clear an item from the panel list, and middle button on the downloads toolbar button itself to clear all items.

(I'm coming from being a Download Statusbar user, and I miss this!)

Infocatcher commented 10 years ago

Added ability to remove downloads from history using middle-click in panel (disabled by default).

Test version: download_panel_tweaker-0.2.1pre-fx.xpi (source).

AlexVallat commented 10 years ago

Thanks, I've given the test version a try. It's already a great improvement, but from my point of view there are a couple of minor issues with it:

The function I was looking for was to remove the download from the popup panel list, not from the download history completely.

If you have two downloads of the same file, and middle click on one of them, it currently removes both.

If it's possible to have middle clicking the toolbar button remove all the entries from the panel (but not the download history), that would be awesome. I see the green arrow, I know I'm not interested in any of the stuff just downloaded, so I middle click the button and they are all cleared and the arrow turns black. I can always get at them by clicking Show All Downloads to see the main download history, so it's not a dangerous operation.

Infocatcher commented 10 years ago

The function I was looking for was to remove the download from the popup panel list, not from the download history completely.

Make sense. I renamed extensions.downloadPanelTweaker.middleClickToRemoveFromHistory preference to ...middleClickToRemoveFromPanel and added extensions.downloadPanelTweaker.middleClickToRemoveFromPanel.clearHistory preference (disabled and without UI, at least for now).

But there is logical issue with Library: "temporary" downloads (from download panel) are shown before "history" downloads. Also looks like "history" downloads may have only one item for one download link.

Test version: download_panel_tweaker-0.2.1pre2-fx.xpi (source).

If it's possible to have middle clicking the toolbar button remove all the entries from the panel (but not the download history), that would be awesome.

Yes, this should be possible, if built-in "Clear List" from panel context menu clears only that list.

AlexVallat commented 10 years ago

OK, I've done a spot of investigating Firefox's natural behaviour; as you say, the history downloads have only one item per download link. I don't see that as being a problem, to be honest. The test I did (with Download Panel Tweaker disabled) was:

Download multiple copies of the same file. Note that there are multiple entries both in the panel, and the history window. Restart firefox, which clears the panel. There is now only one entry in the history window, and the "Go to download page" command for it is no longer available.

I have also checked that if I used the Clear List command on the panel, it would remove the temporary downloads and not convert them into history downloads. However, it won't remove any history entries that have already been created, even if they have the same url. To me, that just seems wrong, Clear List ought to just clear the list the same as restarting Firefox would, and the downloads should still be recorded as history entries (with one entry per url). I can understand if you wouldn't want to change the Firefox behaviour, though.

Testing your 0.2.1-pre2-fx, it works properly to remove the temporary download from the panel, but, like the Clear List command, they are not converted to history downloads. This does match the Firefox Clear List command behaviour, but I would argue that it would be more useful to match the behaviour when items naturally come off the temporary list and become history downloads, if possible.

Infocatcher commented 10 years ago

Some knowledge. There is "temporary" downloads in %profile%/downloads.json (displayed in panel) and "history" downloads in %profile%/places.sqlite (displayed in library, but after all temporary downloads. But "history" downloads are created not for all downloads (for example, for downloaded files, but not for saved pages). Without Download Panel Tweaker only these downloads (except in progress and paused) will be stored (in library). And with Download Panel Tweaker it's possible to preserve last "temporary" downloads. And finally we can middle-click to download in panel to remove it from list (from downloads.json). If there is corresponding "history" entry, it will be shown in library after all "temporary" downloads.

Anyway, it's (theoretically) possible to somehow tweak built-in things around history, but this is very difficult (even simple preserving of few last items in downloads.json was too hard).