|
@@ -38,8 +38,7 @@ import com.dmdirc.addons.ui_swing.events.SwingWindowSelectedEvent;
|
38
|
38
|
import com.dmdirc.addons.ui_swing.framemanager.FrameManager;
|
39
|
39
|
import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
|
40
|
40
|
import com.dmdirc.events.FrameIconChangedEvent;
|
41
|
|
-import com.dmdirc.events.NotificationClearedEvent;
|
42
|
|
-import com.dmdirc.events.NotificationSetEvent;
|
|
41
|
+import com.dmdirc.events.UnreadStatusChangedEvent;
|
43
|
42
|
import com.dmdirc.events.UserErrorEvent;
|
44
|
43
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
45
|
44
|
import com.dmdirc.interfaces.config.ConfigChangeListener;
|
|
@@ -49,7 +48,6 @@ import com.dmdirc.plugins.PluginDomain;
|
49
|
48
|
import com.dmdirc.ui.IconManager;
|
50
|
49
|
import com.dmdirc.ui.WindowManager;
|
51
|
50
|
import com.dmdirc.ui.messages.ColourManager;
|
52
|
|
-import com.dmdirc.util.colours.Colour;
|
53
|
51
|
|
54
|
52
|
import java.awt.Rectangle;
|
55
|
53
|
import java.awt.event.MouseEvent;
|
|
@@ -237,9 +235,10 @@ public class TreeFrameManager implements FrameManager, Serializable, ConfigChang
|
237
|
235
|
tree.scrollRectToVisible(new Rectangle(0, (int) view.getY(), 0, 0));
|
238
|
236
|
}
|
239
|
237
|
|
240
|
|
- // TODO: Should this colour be configurable?
|
241
|
|
- node.getLabel().notificationSet(new NotificationSetEvent(window.getContainer(),
|
242
|
|
- window.getContainer().getNotification().orElse(Colour.BLACK)));
|
|
238
|
+ node.getLabel().unreadStatusChanged(new UnreadStatusChangedEvent(
|
|
239
|
+ window.getContainer(), window.getContainer().getUnreadStatusManager(),
|
|
240
|
+ window.getContainer().getUnreadStatusManager().getNotificationColour(),
|
|
241
|
+ window.getContainer().getUnreadStatusManager().getUnreadLines()));
|
243
|
242
|
node.getLabel().iconChanged(new FrameIconChangedEvent(window.getContainer(),
|
244
|
243
|
window.getContainer().getIcon()));
|
245
|
244
|
});
|
|
@@ -333,33 +332,20 @@ public class TreeFrameManager implements FrameManager, Serializable, ConfigChang
|
333
|
332
|
final TreePath path = new TreePath(treePath);
|
334
|
333
|
tree.setTreePath(path);
|
335
|
334
|
tree.scrollPathToVisible(path);
|
336
|
|
- }
|
337
|
|
- });
|
338
|
|
- }
|
339
|
|
- }
|
340
|
|
-
|
341
|
|
- @Handler(invocation = EdtHandlerInvocation.class, delivery = Invoke.Asynchronously)
|
342
|
|
- public void notificationSet(final NotificationSetEvent event) {
|
343
|
|
- synchronized (nodes) {
|
344
|
|
- final TreeViewNode node = nodes.get(windowFactory.getSwingWindow(event.getWindow()));
|
345
|
|
- if (event.getWindow() != null && node != null) {
|
346
|
|
- final NodeLabel label = node.getLabel();
|
347
|
|
- if (label != null) {
|
348
|
|
- label.notificationSet(event);
|
349
|
335
|
tree.repaint();
|
350
|
336
|
}
|
351
|
|
- }
|
|
337
|
+ });
|
352
|
338
|
}
|
353
|
339
|
}
|
354
|
340
|
|
355
|
341
|
@Handler(invocation = EdtHandlerInvocation.class, delivery = Invoke.Asynchronously)
|
356
|
|
- public void notificationCleared(final NotificationClearedEvent event) {
|
|
342
|
+ public void unreadStatusChanged(final UnreadStatusChangedEvent event) {
|
357
|
343
|
synchronized (nodes) {
|
358
|
|
- final TreeViewNode node = nodes.get(windowFactory.getSwingWindow(event.getWindow()));
|
359
|
|
- if (event.getWindow() != null && node != null) {
|
|
344
|
+ final TreeViewNode node = nodes.get(windowFactory.getSwingWindow(event.getSource()));
|
|
345
|
+ if (node != null) {
|
360
|
346
|
final NodeLabel label = node.getLabel();
|
361
|
347
|
if (label != null) {
|
362
|
|
- label.notificationCleared();
|
|
348
|
+ label.unreadStatusChanged(event);
|
363
|
349
|
tree.repaint();
|
364
|
350
|
}
|
365
|
351
|
}
|