|
@@ -23,7 +23,6 @@
|
23
|
23
|
package com.dmdirc.addons.ui_swing;
|
24
|
24
|
|
25
|
25
|
import com.dmdirc.DMDircMBassador;
|
26
|
|
-import com.dmdirc.FrameContainer;
|
27
|
26
|
import com.dmdirc.addons.ui_swing.components.SplitPane;
|
28
|
27
|
import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
|
29
|
28
|
import com.dmdirc.addons.ui_swing.components.menubar.MenuBar;
|
|
@@ -41,11 +40,10 @@ import com.dmdirc.events.ClientFocusLostEvent;
|
41
|
40
|
import com.dmdirc.events.ClientMinimisedEvent;
|
42
|
41
|
import com.dmdirc.events.ClientUnminimisedEvent;
|
43
|
42
|
import com.dmdirc.events.FrameTitleChangedEvent;
|
|
43
|
+import com.dmdirc.events.NotificationSetEvent;
|
44
|
44
|
import com.dmdirc.interfaces.LifecycleController;
|
45
|
|
-import com.dmdirc.interfaces.NotificationListener;
|
46
|
45
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
47
|
46
|
import com.dmdirc.interfaces.config.ConfigChangeListener;
|
48
|
|
-import com.dmdirc.ui.Colour;
|
49
|
47
|
import com.dmdirc.ui.CoreUIUtils;
|
50
|
48
|
import com.dmdirc.ui.IconManager;
|
51
|
49
|
import com.dmdirc.util.collections.ListenerList;
|
|
@@ -73,8 +71,8 @@ import static com.dmdirc.addons.ui_swing.SwingPreconditions.checkOnEDT;
|
73
|
71
|
/**
|
74
|
72
|
* The main application frame.
|
75
|
73
|
*/
|
76
|
|
-public class MainFrame extends JFrame implements WindowListener,
|
77
|
|
- ConfigChangeListener, NotificationListener, ActiveFrameManager {
|
|
74
|
+public class MainFrame extends JFrame implements WindowListener, ConfigChangeListener,
|
|
75
|
+ ActiveFrameManager {
|
78
|
76
|
|
79
|
77
|
/** A version number for this class. */
|
80
|
78
|
private static final long serialVersionUID = 9;
|
|
@@ -545,10 +543,6 @@ public class MainFrame extends JFrame implements WindowListener,
|
545
|
543
|
framePanel.setVisible(false);
|
546
|
544
|
framePanel.removeAll();
|
547
|
545
|
|
548
|
|
- if (MainFrame.this.activeFrame != null) {
|
549
|
|
- MainFrame.this.activeFrame.getContainer()
|
550
|
|
- .removeNotificationListener(MainFrame.this);
|
551
|
|
- }
|
552
|
546
|
MainFrame.this.activeFrame = activeFrame;
|
553
|
547
|
|
554
|
548
|
if (activeFrame == null) {
|
|
@@ -557,8 +551,6 @@ public class MainFrame extends JFrame implements WindowListener,
|
557
|
551
|
} else {
|
558
|
552
|
framePanel.add(activeFrame.getDisplayFrame(), "grow");
|
559
|
553
|
setTitle(activeFrame.getContainer().getTitle());
|
560
|
|
- activeFrame.getContainer().addNotificationListener(
|
561
|
|
- MainFrame.this);
|
562
|
554
|
}
|
563
|
555
|
|
564
|
556
|
framePanel.setVisible(true);
|
|
@@ -628,19 +620,13 @@ public class MainFrame extends JFrame implements WindowListener,
|
628
|
620
|
}
|
629
|
621
|
}
|
630
|
622
|
|
631
|
|
- @Override
|
632
|
|
- public void notificationSet(final FrameContainer window,
|
633
|
|
- final Colour colour) {
|
634
|
|
- if (activeFrame != null && activeFrame.getContainer().equals(window)) {
|
635
|
|
- window.clearNotification();
|
|
623
|
+ @Handler
|
|
624
|
+ public void notificationSet(final NotificationSetEvent event) {
|
|
625
|
+ if (activeFrame != null && activeFrame.getContainer().equals(event.getWindow())) {
|
|
626
|
+ event.getWindow().clearNotification();
|
636
|
627
|
}
|
637
|
628
|
}
|
638
|
629
|
|
639
|
|
- @Override
|
640
|
|
- public void notificationCleared(final FrameContainer window) {
|
641
|
|
- //Ignore
|
642
|
|
- }
|
643
|
|
-
|
644
|
630
|
@Override
|
645
|
631
|
public void dispose() {
|
646
|
632
|
if (!quitting) {
|