Browse Source

Show restart dialog if update dialog is open

Change-Id: I8c160de7bb70692b99e1cd0bb3988666f3651db7
Reviewed-on: http://gerrit.dmdirc.com/2811
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8
Greg Holmes 10 years ago
parent
commit
c5ba411153

+ 5
- 2
src/com/dmdirc/addons/ui_swing/dialogs/updater/SwingUpdaterDialog.java View File

@@ -57,7 +57,7 @@ import net.miginfocom.swing.MigLayout;
57 57
  * The updater dialog informs the user of the new update that is available,
58 58
  * and walks them through the process of downloading the update.
59 59
  */
60
-public final class SwingUpdaterDialog extends StandardDialog implements
60
+public class SwingUpdaterDialog extends StandardDialog implements
61 61
         ActionListener, UpdateManagerListener {
62 62
 
63 63
     /** Serial version UID. */
@@ -111,7 +111,7 @@ public final class SwingUpdaterDialog extends StandardDialog implements
111 111
         header = new TextLabel("An update is available for one or more "
112 112
                 + "components of DMDirc:");
113 113
 
114
-        final List<UpdateComponent> updates = new ArrayList<UpdateComponent>();
114
+        final List<UpdateComponent> updates = new ArrayList<>();
115 115
         for (UpdateComponent component : updateManager.getComponents()) {
116 116
             if (updateManager.getStatus(component) != UpdateStatus.IDLE
117 117
                     && updateManager.getStatus(component) != UpdateStatus.CHECKING_NOT_PERMITTED) {
@@ -222,6 +222,9 @@ public final class SwingUpdaterDialog extends StandardDialog implements
222 222
                 getOkButton().setEnabled(status != UpdateManagerStatus.WORKING);
223 223
 
224 224
                 if (status == UpdateManagerStatus.IDLE_RESTART_NEEDED) {
225
+                    if (isVisible()) {
226
+                        getController().showDialog(SwingRestartDialog.class);
227
+                    }
225 228
                     dispose();
226 229
                 } else {
227 230
                     getCancelButton().setVisible(true);

Loading…
Cancel
Save