|
@@ -28,6 +28,7 @@ import com.dmdirc.actions.ColourActionComparison;
|
28
|
28
|
import com.dmdirc.actions.CoreActionType;
|
29
|
29
|
import com.dmdirc.commandline.CommandLineParser;
|
30
|
30
|
import com.dmdirc.commandparser.CommandManager;
|
|
31
|
+import com.dmdirc.events.ClientOpenedEvent;
|
31
|
32
|
import com.dmdirc.interfaces.CommandController.CommandDetails;
|
32
|
33
|
import com.dmdirc.interfaces.config.IdentityController;
|
33
|
34
|
import com.dmdirc.interfaces.ui.UIController;
|
|
@@ -42,6 +43,8 @@ import com.dmdirc.ui.WarningDialog;
|
42
|
43
|
import com.dmdirc.ui.themes.ThemeManager;
|
43
|
44
|
import com.dmdirc.util.URLBuilder;
|
44
|
45
|
|
|
46
|
+import com.google.common.eventbus.EventBus;
|
|
47
|
+
|
45
|
48
|
import java.awt.GraphicsEnvironment;
|
46
|
49
|
import java.util.Collection;
|
47
|
50
|
import java.util.HashSet;
|
|
@@ -92,6 +95,9 @@ public class Main {
|
92
|
95
|
/** The colour-based action comparisons. */
|
93
|
96
|
private final ColourActionComparison colourActionComparison;
|
94
|
97
|
|
|
98
|
+ /** The event bus to dispatch events on. */
|
|
99
|
+ private final EventBus eventBus;
|
|
100
|
+
|
95
|
101
|
/** The commands to load into the command manager. */
|
96
|
102
|
private final Set<CommandDetails> commands;
|
97
|
103
|
|
|
@@ -110,6 +116,7 @@ public class Main {
|
110
|
116
|
* @param urlBuilder URL builder to use as a singleton.
|
111
|
117
|
* @param globalWindowManager Global window manager to use.
|
112
|
118
|
* @param colourActionComparison The colour-based action comparisons.
|
|
119
|
+ * @param eventBus The event bus to dispatch events on.
|
113
|
120
|
* @param commands The commands to be loaded into the command manager.
|
114
|
121
|
*/
|
115
|
122
|
@Inject
|
|
@@ -126,6 +133,7 @@ public class Main {
|
126
|
133
|
final URLBuilder urlBuilder,
|
127
|
134
|
final GlobalWindowManager globalWindowManager,
|
128
|
135
|
final ColourActionComparison colourActionComparison,
|
|
136
|
+ final EventBus eventBus,
|
129
|
137
|
final Set<CommandDetails> commands) {
|
130
|
138
|
this.identityManager = identityManager;
|
131
|
139
|
this.serverManager = serverManager;
|
|
@@ -136,6 +144,7 @@ public class Main {
|
136
|
144
|
this.commandManager = commandManager;
|
137
|
145
|
this.globalWindowManager = globalWindowManager;
|
138
|
146
|
this.colourActionComparison = colourActionComparison;
|
|
147
|
+ this.eventBus = eventBus;
|
139
|
148
|
this.commands = commands;
|
140
|
149
|
URLBuilder.setInstance(urlBuilder);
|
141
|
150
|
}
|
|
@@ -179,6 +188,7 @@ public class Main {
|
179
|
188
|
pluginManager.doAutoLoad();
|
180
|
189
|
actionManager.loadUserActions();
|
181
|
190
|
actionManager.triggerEvent(CoreActionType.CLIENT_OPENED, null);
|
|
191
|
+ eventBus.post(new ClientOpenedEvent());
|
182
|
192
|
|
183
|
193
|
commandLineParser.processArguments(serverManager);
|
184
|
194
|
|