X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FKeyDialog.java;h=ffe70a3b7888e64dfdf1252628c4bcf7974a587b;hb=f80e371ad8592eb2114482be3ebc8c643b4c5684;hp=2e3082912530c888926ad66907e7881e93ca1f1f;hpb=3a538c657652e408b4507d59a8c3c48bbf00caad;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/KeyDialog.java b/src/de/todesbaum/jsite/application/KeyDialog.java index 2e30829..ffe70a3 100644 --- a/src/de/todesbaum/jsite/application/KeyDialog.java +++ b/src/de/todesbaum/jsite/application/KeyDialog.java @@ -81,6 +81,9 @@ public class KeyDialog extends JDialog { /** The text field for the public key. */ private JTextField publicKeyTextField; + /** Whether the dialog was cancelled. */ + private boolean cancelled; + /** * Creates a new key dialog. * @@ -108,6 +111,15 @@ public class KeyDialog extends JDialog { // /** + * Returns whether the dialog was cancelled. + * + * @return {@code true} if the dialog was cancelled, {@code false} otherwise + */ + public boolean wasCancelled() { + return cancelled; + } + + /** * Returns the public key. * * @return The public key @@ -276,6 +288,7 @@ public class KeyDialog extends JDialog { private void actionOk() { publicKey = publicKeyTextField.getText(); privateKey = privateKeyTextField.getText(); + cancelled = false; setVisible(false); } @@ -283,6 +296,7 @@ public class KeyDialog extends JDialog { * Quits the dialog, discarding all changes. */ private void actionCancel() { + cancelled = true; setVisible(false); }