Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330064

Summary: [commons] allow disabling and enabling notifications for certain event types
Product: z_Archived Reporter: Torkild Resheim <torkildr>
Component: MylynAssignee: Torkild Resheim <torkildr>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: steffen.pingel
Version: unspecifiedKeywords: contributed
Target Milestone: 3.5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 327712, 331424    
Attachments:
Description Flags
Patch to fix the issue
steffen.pingel: iplog+
mylyn/context/zip none

Description Torkild Resheim CLA 2010-11-12 05:08:20 EST
Currently it is only possible to globally enable/disable notifications. It should be possible to enable or disable notifications for certain event types using the preference page under General > Notifications.

See bug 272189.
Comment 1 Torkild Resheim CLA 2010-11-12 08:28:44 EST
I'm taking a stab at this one and is wondering about the "selected" attribute in "org.eclipse.mylyn.commons.notificaitons.event" declarations. It is currently used for selected state of events in the preference setting UI. Now I assume this is just temporary? Or is this the default value of the event notification?
Comment 2 Steffen Pingel CLA 2010-11-12 13:05:06 EST
(In reply to comment #1)
> I'm taking a stab at this one and is wondering about the "selected" attribute in
> "org.eclipse.mylyn.commons.notificaitons.event" declarations. It is currently
> used for selected state of events in the preference setting UI. Now I assume
> this is just temporary? Or is this the default value of the event notification?

Yes, this is to determine the default initialization for an event notifications. The state for the actual notifications is kept in NotificationAction which should be persisted (but is not yet).
Comment 3 Torkild Resheim CLA 2010-11-12 13:40:18 EST
(In reply to comment #2)
> Yes, this is to determine the default initialization for an event notifications.
> The state for the actual notifications is kept in NotificationAction which
> should be persisted (but is not yet).
OK. Thanks.
Comment 4 Torkild Resheim CLA 2010-12-07 03:55:54 EST
Created attachment 184688 [details]
Patch to fix the issue

I've implemented a mechanism for persisting the NotificationEvent and NotificationAction  settings. Filtering has been added to the NotificationService and the UI in the NotificationsPreferencesPage is handling the settings. I'm not so sure about the UI and the data model though. Currently it is only possible to change enablement of the various actions. The state of these are propagated to the events when changed. I'm don't know if this was how it was intended to work.

Anyhow we got a working solution and I guess we could always tweak it later on.
Comment 5 Torkild Resheim CLA 2010-12-07 03:55:57 EST
Created attachment 184689 [details]
mylyn/context/zip
Comment 6 Steffen Pingel CLA 2010-12-20 18:26:19 EST
Great stuff! I have committed the patch with two minor modifications: I added a null check where the model was being loaded to handle the case when no memento existed and I commented out the code that adds the "Test" button. I like the idea of a preview but I think we need a better place for the button.
Comment 7 Torkild Resheim CLA 2010-12-21 04:31:10 EST
Thanks for applying the patch Steffen. I was not sure about the "Test" button either. You're right that it did not look too good where it was.