Wrong use of boolean, should be different

This commit is contained in:
comp500 2019-08-10 19:37:14 +01:00
parent 5fc7d6382d
commit e6637b9af8
3 changed files with 7 additions and 4 deletions

View File

@ -172,6 +172,8 @@ public class UpdateManager {
}
if (cancelled) {
System.out.println("Update cancelled by user!");
System.exit(1);
return;
}

View File

@ -23,6 +23,7 @@ public interface IUserInterface {
void executeManager(Runnable task);
// Return true if the installation was cancelled!
Future<Boolean> showOptions(List<IOptionDetails> option);
}

View File

@ -102,14 +102,14 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
future.complete(false);
future.complete(true);
}
@Override
public void windowClosed(WindowEvent e) {
// Just in case closing didn't get triggered - if something else called dispose() the
// future will have already completed
future.complete(false);
future.complete(true);
}
});
}
@ -189,10 +189,10 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("OK")) {
tableModel.finalise();
future.complete(true);
future.complete(false);
dispose();
} else if (e.getActionCommand().equals("Cancel")) {
future.complete(false);
future.complete(true);
dispose();
}
}