Community
Participate
Working Groups
Hello, I'd like to contribute modifications to save attachment action in task editor. My goal was to implement following changes: * Support for saving multiple attachments at once to single directory * Remember previous directory Attached patch achieves above by: * extracting anonymous save action to new SaveAttachmentsAction * moving getAttachment method from TaskUiMenus to AttachmentUtil, creating new getAttachments, which returns list of selected attachments * SaveAttachmentsAction works as before if only one attachment is selected * If multiple attachments are selected, user is asked to choose destination directory. Code then checks target filenames (and asks user if he wants to overwrite existing files), and initiates DownloadAttachmentJob for each attachment * Target directory is remembered between action invocations (using preferences mechanism). Target directory is also used when doing single-attachment saving (ehnahcement of original code) Looking forward to your comments. Thank you, -Peter
Created attachment 130892 [details] Implementation of described changes.
Context.
Created attachment 130894 [details] mylyn/context/zip
Created attachment 130915 [details] Fixed NPE when user cancels Save dialog after he chooses not to overwrite existing file
Thanks for the patch Peter! I am currently on vacation and will review the patch next when I get back.
Thanks Peter, great to see this!
Created attachment 131623 [details] Preferences-related fixes 1) Don't use ConfigurationScope, as it stores preferences to global eclipse install directory 2) Use preferences store from TasksUiPlugin. Moved constant from SaveAttachmentsAction to ITaskUiPreferenceConstants.
Created attachment 131624 [details] mylyn/context/zip
Created attachment 133191 [details] Use WorkbenchUtil.getShell() directly instead of TasksUiInternal.getShell() Updated patch according to latest change to TasksUiMenus class.
Created attachment 134176 [details] Fixed import after moving WorkbenchUtil
Sorry for the slow response and thanks for keeping patch up to date. I'll tentatively schedule this for 3.2 and will try to review the patch in the next few days.
Thanks for the great patch, Peter! I have applied it to CVS head with minor refactorings: I have moved the SaveAttachmentsAction to the actions package and renamed a few variables.
Reopening to change assignment.
Resolved.
Thank you Steffen!