From a865d3b574469dd1d49adebe829bdc53bba04b9a Mon Sep 17 00:00:00 2001 From: macsleven Date: Sun, 31 May 2020 19:15:45 +0100 Subject: [PATCH 1/4] Rename default account to language translation and fix UI on wallet migration,delete watch only message and smaller screens --- Decred Wallet.xcodeproj/project.pbxproj | 2 +- Decred Wallet/Constants/Constants.swift | 2 ++ .../StartScreenViewController.swift | 11 +++++- .../Custom Dialogs/CustomDialogs.storyboard | 4 +-- .../More/More Features/About/About.storyboard | 10 +++--- .../Features/Security/Security.storyboard | 34 +++++++++---------- .../RestoreExistingWalletViewController.swift | 4 +++ .../Wallets/WalletInfoTableViewCell.xib | 2 +- .../WalletSettingsViewController.swift | 3 +- .../Wallets/WalletsViewController.swift | 16 +++++---- Decred Wallet/Utils/LocalizedStrings.swift | 3 ++ Decred Wallet/Utils/Utils.swift | 10 ++++++ Decred Wallet/en.lproj/Localizable.strings | 3 ++ Decred Wallet/es.lproj/Localizable.strings | 3 ++ Decred Wallet/pl.lproj/Localizable.strings | 3 ++ Decred Wallet/pt-BR.lproj/Localizable.strings | 3 ++ Decred Wallet/ru-RU.lproj/Localizable.strings | 3 ++ Decred Wallet/vi.lproj/Localizable.strings | 3 ++ .../zh-Hans.lproj/Localizable.strings | 3 ++ 19 files changed, 88 insertions(+), 34 deletions(-) diff --git a/Decred Wallet.xcodeproj/project.pbxproj b/Decred Wallet.xcodeproj/project.pbxproj index c1cb85ab8..e322060d2 100644 --- a/Decred Wallet.xcodeproj/project.pbxproj +++ b/Decred Wallet.xcodeproj/project.pbxproj @@ -834,8 +834,8 @@ DD493C01247654BC00C0D772 /* WatchOnlyWalletInfoTableViewCell.swift */, DD493C05247654BC00C0D772 /* WatchOnlyWalletTableViewCell.xib */, DD493BFF247654BC00C0D772 /* WatchOnlyWalletInfoTableViewCell.xib */, - B3E727C523DD4ABF003B06B4 /* WalletAccountTableViewCell.xib */, DD493C03247654BC00C0D772 /* WatchOnlyWalletTableViewCell.swift */, + B3E727C523DD4ABF003B06B4 /* WalletAccountTableViewCell.xib */, B3E727C923DD4AE7003B06B4 /* WalletAccountTableViewCell.swift */, B3B9432823E4D0B30088EC3E /* WalletSettingsViewController.swift */, B3D474DE23E55B5D00B6E305 /* WalletSettings.swift */, diff --git a/Decred Wallet/Constants/Constants.swift b/Decred Wallet/Constants/Constants.swift index c70ad0881..c16bdcec7 100644 --- a/Decred Wallet/Constants/Constants.swift +++ b/Decred Wallet/Constants/Constants.swift @@ -20,9 +20,11 @@ struct GlobalConstants { static let LEGACY_TESTNET_HD_PATH = "m / 44' / 11' /" static let MAINNET_HD_PATH = "m / 44' / 42' /" static let LEGACY_MAINNET_HD_PATH = "m / 44' / 20' /" + static let DEFAULT = "default" } struct Wallet { static let defaultRequiredConfirmations: Int32 = 2 + static let DEFAULT_ACCOUNT_NUMBER = 0 } } diff --git a/Decred Wallet/Features/App Launch/StartScreenViewController.swift b/Decred Wallet/Features/App Launch/StartScreenViewController.swift index 614158c99..d6d4fe51e 100644 --- a/Decred Wallet/Features/App Launch/StartScreenViewController.swift +++ b/Decred Wallet/Features/App Launch/StartScreenViewController.swift @@ -43,7 +43,11 @@ class StartScreenViewController: UIViewController, CAAnimationDelegate { print("init multiwallet error: \(initError!.localizedDescription)") } - if WalletLoader.shared.oneOrMoreWalletsExist { + if SingleToMultiWalletMigration.migrationNeeded { + self.loadingLabel.text = LocalizedStrings.migratingWallet + self.animationDurationSeconds = 5 + + } else if WalletLoader.shared.oneOrMoreWalletsExist { self.loadingLabel.text = LocalizedStrings.openingWallet self.animationDurationSeconds = 5 } @@ -143,6 +147,11 @@ class StartScreenViewController: UIViewController, CAAnimationDelegate { if createWalletError != nil { completion?.displayError(errorMessage: createWalletError!.localizedDescription) } else { + + if let wallet = WalletLoader.shared.wallets.filter({ $0.name == LocalizedStrings.myWallet}).first { + Utils.renameDefaultAccountToLocalLanguage(wallet: wallet) + } + completion?.dismissDialog() NavigationMenuTabBarController.setupMenuAndLaunchApp(isNewWallet: true) } diff --git a/Decred Wallet/Features/Custom Dialogs/CustomDialogs.storyboard b/Decred Wallet/Features/Custom Dialogs/CustomDialogs.storyboard index dc3c76f59..f4172e5f0 100644 --- a/Decred Wallet/Features/Custom Dialogs/CustomDialogs.storyboard +++ b/Decred Wallet/Features/Custom Dialogs/CustomDialogs.storyboard @@ -164,7 +164,7 @@ -