Browse Source

Eventbus logging for Updater.

Change-Id: I259eafd49d07ffc9bd820149aef89e4b61662a69
Depends-On: Ib5d580dc932bd72647444ae2ff9bc355a4d884cb
Reviewed-on: http://gerrit.dmdirc.com/3721
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
changes/21/3721/2
Greg Holmes 9 years ago
parent
commit
105cf8ea5d

+ 10
- 2
src/com/dmdirc/addons/debug/commands/ForceUpdate.java View File

@@ -34,6 +34,8 @@ import com.dmdirc.ui.messages.Styliser;
34 34
 import com.dmdirc.updater.UpdateChecker;
35 35
 import com.dmdirc.updater.manager.CachingUpdateManager;
36 36
 
37
+import com.google.common.eventbus.EventBus;
38
+
37 39
 import javax.inject.Inject;
38 40
 import javax.inject.Provider;
39 41
 
@@ -48,6 +50,8 @@ public class ForceUpdate extends DebugCommand {
48 50
     private final IdentityController identityController;
49 51
     /** The update manager to use when forcing an update. */
50 52
     private final CachingUpdateManager updateManager;
53
+    /** The event bus to post errors to. */
54
+    private final EventBus eventBus;
51 55
 
52 56
     /**
53 57
      * Creates a new instance of the command.
@@ -56,18 +60,21 @@ public class ForceUpdate extends DebugCommand {
56 60
      * @param globalConfig       The global config to use to check if updates are enabled.
57 61
      * @param identityController The controller to use to read/write settings for the updater.
58 62
      * @param updateManager      The update manager to use when forcing an update.
63
+     * @param eventBus           The event bus to post errors to
59 64
      */
60 65
     @Inject
61 66
     public ForceUpdate(
62 67
             final Provider<Debug> commandProvider,
63 68
             @GlobalConfig final AggregateConfigProvider globalConfig,
64 69
             final IdentityController identityController,
65
-            final CachingUpdateManager updateManager) {
70
+            final CachingUpdateManager updateManager,
71
+            final EventBus eventBus) {
66 72
         super(commandProvider);
67 73
 
68 74
         this.globalConfig = globalConfig;
69 75
         this.identityController = identityController;
70 76
         this.updateManager = updateManager;
77
+        this.eventBus = eventBus;
71 78
     }
72 79
 
73 80
     @Override
@@ -84,7 +91,8 @@ public class ForceUpdate extends DebugCommand {
84 91
     public void execute(final FrameContainer origin,
85 92
             final CommandArguments args, final CommandContext context) {
86 93
         if (globalConfig.getOptionBool("updater", "enable")) {
87
-            UpdateChecker.checkNow(updateManager, identityController, "Forced update checker");
94
+            UpdateChecker.checkNow(updateManager, identityController, eventBus,
95
+                    "Forced update checker");
88 96
         } else {
89 97
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "Update checking is "
90 98
                     + "currently disabled.  You can enable it by typing:");

+ 1
- 6
src/com/dmdirc/addons/ui_swing/dialogs/prefs/UpdateConfigPanel.java View File

@@ -170,17 +170,12 @@ public class UpdateConfigPanel extends JPanel implements ActionListener,
170 170
         add(checkNow, "right");
171 171
     }
172 172
 
173
-    /**
174
-     * {@inheritDoc}
175
-     *
176
-     * @param e Action event
177
-     */
178 173
     @Override
179 174
     public void actionPerformed(final ActionEvent e) {
180 175
         if (enable == e.getSource()) {
181 176
             checkNow.setEnabled(enable.isSelected());
182 177
         } else {
183
-            UpdateChecker.checkNow(updateManager, identityController);
178
+            UpdateChecker.checkNow(updateManager, identityController, eventBus);
184 179
         }
185 180
     }
186 181
 

Loading…
Cancel
Save