|
@@ -27,6 +27,7 @@ import com.dmdirc.Server;
|
27
|
27
|
import com.dmdirc.ServerManager;
|
28
|
28
|
import com.dmdirc.actions.ActionManager;
|
29
|
29
|
import com.dmdirc.actions.CoreActionType;
|
|
30
|
+import com.dmdirc.addons.ui_swing.MainFrame;
|
30
|
31
|
import com.dmdirc.addons.ui_swing.SelectionListener;
|
31
|
32
|
import com.dmdirc.addons.ui_swing.SwingController;
|
32
|
33
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
|
@@ -67,8 +68,8 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
|
67
|
68
|
private final JMenuItem dismiss;
|
68
|
69
|
/** Accept invites menu item. */
|
69
|
70
|
private final JMenuItem accept;
|
70
|
|
- /** Swing controller. */
|
71
|
|
- private final SwingController controller;
|
|
71
|
+ /** Main frame. */
|
|
72
|
+ private final MainFrame mainFrame;
|
72
|
73
|
/** Active server. */
|
73
|
74
|
private Server activeServer;
|
74
|
75
|
|
|
@@ -76,11 +77,13 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
|
76
|
77
|
* Instantiates a new invite label.
|
77
|
78
|
*
|
78
|
79
|
* @param controller Swing controller
|
|
80
|
+ * @param mainFrame Main frame
|
79
|
81
|
*/
|
80
|
|
- public InviteLabel(final SwingController controller) {
|
|
82
|
+ public InviteLabel(final SwingController controller,
|
|
83
|
+ final MainFrame mainFrame) {
|
81
|
84
|
super(new JLabel());
|
82
|
85
|
|
83
|
|
- this.controller = controller;
|
|
86
|
+ this.mainFrame = mainFrame;
|
84
|
87
|
|
85
|
88
|
setBorder(BorderFactory.createEtchedBorder());
|
86
|
89
|
label.setIcon(new IconManager(controller.getGlobalConfig())
|
|
@@ -98,7 +101,7 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
|
98
|
101
|
server.addInviteListener(this);
|
99
|
102
|
}
|
100
|
103
|
|
101
|
|
- controller.getMainFrame().addSelectionListener(this);
|
|
104
|
+ mainFrame.addSelectionListener(this);
|
102
|
105
|
ActionManager.getActionManager().registerListener(this,
|
103
|
106
|
CoreActionType.SERVER_CONNECTED);
|
104
|
107
|
ActionManager.getActionManager().registerListener(this,
|
|
@@ -112,7 +115,7 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements
|
112
|
115
|
/** {@inheritDoc} */
|
113
|
116
|
@Override
|
114
|
117
|
protected StatusbarPopupWindow getWindow() {
|
115
|
|
- return new InvitePopup(this, activeServer, controller.getMainFrame());
|
|
118
|
+ return new InvitePopup(this, activeServer, mainFrame);
|
116
|
119
|
}
|
117
|
120
|
|
118
|
121
|
/**
|