From 2ec8180d2a000cb5d09b7c97a3878166d622de94 Mon Sep 17 00:00:00 2001 From: Henry Le Grys Date: Tue, 9 Feb 2021 01:41:49 +0000 Subject: [PATCH] Add confirmation dialog for forgetting accounts --- .../com/skcraft/launcher/dialog/AccountSelectDialog.java | 7 ++++++- .../com/skcraft/launcher/lang/Launcher.properties | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/launcher/src/main/java/com/skcraft/launcher/dialog/AccountSelectDialog.java b/launcher/src/main/java/com/skcraft/launcher/dialog/AccountSelectDialog.java index d7d4da0..8dc7331 100644 --- a/launcher/src/main/java/com/skcraft/launcher/dialog/AccountSelectDialog.java +++ b/launcher/src/main/java/com/skcraft/launcher/dialog/AccountSelectDialog.java @@ -111,7 +111,12 @@ public class AccountSelectDialog extends JDialog { removeSelected.addActionListener(ev -> { if (accountList.getSelectedValue() != null) { - launcher.getAccounts().remove(accountList.getSelectedValue()); + boolean confirmed = SwingHelper.confirmDialog(this, SharedLocale.tr("accounts.confirmForget"), + SharedLocale.tr("accounts.confirmForgetTitle")); + + if (confirmed) { + launcher.getAccounts().remove(accountList.getSelectedValue()); + } } }); diff --git a/launcher/src/main/resources/com/skcraft/launcher/lang/Launcher.properties b/launcher/src/main/resources/com/skcraft/launcher/lang/Launcher.properties index b729804..888e2a7 100644 --- a/launcher/src/main/resources/com/skcraft/launcher/lang/Launcher.properties +++ b/launcher/src/main/resources/com/skcraft/launcher/lang/Launcher.properties @@ -93,6 +93,8 @@ accounts.refreshingStatus=Refreshing login session... accounts.addMojang=Add Mojang account accounts.addMicrosoft=Add Microsoft account accounts.removeSelected=Forget selected account +accounts.confirmForgetTitle=Forget account +accounts.confirmForget=Are you sure that you want to forget that account? login.login=Login... login.recoverAccount=Forgot your login?