Cw 658 make the addressbook popup can be turned off from the settings (#1856)

* make ‘Add to Addressbook’ popup optional in settings

* localisation

* fix contacts page background color
This commit is contained in:
Serhii 2024-12-09 22:37:06 +02:00 committed by GitHub
parent c78662fbfe
commit 03ff2287db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 67 additions and 4 deletions

View file

@ -91,6 +91,7 @@ class PreferencesKey {
static const donationLinkWalletName = 'donation_link_wallet_name';
static const lastSeenAppVersion = 'last_seen_app_version';
static const shouldShowMarketPlaceInDashboard = 'should_show_marketplace_in_dashboard';
static const showAddressBookPopupEnabled = 'show_address_book_popup_enabled';
static const isNewInstall = 'is_new_install';
static const serviceStatusShaKey = 'service_status_sha_key';
static const walletConnectPairingTopicsList = 'wallet_connect_pairing_topics_list';

View file

@ -322,6 +322,7 @@ class _ContactListBodyState extends State<ContactListBody> {
? widget.contactListViewModel.contacts
: widget.contactListViewModel.contactsToShow;
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
body: Container(
child: FilteredList(
list: contacts,

View file

@ -525,14 +525,14 @@ class SendPage extends BasePage {
? '. ${S.of(_dialogContext).waitFewSecondForTxUpdate}'
: '';
final newContactMessage = newContactAddress != null
final newContactMessage = newContactAddress != null && sendViewModel.showAddressBookPopup
? '\n${S.of(_dialogContext).add_contact_to_address_book}'
: '';
String alertContent =
"$successMessage$waitMessage$newContactMessage";
if (newContactAddress != null) {
if (newContactMessage.isNotEmpty) {
return AlertWithTwoActions(
alertDialogKey: ValueKey('send_page_sent_dialog_key'),
alertTitle: '',

View file

@ -6,6 +6,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/setting_priority_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_cell_with_arrow.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_version_cell.dart';
import 'package:cake_wallet/view_model/settings/other_settings_view_model.dart';
import 'package:cw_core/wallet_type.dart';
@ -62,6 +63,13 @@ class OtherSettingsPage extends BasePage {
handler: (BuildContext context) =>
Navigator.of(context).pushNamed(Routes.readDisclaimer),
),
SettingsSwitcherCell(
title: S.of(context).show_address_book_popup,
value: _otherSettingsViewModel.showAddressBookPopup,
onValueChange: (_, bool value) {
_otherSettingsViewModel.setShowAddressBookPopup(value);
},
),
Spacer(),
SettingsVersionCell(
title: S.of(context).version(_otherSettingsViewModel.currentVersion)),

View file

@ -54,6 +54,7 @@ abstract class SettingsStoreBase with Store {
required BackgroundTasks backgroundTasks,
required SharedPreferences sharedPreferences,
required bool initialShouldShowMarketPlaceInDashboard,
required bool initialShowAddressBookPopupEnabled,
required FiatCurrency initialFiatCurrency,
required BalanceDisplayMode initialBalanceDisplayMode,
required bool initialSaveRecipientAddress,
@ -157,6 +158,7 @@ abstract class SettingsStoreBase with Store {
walletListAscending = initialWalletListAscending,
contactListAscending = initialContactListAscending,
shouldShowMarketPlaceInDashboard = initialShouldShowMarketPlaceInDashboard,
showAddressBookPopupEnabled = initialShowAddressBookPopupEnabled,
exchangeStatus = initialExchangeStatus,
currentTheme = initialTheme,
pinCodeLength = initialPinLength,
@ -354,6 +356,11 @@ abstract class SettingsStoreBase with Store {
(bool value) =>
sharedPreferences.setBool(PreferencesKey.shouldShowMarketPlaceInDashboard, value));
reaction(
(_) => showAddressBookPopupEnabled,
(bool value) =>
sharedPreferences.setBool(PreferencesKey.showAddressBookPopupEnabled, value));
reaction((_) => pinCodeLength,
(int pinLength) => sharedPreferences.setInt(PreferencesKey.currentPinLength, pinLength));
@ -606,6 +613,9 @@ abstract class SettingsStoreBase with Store {
@observable
bool shouldShowMarketPlaceInDashboard;
@observable
bool showAddressBookPopupEnabled;
@observable
ObservableList<ActionListDisplayMode> actionlistDisplayMode;
@ -917,6 +927,8 @@ abstract class SettingsStoreBase with Store {
final tokenTrialNumber = sharedPreferences.getInt(PreferencesKey.failedTotpTokenTrials) ?? 0;
final shouldShowMarketPlaceInDashboard =
sharedPreferences.getBool(PreferencesKey.shouldShowMarketPlaceInDashboard) ?? true;
final showAddressBookPopupEnabled =
sharedPreferences.getBool(PreferencesKey.showAddressBookPopupEnabled) ?? true;
final exchangeStatus = ExchangeApiMode.deserialize(
raw: sharedPreferences.getInt(PreferencesKey.exchangeStatusKey) ??
ExchangeApiMode.enabled.raw);
@ -1185,6 +1197,7 @@ abstract class SettingsStoreBase with Store {
secureStorage: secureStorage,
sharedPreferences: sharedPreferences,
initialShouldShowMarketPlaceInDashboard: shouldShowMarketPlaceInDashboard,
initialShowAddressBookPopupEnabled: showAddressBookPopupEnabled,
nodes: nodes,
powNodes: powNodes,
appVersion: packageInfo.version,
@ -1361,6 +1374,9 @@ abstract class SettingsStoreBase with Store {
shouldShowMarketPlaceInDashboard =
sharedPreferences.getBool(PreferencesKey.shouldShowMarketPlaceInDashboard) ??
shouldShowMarketPlaceInDashboard;
showAddressBookPopupEnabled =
sharedPreferences.getBool(PreferencesKey.showAddressBookPopupEnabled) ??
showAddressBookPopupEnabled;
exchangeStatus = ExchangeApiMode.deserialize(
raw: sharedPreferences.getInt(PreferencesKey.exchangeStatusKey) ??
ExchangeApiMode.enabled.raw);

View file

@ -109,6 +109,8 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
final UnspentCoinType coinTypeToSpendFrom;
bool get showAddressBookPopup => _settingsStore.showAddressBookPopupEnabled;
@action
void addOutput() {
outputs

View file

@ -60,6 +60,10 @@ abstract class OtherSettingsViewModelBase with Store {
bool get changeRepresentativeEnabled =>
_wallet.type == WalletType.nano || _wallet.type == WalletType.banano;
@computed
bool get showAddressBookPopup => _settingsStore.showAddressBookPopupEnabled;
@computed
bool get displayTransactionPriority => !(changeRepresentativeEnabled ||
_wallet.type == WalletType.solana ||
@ -114,6 +118,9 @@ abstract class OtherSettingsViewModelBase with Store {
return customItem != null ? priorities.indexOf(customItem) : null;
}
@action
void setShowAddressBookPopup(bool value) => _settingsStore.showAddressBookPopupEnabled = value;
int? get maxCustomFeeRate {
if (_wallet.type == WalletType.bitcoin) {
return bitcoin!.getMaxCustomFeeRate(_wallet);

View file

@ -710,6 +710,7 @@
"share_address": "شارك العنوان",
"shared_seed_wallet_groups": "مجموعات محفظة البذور المشتركة",
"show": "يعرض",
"show_address_book_popup": "عرض \"إضافة إلى كتاب العناوين\" المنبثقة بعد الإرسال",
"show_details": "اظهر التفاصيل",
"show_keys": "اظهار السييد / المفاتيح",
"show_market_place": "إظهار السوق",

View file

@ -710,6 +710,7 @@
"share_address": "Сподели адрес",
"shared_seed_wallet_groups": "Споделени групи за портфейли за семена",
"show": "Показване",
"show_address_book_popup": "Показване на изскачането на „Добавяне към адресната книга“ след изпращане",
"show_details": "Показване на подробностите",
"show_keys": "Покажи seed/keys",
"show_market_place": "Покажи пазар",

View file

@ -710,6 +710,7 @@
"share_address": "Sdílet adresu",
"shared_seed_wallet_groups": "Skupiny sdílených semen",
"show": "Show",
"show_address_book_popup": "Po odeslání zobrazíte vyskakovací okno „Přidat do adresáře“",
"show_details": "Zobrazit detaily",
"show_keys": "Zobrazit seed/klíče",
"show_market_place": "Zobrazit trh",

View file

@ -498,8 +498,8 @@
"placeholder_transactions": "Ihre Transaktionen werden hier angezeigt",
"please_fill_totp": "Bitte geben Sie den 8-stelligen Code ein, der auf Ihrem anderen Gerät vorhanden ist",
"please_make_selection": "Bitte treffen Sie unten eine Auswahl zum Erstellen oder Wiederherstellen Ihrer Wallet.",
"please_reference_document": "Bitte verweisen Sie auf die folgenden Dokumente, um weitere Informationen zu erhalten.",
"Please_reference_document": "Weitere Informationen finden Sie in den Dokumenten unten.",
"please_reference_document": "Bitte verweisen Sie auf die folgenden Dokumente, um weitere Informationen zu erhalten.",
"please_select": "Bitte auswählen:",
"please_select_backup_file": "Bitte wählen Sie die Sicherungsdatei und geben Sie das Sicherungskennwort ein.",
"please_try_to_connect_to_another_node": "Bitte versuchen Sie, sich mit einem anderen Knoten zu verbinden",
@ -711,6 +711,7 @@
"share_address": "Adresse teilen ",
"shared_seed_wallet_groups": "Gemeinsame Walletsseed Gruppen",
"show": "Zeigen",
"show_address_book_popup": "Popup \"zum Adressbuch hinzufügen\" nach dem Senden anzeigen",
"show_details": "Details anzeigen",
"show_keys": "Seed/Schlüssel anzeigen",
"show_market_place": "Marktplatz anzeigen",

View file

@ -710,6 +710,7 @@
"share_address": "Share address",
"shared_seed_wallet_groups": "Shared Seed Wallet Groups",
"show": "Show",
"show_address_book_popup": "Show 'Add to Address Book' popup after sending",
"show_details": "Show Details",
"show_keys": "Show seed/keys",
"show_market_place": "Show Marketplace",

View file

@ -711,6 +711,7 @@
"share_address": "Compartir dirección",
"shared_seed_wallet_groups": "Grupos de billetera de semillas compartidas",
"show": "Espectáculo",
"show_address_book_popup": "Mostrar ventana emergente 'Agregar a la libreta de direcciones' después de enviar",
"show_details": "Mostrar detalles",
"show_keys": "Mostrar semilla/claves",
"show_market_place": "Mostrar mercado",

View file

@ -710,6 +710,7 @@
"share_address": "Partager l'adresse",
"shared_seed_wallet_groups": "Groupes de portefeuilles partagés",
"show": "Montrer",
"show_address_book_popup": "Afficher la popup `` Ajouter au carnet d'adresses '' après avoir envoyé",
"show_details": "Afficher les détails",
"show_keys": "Visualiser la phrase secrète (seed) et les clefs",
"show_market_place": "Afficher la place de marché",

View file

@ -712,6 +712,7 @@
"share_address": "Raba adireshin",
"shared_seed_wallet_groups": "Raba ƙungiya walat",
"show": "Nuna",
"show_address_book_popup": "Nuna 'ƙara don magance littafin' Popup bayan aikawa",
"show_details": "Nuna Cikakkun bayanai",
"show_keys": "Nuna iri/maɓallai",
"show_market_place": "Nuna dan kasuwa",

View file

@ -712,6 +712,7 @@
"share_address": "पता साझा करें",
"shared_seed_wallet_groups": "साझा बीज बटुए समूह",
"show": "दिखाओ",
"show_address_book_popup": "भेजने के बाद 'एड एड्रेस बुक' पॉपअप दिखाएं",
"show_details": "विवरण दिखाएं",
"show_keys": "बीज / कुंजियाँ दिखाएँ",
"show_market_place": "बाज़ार दिखाएँ",

View file

@ -710,6 +710,7 @@
"share_address": "Podijeli adresu",
"shared_seed_wallet_groups": "Zajedničke grupe za sjeme novčanika",
"show": "Pokazati",
"show_address_book_popup": "Pokažite \"dodaj u adresar\" skočni prozor nakon slanja",
"show_details": "Prikaži pojedinosti",
"show_keys": "Prikaži pristupni izraz/ključ",
"show_market_place": "Prikaži tržište",

View file

@ -710,6 +710,7 @@
"share_address": "Կիսվել հասցեով",
"shared_seed_wallet_groups": "Համօգտագործված սերմերի դրամապանակների խմբեր",
"show": "Ցուցահանդես",
"show_address_book_popup": "Show ույց տալ «Ուղարկելուց հետո« Հասցեների գրքի »թռուցիկ",
"show_details": "Ցուցադրել մանրամասներ",
"show_keys": "Ցուցադրել բանալիներ",
"show_market_place": "Ցուցադրել շուկան",

View file

@ -713,6 +713,7 @@
"share_address": "Bagikan alamat",
"shared_seed_wallet_groups": "Kelompok dompet benih bersama",
"show": "Menunjukkan",
"show_address_book_popup": "Tampilkan popup 'Tambahkan ke Alamat' setelah mengirim",
"show_details": "Tampilkan Rincian",
"show_keys": "Tampilkan seed/kunci",
"show_market_place": "Tampilkan Pasar",

View file

@ -712,6 +712,7 @@
"share_address": "Condividi indirizzo",
"shared_seed_wallet_groups": "Gruppi di portafoglio di semi condivisi",
"show": "Spettacolo",
"show_address_book_popup": "Mostra il popup \"Aggiungi alla rubrica\" dopo l'invio",
"show_details": "Mostra dettagli",
"show_keys": "Mostra seme/chiavi",
"show_market_place": "Mostra mercato",

View file

@ -711,6 +711,7 @@
"share_address": "住所を共有する",
"shared_seed_wallet_groups": "共有シードウォレットグループ",
"show": "見せる",
"show_address_book_popup": "送信後に「アドレスブックに追加」ポップアップを表示します",
"show_details": "詳細を表示",
"show_keys": "シード/キーを表示する",
"show_market_place": "マーケットプレイスを表示",

View file

@ -711,6 +711,7 @@
"share_address": "주소 공유",
"shared_seed_wallet_groups": "공유 종자 지갑 그룹",
"show": "보여주다",
"show_address_book_popup": "전송 후 '주소 책에 추가'팝업을 표시하십시오",
"show_details": "세부정보 표시",
"show_keys": "시드 / 키 표시",
"show_market_place": "마켓플레이스 표시",

View file

@ -710,6 +710,7 @@
"share_address": "လိပ်စာမျှဝေပါ။",
"shared_seed_wallet_groups": "shared မျိုးစေ့ပိုက်ဆံအိတ်အုပ်စုများ",
"show": "ပြသ",
"show_address_book_popup": "ပေးပို့ပြီးနောက် 'address book' popup ကိုပြပါ",
"show_details": "အသေးစိတ်ပြ",
"show_keys": "မျိုးစေ့ /သော့များကို ပြပါ။",
"show_market_place": "စျေးကွက်ကိုပြသပါ။",

View file

@ -710,6 +710,7 @@
"share_address": "Deel adres",
"shared_seed_wallet_groups": "Gedeelde zaadportelgroepen",
"show": "Show",
"show_address_book_popup": "Toon 'Toevoegen aan adresboek' pop -up na verzenden",
"show_details": "Toon details",
"show_keys": "Toon zaad/sleutels",
"show_market_place": "Toon Marktplaats",

View file

@ -710,6 +710,7 @@
"share_address": "Udostępnij adres",
"shared_seed_wallet_groups": "Wspólne grupy portfeli nasion",
"show": "Pokazywać",
"show_address_book_popup": "Pokaż wysypkę „Dodaj do książki” po wysłaniu",
"show_details": "Pokaż szczegóły",
"show_keys": "Pokaż seed/klucze",
"show_market_place": "Pokaż rynek",

View file

@ -712,6 +712,7 @@
"share_address": "Compartilhar endereço",
"shared_seed_wallet_groups": "Grupos de carteira de sementes compartilhados",
"show": "Mostrar",
"show_address_book_popup": "Mostre pop -up 'Adicionar ao livro de endereços' depois de enviar",
"show_details": "Mostrar detalhes",
"show_keys": "Mostrar semente/chaves",
"show_market_place": "Mostrar mercado",

View file

@ -711,6 +711,7 @@
"share_address": "Поделиться адресом",
"shared_seed_wallet_groups": "Общие группы кошелька семян",
"show": "Показывать",
"show_address_book_popup": "Покажите всплывающее окно «Добавить в адрес адреса» после отправки",
"show_details": "Показать детали",
"show_keys": "Показать мнемоническую фразу/ключи",
"show_market_place": "Показать торговую площадку",

View file

@ -710,6 +710,7 @@
"share_address": "แชร์ที่อยู่",
"shared_seed_wallet_groups": "กลุ่มกระเป๋าเงินที่ใช้ร่วมกัน",
"show": "แสดง",
"show_address_book_popup": "แสดง 'เพิ่มในสมุดรายชื่อ' ป๊อปอัพหลังจากส่ง",
"show_details": "แสดงรายละเอียด",
"show_keys": "แสดงซีด/คีย์",
"show_market_place": "แสดงตลาดกลาง",

View file

@ -710,6 +710,7 @@
"share_address": "Ibahagi ang address",
"shared_seed_wallet_groups": "Ibinahaging mga pangkat ng pitaka ng binhi",
"show": "Ipakita",
"show_address_book_popup": "Ipakita ang popup na 'Idagdag sa Address Book' pagkatapos magpadala",
"show_details": "Ipakita ang mga detalye",
"show_keys": "Ipakita ang mga seed/key",
"show_market_place": "Ipakita ang Marketplace",

View file

@ -710,6 +710,7 @@
"share_address": "Adresi paylaş",
"shared_seed_wallet_groups": "Paylaşılan tohum cüzdan grupları",
"show": "Göstermek",
"show_address_book_popup": "Gönderdikten sonra 'adres defterine ekle' açılır",
"show_details": "Detayları Göster",
"show_keys": "Tohumları/anahtarları göster",
"show_market_place": "Pazar Yerini Göster",

View file

@ -711,6 +711,7 @@
"share_address": "Поділитися адресою",
"shared_seed_wallet_groups": "Спільні групи насіннєвих гаманців",
"show": "Показувати",
"show_address_book_popup": "Показати спливаюче вікно \"Додати до адресної книги\" після надсилання",
"show_details": "Показати деталі",
"show_keys": "Показати мнемонічну фразу/ключі",
"show_market_place": "Відображати маркетплейс",

View file

@ -712,6 +712,7 @@
"share_address": "پتہ شیئر کریں۔",
"shared_seed_wallet_groups": "مشترکہ بیج پرس گروپ",
"show": "دکھائیں",
"show_address_book_popup": "بھیجنے کے بعد 'ایڈریس میں شامل کریں کتاب' پاپ اپ دکھائیں",
"show_details": "تفصیلات دکھائیں",
"show_keys": "بیج / چابیاں دکھائیں۔",
"show_market_place": "بازار دکھائیں۔",

View file

@ -709,6 +709,7 @@
"share_address": "Chia sẻ địa chỉ",
"shared_seed_wallet_groups": "Nhóm ví hạt được chia sẻ",
"show": "Trình diễn",
"show_address_book_popup": "Hiển thị cửa sổ bật lên 'Thêm vào sổ địa chỉ' sau khi gửi",
"show_details": "Hiển thị chi tiết",
"show_keys": "Hiển thị hạt giống/khóa",
"show_market_place": "Hiển thị Thị trường",

View file

@ -711,6 +711,7 @@
"share_address": "Pín àdírẹ́sì",
"shared_seed_wallet_groups": "Awọn ẹgbẹ ti a pin irugbin",
"show": "Fihan",
"show_address_book_popup": "Fihan 'ṣafikun si Agbejade Iwe' Lẹhin fifiranṣẹ",
"show_details": "Fi ìsọfúnni kékeré hàn",
"show_keys": "Wo hóró / àwọn kọ́kọ́rọ́",
"show_market_place": "Wa Sopọ Pataki",

View file

@ -710,6 +710,7 @@
"share_address": "分享地址",
"shared_seed_wallet_groups": "共享种子钱包组",
"show": "展示",
"show_address_book_popup": "发送后显示“添加到通讯簿”弹出窗口",
"show_details": "显示详细信息",
"show_keys": "显示种子/密钥",
"show_market_place": "显示市场",