MsgViewer icon indicating copy to clipboard operation
MsgViewer copied to clipboard

feature request - right click to download attachments

Open kintaro1981 opened this issue 2 years ago • 3 comments

How about right click on attachments and choose where to download them instead of open them directly?

kintaro1981 avatar Feb 15 '23 13:02 kintaro1981

Hi @kintaro1981 ! Yeah that would be neat! I'll sure think about it but I can't guarantee to prioritize this feature since I already have another task about global configuration file and a bug to fix

lolo101 avatar Feb 17 '23 01:02 lolo101

Hello, any news about this?

kintaro1981 avatar May 29 '23 09:05 kintaro1981

Hi @kintaro1981

I could not find a solution for this feature request at the moment. The difficulty is that the component used to display the header and the attachments is a JEditorPane, and it only responds to left-click on hyperlinks.

See handling code in HTMLEditorKit:

        public void mouseClicked(MouseEvent e) {
            JEditorPane editor = (JEditorPane) e.getSource();

            if (! editor.isEditable() && editor.isEnabled() &&
                    SwingUtilities.isLeftMouseButton(e)) {
                Point pt = new Point(e.getX(), e.getY());
                int pos = editor.viewToModel(pt);
                if (pos >= 0) {
                    activateLink(pos, editor, e);
                }
            }
        }

An alternative is to add a MouseListener to the component, find which hyperlink was clicked, and open a dialog to save the file (actually, the file is already in a temporary folder on the filesystem)

lolo101 avatar May 29 '23 10:05 lolo101