From 30f564a886a6e72bda9faa3e9cf8d0740815eee5 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 6 Nov 2020 01:32:49 +0100 Subject: [PATCH] Removed savePassword option again --- .../banking/ui/android/dialogs/AddAccountDialog.kt | 2 +- .../ui/android/dialogs/settings/BankSettingsDialog.kt | 4 +--- .../ui/android/views/BankCredentialsPasswordView.kt | 6 ------ .../main/res/layout/view_bank_credentials_password.xml | 8 -------- .../src/main/res/values-de/strings.xml | 1 - ui/BankingAndroidApp/src/main/res/values/strings.xml | 1 - .../banking/ui/javafx/dialogs/AddAccountDialog.kt | 2 +- .../dankito/banking/ui/presenter/BankingPresenter.kt | 8 +++----- .../BankingiOSApp/Base.lproj/Localizable.strings | 1 - .../BankingiOSApp/de.lproj/Localizable.strings | 1 - .../BankingiOSApp/ui/dialogs/AddAccountDialog.swift | 5 ++--- .../BankingiOSApp/ui/dialogs/BankSettingsDialog.swift | 6 ++---- .../ui/views/BankCredentialsPasswordView.swift | 10 ++-------- 13 files changed, 12 insertions(+), 43 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt index 0b524fb6..c87e2061 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt @@ -120,7 +120,7 @@ open class AddAccountDialog : DialogFragment() { btnAddAccount.isEnabled = false pgrbrAddAccount.visibility = View.VISIBLE - presenter.addAccountAsync(selectedBank, userName, password, bankCredentialsPassword.savePassword) { response -> + presenter.addAccountAsync(selectedBank, userName, password) { response -> context?.asActivity()?.runOnUiThread { btnAddAccount.isEnabled = true pgrbrAddAccount.visibility = View.GONE diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt index b89e7e1c..b52e0b2e 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt @@ -63,7 +63,6 @@ open class BankSettingsDialog : SettingsDialogBase() { edtxtBankName.text = bank.displayName edtxtUserName.text = bank.userName bankCredentialsPassword.password = bank.password - bankCredentialsPassword.savePassword = bank.savePassword val tanMethodItems = createTanMethodItems() val tanMethodsAdapter = FastAdapterRecyclerView(rootView.rcyTanMethods, tanMethodItems) @@ -127,13 +126,12 @@ open class BankSettingsDialog : SettingsDialogBase() { get() = didChange(edtxtBankName, bank.displayName) || didChange(edtxtUserName, bank.userName) || bankCredentialsPassword.password != bank.password - || bankCredentialsPassword.savePassword != bank.savePassword || bank.selectedTanMethod != selectedTanMethod override fun saveChanges() { bank.userSetDisplayName = edtxtBankName.text - presenter.bankUpdated(bank, edtxtUserName.text, bankCredentialsPassword.password, bankCredentialsPassword.savePassword, selectedTanMethod) + presenter.bankUpdated(bank, edtxtUserName.text, bankCredentialsPassword.password, selectedTanMethod) } protected open fun askUserToDeleteAccount() { diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/BankCredentialsPasswordView.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/BankCredentialsPasswordView.kt index e349da37..b394ab05 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/BankCredentialsPasswordView.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/views/BankCredentialsPasswordView.kt @@ -38,10 +38,4 @@ open class BankCredentialsPasswordView @JvmOverloads constructor( open val passwordBox: TextInputEditText get() = textInputEditText - open var savePassword: Boolean - get() = swtchSavePassword.isChecked - set(value) { - swtchSavePassword.isChecked = value - } - } \ No newline at end of file diff --git a/ui/BankingAndroidApp/src/main/res/layout/view_bank_credentials_password.xml b/ui/BankingAndroidApp/src/main/res/layout/view_bank_credentials_password.xml index 5877ea08..1ba1b6d2 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/view_bank_credentials_password.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/view_bank_credentials_password.xml @@ -17,12 +17,4 @@ android:inputType="textPassword" /> - - \ No newline at end of file diff --git a/ui/BankingAndroidApp/src/main/res/values-de/strings.xml b/ui/BankingAndroidApp/src/main/res/values-de/strings.xml index 51097d48..c25d337a 100644 --- a/ui/BankingAndroidApp/src/main/res/values-de/strings.xml +++ b/ui/BankingAndroidApp/src/main/res/values-de/strings.xml @@ -24,7 +24,6 @@ Online-Banking Zugangsdaten Login Name Passwort - Password speichern (kommt noch) Konten Bankzugänge diff --git a/ui/BankingAndroidApp/src/main/res/values/strings.xml b/ui/BankingAndroidApp/src/main/res/values/strings.xml index 00b838d9..f16a5e01 100644 --- a/ui/BankingAndroidApp/src/main/res/values/strings.xml +++ b/ui/BankingAndroidApp/src/main/res/values/strings.xml @@ -24,7 +24,6 @@ Online banking login data Login name Password - Save password (to be implemented) Accounts Bank credentials diff --git a/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt b/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt index 3f9207f0..9bb6ec1b 100755 --- a/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt +++ b/ui/BankingJavaFxControls/src/main/kotlin/net/dankito/banking/ui/javafx/dialogs/AddAccountDialog.kt @@ -243,7 +243,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( isEnteredCredentialsResultVisible.value = false selectedBank?.let { - presenter.addAccountAsync(it, userName.value, password.value, true) { response -> + presenter.addAccountAsync(it, userName.value, password.value) { response -> runLater { handleAddAccountResultOnUiThread(response) } } } diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index 43c25b59..ac5d1118 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -174,9 +174,8 @@ open class BankingPresenter( // TODO: move BankInfo out of fints4k - open fun addAccountAsync(bankInfo: BankInfo, userName: String, password: String, savePassword: Boolean = true, callback: (AddAccountResponse) -> Unit) { + open fun addAccountAsync(bankInfo: BankInfo, userName: String, password: String, callback: (AddAccountResponse) -> Unit) { val bank = modelCreator.createBank(bankInfo.bankCode, userName, password, bankInfo.pinTanAddress ?: "", bankInfo.name, bankInfo.bic, "") - bank.savePassword = savePassword val newClient = getBankingClientCreatorForBank(bank).createClient(bank, dataFolder, asyncRunner, this.callback) @@ -527,14 +526,13 @@ open class BankingPresenter( callBanksChangedListeners() } - open fun bankUpdated(bank: TypedBankData, enteredUsername: String, enteredPassword: String, savePassword: Boolean, selectedTanMethod: TanMethod?) { - val didCredentialsChange = bank.userName != enteredUsername || bank.password != enteredPassword || bank.savePassword != savePassword + open fun bankUpdated(bank: TypedBankData, enteredUsername: String, enteredPassword: String, selectedTanMethod: TanMethod?) { + val didCredentialsChange = bank.userName != enteredUsername || bank.password != enteredPassword val didSelectedTanMethodChange = bank.selectedTanMethod != selectedTanMethod if (didCredentialsChange) { bank.userName = enteredUsername bank.password = enteredPassword - bank.savePassword = savePassword if (bank.wrongCredentialsEntered) { bank.wrongCredentialsEntered = false // so that on next call its accounts are considered and so it gets checked if credentials are now correct diff --git a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings index f03f56d0..27d397e0 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/Base.lproj/Localizable.strings @@ -78,7 +78,6 @@ "Enter Online banking login name" = "Enter login name"; "Online banking login password" = "Password"; "Enter Online banking login password" = "Enter password"; -"Save online banking login password" = "Save password (to be implemented)"; "Could not add account" = "Could not add account"; "Error message from your bank %@" = "Error message from your bank:\n\n%@"; diff --git a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings index b7fa9a0a..f858d7e1 100644 --- a/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings +++ b/ui/BankingiOSApp/BankingiOSApp/de.lproj/Localizable.strings @@ -78,7 +78,6 @@ "Enter Online banking login name" = "Login Name eingeben"; "Online banking login password" = "Passwort"; "Enter Online banking login password" = "Passwort eingeben"; -"Save online banking login password" = "Password speichern (kommt noch)"; "Could not add account" = "Konto konnte nicht hinzugefügt werden."; "Error message from your bank %@" = "Fehlermeldung Ihrer Bank:\n\n%@"; diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift index e3975cb4..56c2e9ba 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift @@ -9,7 +9,6 @@ struct AddAccountDialog: View { @State private var userName = "" @State private var password = "" - @State private var savePassword: Bool = true @State private var focusLoginNameTextField: Bool = false @@ -46,7 +45,7 @@ struct AddAccountDialog: View { LabelledUIKitTextField(label: "Online banking login name", text: $userName, placeholder: "Enter Online banking login name", autocapitalizationType: .none, focusNextTextFieldOnReturnKeyPress: true, focusTextField: focusLoginNameTextField, actionOnReturnKeyPress: handleReturnKeyPress) - BankCredentialsPasswordView($password, $savePassword, handleReturnKeyPress) + BankCredentialsPasswordView($password, handleReturnKeyPress) } Section { @@ -96,7 +95,7 @@ struct AddAccountDialog: View { isTryingToAddAccount = true UIApplication.hideKeyboard() - presenter.addAccountAsync(bankInfo: bank, userName: userName, password: password, savePassword: savePassword) { (response) in + presenter.addAccountAsync(bankInfo: bank, userName: userName, password: password) { (response) in self.handleAddAccountResponse(response) } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift index 540a2089..4e4f3f6e 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift @@ -16,7 +16,6 @@ struct BankSettingsDialog: View { @State private var userName: String @State private var password: String - @State private var savePassword: Bool @State private var selectedTanMethod: TanMethod? @@ -40,7 +39,6 @@ struct BankSettingsDialog: View { _userName = State(initialValue: bank.userName) _password = State(initialValue: bank.password) - _savePassword = State(initialValue: bank.savePassword) _selectedTanMethod = State(initialValue: bank.selectedTanMethod) @@ -58,7 +56,7 @@ struct BankSettingsDialog: View { LabelledUIKitTextField(label: "Online banking login name", text: $userName, autocapitalizationType: .none) - BankCredentialsPasswordView($password, $savePassword) + BankCredentialsPasswordView($password) } Section { @@ -133,7 +131,7 @@ struct BankSettingsDialog: View { if hasUnsavedData { bank.userSetDisplayName = displayName - presenter.bankUpdated(bank: bank, enteredUsername: userName, enteredPassword: password, savePassword: savePassword, selectedTanMethod: selectedTanMethod) + presenter.bankUpdated(bank: bank, enteredUsername: userName, enteredPassword: password, selectedTanMethod: selectedTanMethod) } closeDialog() diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankCredentialsPasswordView.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankCredentialsPasswordView.swift index 555dfa91..606d4e1b 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankCredentialsPasswordView.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankCredentialsPasswordView.swift @@ -5,14 +5,11 @@ struct BankCredentialsPasswordView: View { @Binding private var password: String - @Binding private var savePassword: Bool - private var handleReturnKeyPress: (() -> Bool)? = nil - init(_ password: Binding, _ showPassword: Binding, _ handleReturnKeyPress: (() -> Bool)? = nil) { + init(_ password: Binding, _ handleReturnKeyPress: (() -> Bool)? = nil) { self._password = password - self._savePassword = showPassword self.handleReturnKeyPress = handleReturnKeyPress } @@ -21,9 +18,6 @@ struct BankCredentialsPasswordView: View { var body: some View { LabelledUIKitTextField(label: "Online banking login password", text: $password, placeholder: "Enter Online banking login password", autocapitalizationType: .none, isPasswordField: true, actionOnReturnKeyPress: handleReturnKeyPress) - - Toggle("Save online banking login password", isOn: $savePassword) - .disabled(true) } } @@ -32,7 +26,7 @@ struct BankCredentialsPasswordView: View { struct BankCredentialsPasswordView_Previews: PreviewProvider { static var previews: some View { - BankCredentialsPasswordView(.constant(""), .constant(true)) + BankCredentialsPasswordView(.constant("")) } }