From 11464a79e66c25cd475f9617b8bbbc97a611c550 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Thu, 19 Nov 2020 18:48:09 +0200 Subject: [PATCH 1/9] CAKE-184 | cleaned exchange screen when exchange confirm page was called --- lib/src/screens/exchange/exchange_page.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index 7d90c177c..693e897be 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -555,6 +555,7 @@ class ExchangePage extends BasePage { }); } if (state is TradeIsCreatedSuccessfully) { + exchangeViewModel.reset(); Navigator.of(context).pushNamed(Routes.exchangeConfirm); } }); From 6cd6139fb382284503c40c5b286188617dc8e25a Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Thu, 19 Nov 2020 21:13:54 +0200 Subject: [PATCH 2/9] CAKE-169 | created connection_state.dart; added connect() method and connectionState parameter to node_create_or_edit_view_model.dart; replaced Reset button to Connect button and added _setEffects() method to node_create_or_edit_page.dart; changed useSSL parameter from false to true in the connectToNode() method (monero_wallet.dart) --- lib/monero/monero_wallet.dart | 2 +- .../nodes/node_create_or_edit_page.dart | 63 ++++++++++++++++++- .../node_list/connection_state.dart | 17 +++++ .../node_create_or_edit_view_model.dart | 20 +++++- 4 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 lib/view_model/node_list/connection_state.dart diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart index 2d4878b4c..a064ed337 100644 --- a/lib/monero/monero_wallet.dart +++ b/lib/monero/monero_wallet.dart @@ -147,7 +147,7 @@ abstract class MoneroWalletBase extends WalletBase with Store { address: node.uri, login: node.login, password: node.password, - useSSL: false, + useSSL: true, // FIXME: hardcoded value isLightWallet: false); // FIXME: hardcoded value syncStatus = ConnectedSyncStatus(); diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index ee13984c5..0511a21d0 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -1,3 +1,6 @@ +import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; +import 'package:cake_wallet/utils/show_pop_up.dart'; +import 'package:cake_wallet/view_model/node_list/connection_state.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -10,6 +13,7 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart'; +import 'package:cake_wallet/view_model/node_list/connection_state.dart'; class NodeCreateOrEditPage extends BasePage { NodeCreateOrEditPage(this.nodeCreateOrEditViewModel) @@ -60,6 +64,8 @@ class NodeCreateOrEditPage extends BasePage { final TextEditingController _loginController; final TextEditingController _passwordController; + bool _effectsInstalled = false; + @override String get title => S.current.node_new; @@ -67,6 +73,8 @@ class NodeCreateOrEditPage extends BasePage { @override Widget body(BuildContext context) { + _setEffects(context); + return Container( padding: EdgeInsets.only(left: 24, right: 24), child: ScrollableWithBottomSection( @@ -133,9 +141,18 @@ class NodeCreateOrEditPage extends BasePage { Flexible( child: Container( padding: EdgeInsets.only(right: 8.0), - child: PrimaryButton( - onPressed: () => nodeCreateOrEditViewModel.reset(), - text: S.of(context).reset, + child: LoadingPrimaryButton( + onPressed: () async { + if (!_formKey.currentState.validate()) { + return; + } + + await nodeCreateOrEditViewModel.connect(); + }, + isLoading: nodeCreateOrEditViewModel + .connectionState is IsConnectingState, + text: 'Connect', + isDisabled: !nodeCreateOrEditViewModel.isReady, color: Colors.orange, textColor: Colors.white), )), @@ -161,4 +178,44 @@ class NodeCreateOrEditPage extends BasePage { )), )); } + + void _setEffects(BuildContext context) { + if (_effectsInstalled) { + return; + } + + reaction((_) => nodeCreateOrEditViewModel.connectionState, + (ConnectionToNodeState state) { + if (state is ConnectedSuccessfullyState) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showPopUp( + context: context, + builder: (BuildContext context) => + AlertWithOneAction( + alertTitle: S.of(context).node_new, + alertContent: state.isAlive + ? 'Connected to node' + : 'Not connected to node', + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop())); + }); + } + + if (state is FailureConnectedState) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showPopUp( + context: context, + builder: (BuildContext context) { + return AlertWithOneAction( + alertTitle: S.of(context).error, + alertContent: state.error, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop()); + }); + }); + } + }); + + _effectsInstalled = true; + } } diff --git a/lib/view_model/node_list/connection_state.dart b/lib/view_model/node_list/connection_state.dart new file mode 100644 index 000000000..eb13e474c --- /dev/null +++ b/lib/view_model/node_list/connection_state.dart @@ -0,0 +1,17 @@ +abstract class ConnectionToNodeState {} + +class InitialConnectionState extends ConnectionToNodeState {} + +class IsConnectingState extends ConnectionToNodeState {} + +class ConnectedSuccessfullyState extends ConnectionToNodeState { + ConnectedSuccessfullyState(this.isAlive); + + final bool isAlive; +} + +class FailureConnectedState extends ConnectionToNodeState { + FailureConnectedState(this.error); + + final String error; +} \ No newline at end of file diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index fb6cd195e..df07f6789 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/core/execution_state.dart'; +import 'package:cake_wallet/view_model/node_list/connection_state.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/core/wallet_base.dart'; @@ -12,7 +13,8 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase abstract class NodeCreateOrEditViewModelBase with Store { NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet) - : state = InitialExecutionState(); + : state = InitialExecutionState(), + connectionState = InitialConnectionState(); @observable ExecutionState state; @@ -29,6 +31,9 @@ abstract class NodeCreateOrEditViewModelBase with Store { @observable String password; + @observable + ConnectionToNodeState connectionState; + @computed bool get isReady => (address?.isNotEmpty ?? false) && (port?.isNotEmpty ?? false); @@ -68,4 +73,17 @@ abstract class NodeCreateOrEditViewModelBase with Store { state = FailureState(e.toString()); } } + + @action + Future connect() async { + try { + connectionState = IsConnectingState(); + final node = + Node(uri: uri, type: _wallet.type, login: login, password: password); + final isAlive = await node.requestNode(); + connectionState = ConnectedSuccessfullyState(isAlive); + } catch (e) { + connectionState = FailureConnectedState(e.toString()); + } + } } From 88477751c67cde2ceab34f6a3b8deb72aff06a2c Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Fri, 20 Nov 2020 17:47:24 +0200 Subject: [PATCH 3/9] CAKE-169 | fixed string resources --- lib/generated/i18n.dart | 115 ++++++++++++++++++ .../nodes/node_create_or_edit_page.dart | 8 +- lib/src/screens/nodes/nodes_list_page.dart | 4 +- res/values/strings_de.arb | 7 +- res/values/strings_en.arb | 7 +- res/values/strings_es.arb | 7 +- res/values/strings_hi.arb | 7 +- res/values/strings_ja.arb | 7 +- res/values/strings_ko.arb | 7 +- res/values/strings_nl.arb | 7 +- res/values/strings_pl.arb | 7 +- res/values/strings_pt.arb | 7 +- res/values/strings_ru.arb | 7 +- res/values/strings_uk.arb | 7 +- res/values/strings_zh.arb | 7 +- 15 files changed, 193 insertions(+), 18 deletions(-) diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 48bff842c..9bc23d904 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -50,6 +50,7 @@ class S implements WidgetsLocalizations { String get card_address => "Address:"; String get change => "Change"; String get change_currency => "Change Currency"; + String get change_current_node_title => "Change current node"; String get change_exchange_provider => "Change Exchange Provider"; String get change_language => "Change language"; String get change_wallet_alert_title => "Change current wallet"; @@ -108,14 +109,18 @@ class S implements WidgetsLocalizations { String get incorrect_seed => "The text entered is not valid."; String get loading_your_wallet => "Loading your wallet"; String get login => "Login"; + String get new_node_testing => "New node testing"; String get new_subaddress_create => "Create"; String get new_subaddress_label_name => "Label name"; String get new_subaddress_title => "New address"; String get new_wallet => "New Wallet"; String get node_address => "Node Address"; + String get node_connection_failed => "Connection was failed"; + String get node_connection_successful => "Connection was successful"; String get node_new => "New Node"; String get node_port => "Node port"; String get node_reset_settings_title => "Reset settings"; + String get node_test => "Test"; String get nodes => "Nodes"; String get nodes_list_reset_to_default_message => "Are you sure that you want to reset settings to default?"; String get offer_expires_in => "Offer expires in: "; @@ -494,6 +499,8 @@ class $de extends S { @override String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:"; @override + String get node_connection_successful => "Die Verbindung war erfolgreich"; + @override String get confirm => "Bestätigen"; @override String get settings_display_balance_as => "Kontostand anzeigen als"; @@ -534,6 +541,8 @@ class $de extends S { @override String get contact => "Kontakt"; @override + String get change_current_node_title => "Ändern Sie den aktuellen Knoten"; + @override String get openalias_alert_title => "XMR-Empfänger erkannt"; @override String get auth_store_incorrect_password => "Falsches PIN"; @@ -566,6 +575,8 @@ class $de extends S { @override String get xmr_hidden => "Versteckt"; @override + String get node_connection_failed => "Verbindung fehlgeschlagen"; + @override String get send_xmr => "Senden XMR"; @override String get exchange => "Austausch"; @@ -642,6 +653,8 @@ class $de extends S { @override String get widgets_restore_from_blockheight => "Aus Blockhöhe wiederherstellen"; @override + String get new_node_testing => "Neuer Knotentest"; + @override String get seed_language_chinese => "Chinesisch"; @override String get new_subaddress_label_name => "Markenname"; @@ -774,6 +787,8 @@ class $de extends S { @override String get change => "Veränderung"; @override + String get node_test => "Test"; + @override String get trade_state_finished => "Fertig"; @override String get pin_is_incorrect => "PIN ist falsch"; @@ -1162,6 +1177,8 @@ class $hi extends S { @override String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:"; @override + String get node_connection_successful => "कनेक्शन सफल रहा"; + @override String get confirm => "की पुष्टि करें"; @override String get settings_display_balance_as => "के रूप में संतुलन प्रदर्शित करें"; @@ -1202,6 +1219,8 @@ class $hi extends S { @override String get contact => "संपर्क करें"; @override + String get change_current_node_title => "वर्तमान नोड बदलें"; + @override String get openalias_alert_title => "XMR प्राप्तकर्ता का पता लगाया"; @override String get auth_store_incorrect_password => "गलत पिन"; @@ -1234,6 +1253,8 @@ class $hi extends S { @override String get xmr_hidden => "छिपा हुआ"; @override + String get node_connection_failed => "कनेक्शन विफल रहा"; + @override String get send_xmr => "संदेश XMR"; @override String get exchange => "अदला बदली"; @@ -1310,6 +1331,8 @@ class $hi extends S { @override String get widgets_restore_from_blockheight => "ब्लॉकचेन से पुनर्स्थापित करें"; @override + String get new_node_testing => "नई नोड परीक्षण"; + @override String get seed_language_chinese => "चीनी"; @override String get new_subaddress_label_name => "लेबल का नाम"; @@ -1442,6 +1465,8 @@ class $hi extends S { @override String get change => "परिवर्तन"; @override + String get node_test => "परीक्षा"; + @override String get trade_state_finished => "ख़त्म होना"; @override String get pin_is_incorrect => "पिन गलत है"; @@ -1830,6 +1855,8 @@ class $ru extends S { @override String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:"; @override + String get node_connection_successful => "Подключение прошло успешно"; + @override String get confirm => "Подтвердить"; @override String get settings_display_balance_as => "Отображать баланс как"; @@ -1870,6 +1897,8 @@ class $ru extends S { @override String get contact => "Контакт"; @override + String get change_current_node_title => "Изменить текущую ноду"; + @override String get openalias_alert_title => "Получатель XMR обнаружен"; @override String get auth_store_incorrect_password => "Некорректный PIN"; @@ -1902,6 +1931,8 @@ class $ru extends S { @override String get xmr_hidden => "Скрыто"; @override + String get node_connection_failed => "Подключение не удалось"; + @override String get send_xmr => "Отправить XMR"; @override String get exchange => "Обмен"; @@ -1978,6 +2009,8 @@ class $ru extends S { @override String get widgets_restore_from_blockheight => "Восстановить на высоте блока"; @override + String get new_node_testing => "Тестирование новой ноды"; + @override String get seed_language_chinese => "Китайский"; @override String get new_subaddress_label_name => "Имя"; @@ -2110,6 +2143,8 @@ class $ru extends S { @override String get change => "Изменить"; @override + String get node_test => "Тест"; + @override String get trade_state_finished => "Завершена"; @override String get pin_is_incorrect => "Некорректный PIN"; @@ -2498,6 +2533,8 @@ class $ko extends S { @override String get choose_wallet_currency => "지갑 통화를 선택하십시오:"; @override + String get node_connection_successful => "성공적으로 연결되었습니다."; + @override String get confirm => "확인"; @override String get settings_display_balance_as => "잔액 표시"; @@ -2538,6 +2575,8 @@ class $ko extends S { @override String get contact => "접촉"; @override + String get change_current_node_title => "현재 노드 변경"; + @override String get openalias_alert_title => "XMR 수신자 감지"; @override String get auth_store_incorrect_password => "잘못된 PIN"; @@ -2570,6 +2609,8 @@ class $ko extends S { @override String get xmr_hidden => "숨김"; @override + String get node_connection_failed => "연결 실패"; + @override String get send_xmr => "보내다 XMR"; @override String get exchange => "교환"; @@ -2646,6 +2687,8 @@ class $ko extends S { @override String get widgets_restore_from_blockheight => "블록 높이에서 복원"; @override + String get new_node_testing => "새로운 노드 테스트"; + @override String get seed_language_chinese => "중국말"; @override String get new_subaddress_label_name => "라벨 이름"; @@ -2778,6 +2821,8 @@ class $ko extends S { @override String get change => "변화"; @override + String get node_test => "테스트"; + @override String get trade_state_finished => "끝마친"; @override String get pin_is_incorrect => "PIN이 잘못되었습니다"; @@ -3166,6 +3211,8 @@ class $pt extends S { @override String get choose_wallet_currency => "Escolha a moeda da carteira:"; @override + String get node_connection_successful => "A conexão foi bem sucedida"; + @override String get confirm => "Confirmar"; @override String get settings_display_balance_as => "Saldo a exibir"; @@ -3206,6 +3253,8 @@ class $pt extends S { @override String get contact => "Contato"; @override + String get change_current_node_title => "Mudar o nó atual"; + @override String get openalias_alert_title => "Destinatário XMR detectado"; @override String get auth_store_incorrect_password => "PIN incorreto"; @@ -3238,6 +3287,8 @@ class $pt extends S { @override String get xmr_hidden => "Esconder saldo"; @override + String get node_connection_failed => "A conexão falhou"; + @override String get send_xmr => "Enviar XMR"; @override String get exchange => "Trocar"; @@ -3314,6 +3365,8 @@ class $pt extends S { @override String get widgets_restore_from_blockheight => "Restaurar a partir de altura do bloco"; @override + String get new_node_testing => "Teste de novo nó"; + @override String get seed_language_chinese => "Chinesa"; @override String get new_subaddress_label_name => "Nome"; @@ -3446,6 +3499,8 @@ class $pt extends S { @override String get change => "Mudar"; @override + String get node_test => "Teste"; + @override String get trade_state_finished => "Finalizada"; @override String get pin_is_incorrect => "PIN incorreto"; @@ -3834,6 +3889,8 @@ class $uk extends S { @override String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:"; @override + String get node_connection_successful => "З'єднання було успішним"; + @override String get confirm => "Підтвердити"; @override String get settings_display_balance_as => "Відображати баланс як"; @@ -3874,6 +3931,8 @@ class $uk extends S { @override String get contact => "Контакт"; @override + String get change_current_node_title => "Змінити поточний вузол"; + @override String get openalias_alert_title => "Отримувача XMR виявлено"; @override String get auth_store_incorrect_password => "Некоректний PIN"; @@ -3906,6 +3965,8 @@ class $uk extends S { @override String get xmr_hidden => "Приховано"; @override + String get node_connection_failed => "Помилка з’єднання"; + @override String get send_xmr => "Відправити XMR"; @override String get exchange => "Обмін"; @@ -3982,6 +4043,8 @@ class $uk extends S { @override String get widgets_restore_from_blockheight => "Відновити на висоті блоку"; @override + String get new_node_testing => "Тестування нового вузла"; + @override String get seed_language_chinese => "Китайська"; @override String get new_subaddress_label_name => "Ім'я"; @@ -4114,6 +4177,8 @@ class $uk extends S { @override String get change => "Змінити"; @override + String get node_test => "Тест"; + @override String get trade_state_finished => "Завершена"; @override String get pin_is_incorrect => "Некоректний PIN"; @@ -4502,6 +4567,8 @@ class $ja extends S { @override String get choose_wallet_currency => "ウォレット通貨を選択してください:"; @override + String get node_connection_successful => "接続に成功しました"; + @override String get confirm => "確認する"; @override String get settings_display_balance_as => "残高を表示"; @@ -4542,6 +4609,8 @@ class $ja extends S { @override String get contact => "接触"; @override + String get change_current_node_title => "現在のノードを変更する"; + @override String get openalias_alert_title => "XMR受信者が検出されました"; @override String get auth_store_incorrect_password => "間違ったPIN"; @@ -4574,6 +4643,8 @@ class $ja extends S { @override String get xmr_hidden => "非表示"; @override + String get node_connection_failed => "接続に失敗しました"; + @override String get send_xmr => "送る XMR"; @override String get exchange => "交換する"; @@ -4650,6 +4721,8 @@ class $ja extends S { @override String get widgets_restore_from_blockheight => "ブロックの高さから復元"; @override + String get new_node_testing => "新しいノードのテスト"; + @override String get seed_language_chinese => "中国語"; @override String get new_subaddress_label_name => "ラベル名"; @@ -4782,6 +4855,8 @@ class $ja extends S { @override String get change => "変化する"; @override + String get node_test => "テスト"; + @override String get trade_state_finished => "完成した"; @override String get pin_is_incorrect => "PINが間違っています"; @@ -5174,6 +5249,8 @@ class $pl extends S { @override String get choose_wallet_currency => "Wybierz walutę portfela:"; @override + String get node_connection_successful => "Połączenie powiodło się"; + @override String get confirm => "Potwierdzać"; @override String get settings_display_balance_as => "Wyświetl saldo jako"; @@ -5214,6 +5291,8 @@ class $pl extends S { @override String get contact => "Kontakt"; @override + String get change_current_node_title => "Zmień bieżący węzeł"; + @override String get openalias_alert_title => "Wykryto odbiorcę XMR"; @override String get auth_store_incorrect_password => "Niepoprawny PIN"; @@ -5246,6 +5325,8 @@ class $pl extends S { @override String get xmr_hidden => "Ukryty"; @override + String get node_connection_failed => "Połączenie nie powiodło się"; + @override String get send_xmr => "Wysłać XMR"; @override String get exchange => "Wymieniać się"; @@ -5322,6 +5403,8 @@ class $pl extends S { @override String get widgets_restore_from_blockheight => "Przywróć z wysokości bloku"; @override + String get new_node_testing => "Testowanie nowych węzłów"; + @override String get seed_language_chinese => "Chiński"; @override String get new_subaddress_label_name => "Nazwa etykiety"; @@ -5454,6 +5537,8 @@ class $pl extends S { @override String get change => "Zmiana"; @override + String get node_test => "Test"; + @override String get trade_state_finished => "Skończone"; @override String get pin_is_incorrect => "PPIN jest niepoprawny"; @@ -5842,6 +5927,8 @@ class $es extends S { @override String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:"; @override + String get node_connection_successful => "La conexión fue exitosa"; + @override String get confirm => "Confirmar"; @override String get settings_display_balance_as => "Mostrar saldo como"; @@ -5882,6 +5969,8 @@ class $es extends S { @override String get contact => "Contacto"; @override + String get change_current_node_title => "Cambiar el nodo actual"; + @override String get openalias_alert_title => "Destinatario XMR detectado"; @override String get auth_store_incorrect_password => "Contraseña PIN"; @@ -5914,6 +6003,8 @@ class $es extends S { @override String get xmr_hidden => "Oculto"; @override + String get node_connection_failed => "La conexión falló"; + @override String get send_xmr => "Enviar XMR"; @override String get exchange => "Intercambiar"; @@ -5990,6 +6081,8 @@ class $es extends S { @override String get widgets_restore_from_blockheight => "Restaurar desde blockheight"; @override + String get new_node_testing => "Prueba de nuevos nodos"; + @override String get seed_language_chinese => "Chino"; @override String get new_subaddress_label_name => "Nombre de etiqueta"; @@ -6122,6 +6215,8 @@ class $es extends S { @override String get change => "Cambio"; @override + String get node_test => "Prueba"; + @override String get trade_state_finished => "Terminado"; @override String get pin_is_incorrect => "PIN es incorrecto"; @@ -6510,6 +6605,8 @@ class $nl extends S { @override String get choose_wallet_currency => "Kies een portemonnee-valuta:"; @override + String get node_connection_successful => "Verbinding is gelukt"; + @override String get confirm => "Bevestigen"; @override String get settings_display_balance_as => "Toon saldo als"; @@ -6550,6 +6647,8 @@ class $nl extends S { @override String get contact => "Contact"; @override + String get change_current_node_title => "Wijzig het huidige knooppunt"; + @override String get openalias_alert_title => "XMR-ontvanger gedetecteerd"; @override String get auth_store_incorrect_password => "Incorrect PIN"; @@ -6582,6 +6681,8 @@ class $nl extends S { @override String get xmr_hidden => "Verborgen"; @override + String get node_connection_failed => "De verbinding is mislukt"; + @override String get send_xmr => "Sturen XMR"; @override String get exchange => "Uitwisseling"; @@ -6658,6 +6759,8 @@ class $nl extends S { @override String get widgets_restore_from_blockheight => "Herstel vanaf blockheight"; @override + String get new_node_testing => "Nieuwe knooppunttest"; + @override String get seed_language_chinese => "Chinese"; @override String get new_subaddress_label_name => "Label naam"; @@ -6790,6 +6893,8 @@ class $nl extends S { @override String get change => "Verandering"; @override + String get node_test => "Test"; + @override String get trade_state_finished => "Afgewerkt"; @override String get pin_is_incorrect => "PIN is onjuist"; @@ -7178,6 +7283,8 @@ class $zh extends S { @override String get choose_wallet_currency => "請選擇錢包貨幣:"; @override + String get node_connection_successful => "連接成功"; + @override String get confirm => "确认"; @override String get settings_display_balance_as => "将余额显示为"; @@ -7218,6 +7325,8 @@ class $zh extends S { @override String get contact => "联系"; @override + String get change_current_node_title => "更改當前節點"; + @override String get openalias_alert_title => "檢測到XMR收件人"; @override String get auth_store_incorrect_password => "PIN码错误"; @@ -7250,6 +7359,8 @@ class $zh extends S { @override String get xmr_hidden => "隱"; @override + String get node_connection_failed => "連接失敗"; + @override String get send_xmr => "发送 XMR"; @override String get exchange => "交换"; @@ -7326,6 +7437,8 @@ class $zh extends S { @override String get widgets_restore_from_blockheight => "从块高还原"; @override + String get new_node_testing => "新節點測試"; + @override String get seed_language_chinese => "中文"; @override String get new_subaddress_label_name => "标签名称"; @@ -7458,6 +7571,8 @@ class $zh extends S { @override String get change => "更改"; @override + String get node_test => "測試"; + @override String get trade_state_finished => "已完成"; @override String get pin_is_incorrect => "PIN码不正确"; diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index 0511a21d0..6b79c234b 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -151,7 +151,7 @@ class NodeCreateOrEditPage extends BasePage { }, isLoading: nodeCreateOrEditViewModel .connectionState is IsConnectingState, - text: 'Connect', + text: S.of(context).node_test, isDisabled: !nodeCreateOrEditViewModel.isReady, color: Colors.orange, textColor: Colors.white), @@ -192,10 +192,10 @@ class NodeCreateOrEditPage extends BasePage { context: context, builder: (BuildContext context) => AlertWithOneAction( - alertTitle: S.of(context).node_new, + alertTitle: S.of(context).new_node_testing, alertContent: state.isAlive - ? 'Connected to node' - : 'Not connected to node', + ? S.of(context).node_connection_successful + : S.of(context).node_connection_failed, buttonText: S.of(context).ok, buttonAction: () => Navigator.of(context).pop())); }); diff --git a/lib/src/screens/nodes/nodes_list_page.dart b/lib/src/screens/nodes/nodes_list_page.dart index 20abdae32..80697afad 100644 --- a/lib/src/screens/nodes/nodes_list_page.dart +++ b/lib/src/screens/nodes/nodes_list_page.dart @@ -99,9 +99,9 @@ class NodeListPage extends BasePage { await showPopUp( context: context, builder: (BuildContext context) { - // FIXME: Add translation. return AlertWithTwoActions( - alertTitle: 'Change current node', + alertTitle: S.of(context) + .change_current_node_title, alertContent: S .of(context) .change_current_node(node.uri), diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index cf74c18aa..f86b42a5b 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Wechseln Sie den Exchange-Anbieter", "you_will_send" : "Konvertieren von", "you_will_get" : "Konvertieren zu", - "amount_is_guaranteed" : "WICHTIG:\nWenn Sie einen garantierten BTC-Betrag erhalten möchten, geben Sie diesen Betrag in das Feld BTC ein. Wenn Sie stattdessen einen XMR-Betrag eingeben, handelt es sich bei dem erhaltenen BTC-Betrag um eine Schätzung, die je nach Kurs schwanken kann.", + "amount_is_guaranteed" : "Geben Sie in xmr.to den BTC-Betrag und nicht den oben genannten XMR-Betrag ein, um einen garantierten BTC-Betrag zu erhalten", "amount_is_estimate" : "Der empfangene Betrag ist eine Schätzung", "powered_by" : "Unterstützt von ${title}", "error" : "Error", @@ -129,6 +129,11 @@ "remove" : "Löschen", "delete" : "Löschen", "add_new_node" : "Neuen Knoten hinzufügen", + "change_current_node_title" : "Ändern Sie den aktuellen Knoten", + "node_test" : "Test", + "node_connection_successful" : "Die Verbindung war erfolgreich", + "node_connection_failed" : "Verbindung fehlgeschlagen", + "new_node_testing" : "Neuer Knotentest", "use" : "Verwenden Sie ", diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index b3a30feac..1bce25396 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Change Exchange Provider", "you_will_send" : "Convert from", "you_will_get" : "Convert to", - "amount_is_guaranteed" : "IMPORTANT:\nIf you want to receive a guaranteed amount of BTC, please enter that amount in the BTC field. If you enter an XMR amount instead, then the BTC amount received is an estimate and can fluctuate depending on the rates.", + "amount_is_guaranteed" : "In xmr.to, to receive a guaranteed BTC amount, enter the BTC amount and not the XMR amount above", "amount_is_estimate" : "The receive amount is an estimate", "powered_by" : "Powered by ${title}", "error" : "Error", @@ -129,6 +129,11 @@ "remove" : "Remove", "delete" : "Delete", "add_new_node" : "Add new node", + "change_current_node_title" : "Change current node", + "node_test" : "Test", + "node_connection_successful" : "Connection was successful", + "node_connection_failed" : "Connection was failed", + "new_node_testing" : "New node testing", "use" : "Switch to ", diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index 59258df5b..acf6e0eb3 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Cambiar proveedor de intercambio", "you_will_send" : "Convertir de", "you_will_get" : "Convertir a", - "amount_is_guaranteed" : "IMPORTANTE:\nSi desea recibir una cantidad garantizada de BTC, ingrese esa cantidad en el campo BTC. Si ingresa una cantidad de XMR en su lugar, la cantidad de BTC recibida es una estimación y puede variar según las tarifas.", + "amount_is_guaranteed" : "En xmr.to, para recibir una cantidad BTC garantizada, ingrese la cantidad BTC y no la cantidad XMR arriba", "amount_is_estimate" : "El monto recibido es un estimado", "powered_by" : "Energizado por ${title}", "error" : "Error", @@ -129,6 +129,11 @@ "remove" : "Retirar", "delete" : "Borrar", "add_new_node" : "Agregar nuevo nodo", + "change_current_node_title" : "Cambiar el nodo actual", + "node_test" : "Prueba", + "node_connection_successful" : "La conexión fue exitosa", + "node_connection_failed" : "La conexión falló", + "new_node_testing" : "Prueba de nuevos nodos", "use" : "Utilizar a ", diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index 58212a819..6296fe1e7 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "एक्सचेंज प्रदाता बदलें", "you_will_send" : "से रूपांतरित करें", "you_will_get" : "में बदलें", - "amount_is_guaranteed" : "महत्वपूर्ण:\nयदि आप BTC की गारंटीकृत राशि प्राप्त करना चाहते हैं, तो कृपया उस राशि को BTC फ़ील्ड में दर्ज करें। यदि आप इसके बजाय एक एक्सएमआर राशि दर्ज करते हैं, तो प्राप्त बीटीसी राशि एक अनुमान है और दरों के आधार पर इसमें उतार-चढ़ाव हो सकता है।", + "amount_is_guaranteed" : "Xmr.to में, गारंटीशुदा BTC राशि प्राप्त करने के लिए, BTC राशि दर्ज करें और ऊपर XMR राशि नहीं", "amount_is_estimate" : "प्राप्त राशि एक अनुमान है", "powered_by" : "द्वारा संचालित ${title}", "error" : "त्रुटि", @@ -129,6 +129,11 @@ "remove" : "हटाना", "delete" : "हटाएं", "add_new_node" : "नया नोड जोड़ें", + "change_current_node_title" : "वर्तमान नोड बदलें", + "node_test" : "परीक्षा", + "node_connection_successful" : "कनेक्शन सफल रहा", + "node_connection_failed" : "कनेक्शन विफल रहा", + "new_node_testing" : "नई नोड परीक्षण", "use" : "उपयोग ", diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index 7a6ff8994..be5862016 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Exchangeプロバイダーの変更", "you_will_send" : "から変換", "you_will_get" : "に変換", - "amount_is_guaranteed" : "重要:\n保証された金額のBTCを受け取りたい場合は、その金額を[BTC]フィールドに入力してください。 代わりにXMR金額を入力した場合、受け取ったBTC金額は見積もりであり、レートに応じて変動する可能性があります。", + "amount_is_guaranteed" : "xmr.toで、保証されたBTC金額を受け取るには、上記のXMR金額ではなく、BTC金額を入力します", "amount_is_estimate" : "受け取り金額は見積もりです", "powered_by" : "搭載 ${title}", "error" : "エラー", @@ -129,6 +129,11 @@ "remove" : "削除する", "delete" : "削除する", "add_new_node" : "新しいノードを追加", + "change_current_node_title" : "現在のノードを変更する", + "node_test" : "テスト", + "node_connection_successful" : "接続に成功しました", + "node_connection_failed" : "接続に失敗しました", + "new_node_testing" : "新しいノードのテスト", "use" : "使用する ", diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index 3665491fd..d23973bf1 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "교환 공급자 변경", "you_will_send" : "다음에서 변환", "you_will_get" : "로 변환하다", - "amount_is_guaranteed" : "중대한:\n보장 된 BTC 금액을 받으려면 BTC 필드에 해당 금액을 입력하십시오. 대신 XMR 금액을 입력하면 수령 한 BTC 금액이 추정치이며 요율에 따라 변동될 수 있습니다.", + "amount_is_guaranteed" : "xmr.to에서 보장 된 BTC 금액을 받으려면 위의 XMR 금액이 아닌 BTC 금액을 입력하십시오.", "amount_is_estimate" : "수신 금액은 견적입니다", "powered_by" : "에 의해 구동 ${title}", "error" : "오류", @@ -129,6 +129,11 @@ "remove" : "없애다", "delete" : "지우다", "add_new_node" : "새 노드 추가", + "change_current_node_title" : "현재 노드 변경", + "node_test" : "테스트", + "node_connection_successful" : "성공적으로 연결되었습니다.", + "node_connection_failed" : "연결 실패", + "new_node_testing" : "새로운 노드 테스트", "use" : "사용하다 ", diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index c8fd4a351..81ee4ce92 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Wijzig Exchange Provider", "you_will_send" : "Converteren van", "you_will_get" : "Converteren naar", - "amount_is_guaranteed" : "BELANGRIJK:\nAls u een gegarandeerd bedrag aan BTC wilt ontvangen, voert u dat bedrag in het BTC-veld in. Als u in plaats daarvan een XMR-bedrag invoert, is het ontvangen BTC-bedrag een schatting en kan het fluctueren afhankelijk van de tarieven.", + "amount_is_guaranteed" : "Om een gegarandeerd BTC-bedrag te ontvangen, voert u in xmr.to het BTC-bedrag in en niet het bovenstaande XMR-bedrag", "amount_is_estimate" : "Het ontvangen bedrag is een schatting", "powered_by" : "Aangedreven door ${title}", "error" : "Fout", @@ -129,6 +129,11 @@ "remove" : "Verwijderen", "delete" : "Delete", "add_new_node" : "Voeg een nieuw knooppunt toe", + "change_current_node_title" : "Wijzig het huidige knooppunt", + "node_test" : "Test", + "node_connection_successful" : "Verbinding is gelukt", + "node_connection_failed" : "De verbinding is mislukt", + "new_node_testing" : "Nieuwe knooppunttest", "use" : "Gebruik ", diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index 4e458021d..1f10fc004 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Zmień dostawcę programu Exchange", "you_will_send" : "Konwertuj z", "you_will_get" : "Konwertuj na", - "amount_is_guaranteed" : "WAŻNY:\nJeśli chcesz otrzymać gwarantowaną kwotę BTC, wprowadź tę kwotę w polu BTC. Jeśli zamiast tego wpiszesz kwotę XMR, otrzymana kwota BTC jest szacunkowa i może się zmieniać w zależności od stawek.", + "amount_is_guaranteed" : "W xmr.to, aby otrzymać gwarantowaną kwotę BTC, wprowadź kwotę BTC, a nie kwotę XMR powyżej", "amount_is_estimate" : "Otrzymana kwota jest wartością szacunkową", "powered_by" : "Zasilany przez ${title}", "error" : "Błąd", @@ -129,6 +129,11 @@ "remove" : "Usunąć", "delete" : "Kasować", "add_new_node" : "Dodaj nowy węzeł", + "change_current_node_title" : "Zmień bieżący węzeł", + "node_test" : "Test", + "node_connection_successful" : "Połączenie powiodło się", + "node_connection_failed" : "Połączenie nie powiodło się", + "new_node_testing" : "Testowanie nowych węzłów", "use" : "Używać ", diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index cb7a3bd2d..55b40ed71 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Alterar o provedor de troca", "you_will_send" : "Converter de", "you_will_get" : "Converter para", - "amount_is_guaranteed" : "IMPORTANTE:\nSe você deseja receber um valor garantido de BTC, insira esse valor no campo BTC. Se, em vez disso, você inserir um valor XMR, o valor BTC recebido é uma estimativa e pode flutuar dependendo das taxas.", + "amount_is_guaranteed" : "Em xmr.to, para receber um valor BTC garantido, insira o valor BTC e não o valor XMR acima", "amount_is_estimate" : "O valor a ser recebido informado acima é uma estimativa", "powered_by" : "Troca realizada por ${title}", "error" : "Erro", @@ -129,6 +129,11 @@ "remove" : "Remover", "delete" : "Excluir", "add_new_node" : "Adicionar novo nó", + "change_current_node_title" : "Mudar o nó atual", + "node_test" : "Teste", + "node_connection_successful" : "A conexão foi bem sucedida", + "node_connection_failed" : "A conexão falhou", + "new_node_testing" : "Teste de novo nó", "use" : "Use PIN de ", diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index 5ad7568ed..f873cd482 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Изменить провайдера обмена", "you_will_send" : "Конвертировать из", "you_will_get" : "Конвертировать в", - "amount_is_guaranteed" : "ВАЖНО:\nЕсли вы хотите получить гарантированную сумму BTC, введите эту сумму в поле BTC. Если вместо этого вы вводите сумму XMR, полученная сумма BTC является приблизительной и может колебаться в зависимости от курса.", + "amount_is_guaranteed" : "В xmr.to, чтобы получить гарантированную сумму BTC, введите сумму BTC, а не сумму XMR выше", "amount_is_estimate" : "Полученная сумма является приблизительной", "powered_by" : "Используя ${title}", "error" : "Ошибка", @@ -129,6 +129,11 @@ "remove" : "Удалить", "delete" : "Удалить", "add_new_node" : "Добавить новую ноду", + "change_current_node_title" : "Изменить текущую ноду", + "node_test" : "Тест", + "node_connection_successful" : "Подключение прошло успешно", + "node_connection_failed" : "Подключение не удалось", + "new_node_testing" : "Тестирование новой ноды", "use" : "Использовать ", diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index 480685e08..eeebf2468 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "Змінити провайдера обміну", "you_will_send" : "Конвертувати з", "you_will_get" : "Конвертувати в", - "amount_is_guaranteed" : "ВАЖЛИВО:\nЯкщо ви хочете отримати гарантовану суму BTC, введіть цю суму в поле BTC. Якщо замість цього ввести суму XMR, отримана сума BTC є приблизною і може коливатися залежно від курсу.", + "amount_is_guaranteed" : "У xmr.to, щоб отримати гарантовану суму BTC, введіть суму BTC, а не XMR вище", "amount_is_estimate" : "Отримана сума є приблизною", "powered_by" : "Використовуючи ${title}", "error" : "Помилка", @@ -129,6 +129,11 @@ "remove" : "Видалити", "delete" : "Видалити", "add_new_node" : "Додати новий вузол", + "change_current_node_title" : "Змінити поточний вузол", + "node_test" : "Тест", + "node_connection_successful" : "З'єднання було успішним", + "node_connection_failed" : "Помилка з’єднання", + "new_node_testing" : "Тестування нового вузла", "use" : "Використати ", diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index 38d807906..a2c752371 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -65,7 +65,7 @@ "change_exchange_provider" : "更改交易所提供商", "you_will_send" : "從轉換", "you_will_get" : "轉換成", - "amount_is_guaranteed" : "重要:\n如果您想獲得保證的BTC金額,請在BTC字段中輸入該金額。 如果您輸入的是XMR金額,則收到的BTC金額只是估算值,可能會隨匯率而波動。", + "amount_is_guaranteed" : "在xmr.to中,要接收保证的BTC数量,请输入BTC数量,而不要输入上方的XMR数量", "amount_is_estimate" : "收款金额为估算值", "powered_by" : "供电 ${title}", "error" : "错误", @@ -129,6 +129,11 @@ "remove" : "去掉", "delete" : "删除", "add_new_node" : "添加新節點", + "change_current_node_title" : "更改當前節點", + "node_test" : "測試", + "node_connection_successful" : "連接成功", + "node_connection_failed" : "連接失敗", + "new_node_testing" : "新節點測試", "use" : "採用 ", From 83fea0e9d3a440e8ccee140d068904c7d584af91 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Fri, 20 Nov 2020 18:46:06 +0200 Subject: [PATCH 4/9] CAKE-169 | made Save button disabled during testing connection to node (node_create_or_edit_page.dart) --- lib/src/screens/nodes/node_create_or_edit_page.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index 6b79c234b..63009b089 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -171,7 +171,9 @@ class NodeCreateOrEditPage extends BasePage { text: S.of(context).save, color: Theme.of(context).accentTextTheme.body2.color, textColor: Colors.white, - isDisabled: !nodeCreateOrEditViewModel.isReady, + isDisabled: (!nodeCreateOrEditViewModel.isReady)|| + (nodeCreateOrEditViewModel + .connectionState is IsConnectingState), ), )), ], From 5ee278237f3efa446126fb31331df14fc91942b3 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Mon, 30 Nov 2020 19:05:49 +0200 Subject: [PATCH 5/9] CAKE-169 | added useSSL parameter to node.dart and to node_create_or_edit_view_model.dart; applied useSSL parameter in the connectToNode() method (monero_wallet.dart) and in the save() method (node_create_or_edit_view_model.dart); created standard_checkbox.dart and applied StandardCheckbox widget in the node_create_or_edit_page.dart --- lib/entities/node.dart | 9 ++- lib/monero/monero_wallet.dart | 3 +- .../nodes/node_create_or_edit_page.dart | 19 ++++- lib/src/widgets/standard_checkbox.dart | 76 +++++++++++++++++++ .../node_create_or_edit_view_model.dart | 10 ++- 5 files changed, 110 insertions(+), 7 deletions(-) create mode 100644 lib/src/widgets/standard_checkbox.dart diff --git a/lib/entities/node.dart b/lib/entities/node.dart index f307111d2..0b8da1acb 100644 --- a/lib/entities/node.dart +++ b/lib/entities/node.dart @@ -14,7 +14,8 @@ class Node extends HiveObject with Keyable { {@required this.uri, @required WalletType type, this.login, - this.password}) { + this.password, + this.useSSL}) { this.type = type; } @@ -22,7 +23,8 @@ class Node extends HiveObject with Keyable { : uri = map['uri'] as String ?? '', login = map['login'] as String, password = map['password'] as String, - typeRaw = map['typeRaw'] as int; + typeRaw = map['typeRaw'] as int, + useSSL = map['useSSL'] as bool; static const boxName = 'Nodes'; @@ -38,6 +40,9 @@ class Node extends HiveObject with Keyable { @HiveField(3) int typeRaw; + @HiveField(4) + bool useSSL; + @override dynamic get keyIndex { _keyIndex ??= key; diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart index a064ed337..6c801b6e3 100644 --- a/lib/monero/monero_wallet.dart +++ b/lib/monero/monero_wallet.dart @@ -147,8 +147,7 @@ abstract class MoneroWalletBase extends WalletBase with Store { address: node.uri, login: node.login, password: node.password, - useSSL: true, - // FIXME: hardcoded value + useSSL: node.useSSL ?? false, isLightWallet: false); // FIXME: hardcoded value syncStatus = ConnectedSyncStatus(); } catch (e) { diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index 63009b089..b1ff60763 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -1,4 +1,6 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; +import 'package:cake_wallet/src/widgets/checkbox_widget.dart'; +import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/node_list/connection_state.dart'; import 'package:flutter/material.dart'; @@ -130,7 +132,22 @@ class NodeCreateOrEditPage extends BasePage { ) ) ], - ) + ), + Padding( + padding: EdgeInsets.only(top: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Observer( + builder: (_) => StandardCheckbox( + value: nodeCreateOrEditViewModel.useSSL, + onChanged: (value) => + nodeCreateOrEditViewModel.useSSL = value, + caption: 'Use SSL', + )) + ], + )) ] ], )), diff --git a/lib/src/widgets/standard_checkbox.dart b/lib/src/widgets/standard_checkbox.dart new file mode 100644 index 000000000..774acc9b7 --- /dev/null +++ b/lib/src/widgets/standard_checkbox.dart @@ -0,0 +1,76 @@ +import 'dart:ui'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class StandardCheckbox extends StatefulWidget { + StandardCheckbox({ + @required this.value, + this.caption = '', + @required this.onChanged}); + + final bool value; + final String caption; + final Function(bool) onChanged; + + @override + StandardCheckboxState createState() => + StandardCheckboxState(value, caption, onChanged); +} + +class StandardCheckboxState extends State { + StandardCheckboxState(this.value, this.caption, this.onChanged); + + bool value; + String caption; + Function(bool) onChanged; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + value = !value; + onChanged(value); + setState(() {}); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: 24.0, + width: 24.0, + margin: EdgeInsets.only( + right: 10.0, + ), + decoration: BoxDecoration( + border: Border.all( + color: Theme.of(context) + .primaryTextTheme + .caption + .color, + width: 1.0), + borderRadius: BorderRadius.all( + Radius.circular(8.0)), + color: Theme.of(context).backgroundColor), + child: value + ? Icon( + Icons.check, + color: Colors.blue, + size: 20.0, + ) + : Offstage(), + ), + Text( + caption, + style: TextStyle( + fontSize: 16.0, + color: Theme.of(context) + .primaryTextTheme + .title + .color), + ) + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index df07f6789..ce4404051 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -14,7 +14,8 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase abstract class NodeCreateOrEditViewModelBase with Store { NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet) : state = InitialExecutionState(), - connectionState = InitialConnectionState(); + connectionState = InitialConnectionState(), + useSSL = false; @observable ExecutionState state; @@ -34,6 +35,9 @@ abstract class NodeCreateOrEditViewModelBase with Store { @observable ConnectionToNodeState connectionState; + @observable + bool useSSL; + @computed bool get isReady => (address?.isNotEmpty ?? false) && (port?.isNotEmpty ?? false); @@ -59,6 +63,7 @@ abstract class NodeCreateOrEditViewModelBase with Store { port = ''; login = ''; password = ''; + useSSL = false; } @action @@ -66,7 +71,8 @@ abstract class NodeCreateOrEditViewModelBase with Store { try { state = IsExecutingState(); final node = - Node(uri: uri, type: _wallet.type, login: login, password: password); + Node(uri: uri, type: _wallet.type, login: login, password: password, + useSSL: useSSL); await _nodeSource.add(node); state = ExecutedSuccessfullyState(); } catch (e) { From ee666db21bdb83691ef3b5b8771660ed4416f341 Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Mon, 30 Nov 2020 21:37:20 +0200 Subject: [PATCH 6/9] CAKE-169 | fixed string resources --- lib/generated/i18n.dart | 23 +++++++++++++++++++ .../nodes/node_create_or_edit_page.dart | 3 +-- res/values/strings_de.arb | 4 +++- res/values/strings_en.arb | 4 +++- res/values/strings_es.arb | 4 +++- res/values/strings_hi.arb | 4 +++- res/values/strings_ja.arb | 4 +++- res/values/strings_ko.arb | 4 +++- res/values/strings_nl.arb | 4 +++- res/values/strings_pl.arb | 4 +++- res/values/strings_pt.arb | 4 +++- res/values/strings_ru.arb | 4 +++- res/values/strings_uk.arb | 4 +++- res/values/strings_zh.arb | 4 +++- 14 files changed, 60 insertions(+), 14 deletions(-) diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 9bc23d904..d7e5de584 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -300,6 +300,7 @@ class S implements WidgetsLocalizations { String get transactions => "Transactions"; String get transactions_by_date => "Transactions by date"; String get use => "Switch to "; + String get use_ssl => "Use SSL"; String get view_key_private => "View key (private)"; String get view_key_public => "View key (public)"; String get wallet_keys => "Wallet seed/keys"; @@ -497,6 +498,8 @@ class $de extends S { @override String get trade_details_pair => "Paar"; @override + String get use_ssl => "Verwenden Sie SSL"; + @override String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:"; @override String get node_connection_successful => "Die Verbindung war erfolgreich"; @@ -1175,6 +1178,8 @@ class $hi extends S { @override String get trade_details_pair => "जोड़ा"; @override + String get use_ssl => "उपयोग SSL"; + @override String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:"; @override String get node_connection_successful => "कनेक्शन सफल रहा"; @@ -1853,6 +1858,8 @@ class $ru extends S { @override String get trade_details_pair => "Пара"; @override + String get use_ssl => "Использовать SSL"; + @override String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:"; @override String get node_connection_successful => "Подключение прошло успешно"; @@ -2531,6 +2538,8 @@ class $ko extends S { @override String get trade_details_pair => "쌍"; @override + String get use_ssl => "SSL 사용"; + @override String get choose_wallet_currency => "지갑 통화를 선택하십시오:"; @override String get node_connection_successful => "성공적으로 연결되었습니다."; @@ -3209,6 +3218,8 @@ class $pt extends S { @override String get trade_details_pair => "Par"; @override + String get use_ssl => "Use SSL"; + @override String get choose_wallet_currency => "Escolha a moeda da carteira:"; @override String get node_connection_successful => "A conexão foi bem sucedida"; @@ -3887,6 +3898,8 @@ class $uk extends S { @override String get trade_details_pair => "Пара"; @override + String get use_ssl => "Використати SSL"; + @override String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:"; @override String get node_connection_successful => "З'єднання було успішним"; @@ -4565,6 +4578,8 @@ class $ja extends S { @override String get trade_details_pair => "ペア"; @override + String get use_ssl => "SSLを使用する"; + @override String get choose_wallet_currency => "ウォレット通貨を選択してください:"; @override String get node_connection_successful => "接続に成功しました"; @@ -5247,6 +5262,8 @@ class $pl extends S { @override String get trade_details_pair => "Para"; @override + String get use_ssl => "Użyj SSL"; + @override String get choose_wallet_currency => "Wybierz walutę portfela:"; @override String get node_connection_successful => "Połączenie powiodło się"; @@ -5925,6 +5942,8 @@ class $es extends S { @override String get trade_details_pair => "Par"; @override + String get use_ssl => "Utilice SSL"; + @override String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:"; @override String get node_connection_successful => "La conexión fue exitosa"; @@ -6603,6 +6622,8 @@ class $nl extends S { @override String get trade_details_pair => "Paar"; @override + String get use_ssl => "Gebruik SSL"; + @override String get choose_wallet_currency => "Kies een portemonnee-valuta:"; @override String get node_connection_successful => "Verbinding is gelukt"; @@ -7281,6 +7302,8 @@ class $zh extends S { @override String get trade_details_pair => "对"; @override + String get use_ssl => "使用SSL"; + @override String get choose_wallet_currency => "請選擇錢包貨幣:"; @override String get node_connection_successful => "連接成功"; diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index b1ff60763..70dae96d1 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -1,5 +1,4 @@ import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; -import 'package:cake_wallet/src/widgets/checkbox_widget.dart'; import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/node_list/connection_state.dart'; @@ -144,7 +143,7 @@ class NodeCreateOrEditPage extends BasePage { value: nodeCreateOrEditViewModel.useSSL, onChanged: (value) => nodeCreateOrEditViewModel.useSSL = value, - caption: 'Use SSL', + caption: S.of(context).use_ssl, )) ], )) diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index f86b42a5b..29df39a73 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Geh zurück", "seed_alert_yes" : "Ja, habe ich", - "exchange_sync_alert_content" : "Bitte warten Sie, bis Ihre Brieftasche synchronisiert ist" + "exchange_sync_alert_content" : "Bitte warten Sie, bis Ihre Brieftasche synchronisiert ist", + + "use_ssl" : "Verwenden Sie SSL" } \ No newline at end of file diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index 1bce25396..8dfe7bcfb 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Go back", "seed_alert_yes" : "Yes, I have", - "exchange_sync_alert_content" : "Please wait until your wallet is synchronized" + "exchange_sync_alert_content" : "Please wait until your wallet is synchronized", + + "use_ssl" : "Use SSL" } \ No newline at end of file diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index acf6e0eb3..55a0b0306 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Regresa", "seed_alert_yes" : "Sí tengo", - "exchange_sync_alert_content" : "Espere hasta que su billetera esté sincronizada" + "exchange_sync_alert_content" : "Espere hasta que su billetera esté sincronizada", + + "use_ssl" : "Utilice SSL" } \ No newline at end of file diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index 6296fe1e7..6584c18d1 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "वापस जाओ", "seed_alert_yes" : "हाँ मेरे पास है", - "exchange_sync_alert_content" : "कृपया प्रतीक्षा करें जब तक आपका बटुआ सिंक्रनाइज़ नहीं किया जाता है" + "exchange_sync_alert_content" : "कृपया प्रतीक्षा करें जब तक आपका बटुआ सिंक्रनाइज़ नहीं किया जाता है", + + "use_ssl" : "उपयोग SSL" } \ No newline at end of file diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index be5862016..460a8a426 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "戻る", "seed_alert_yes" : "はい、あります", - "exchange_sync_alert_content" : "ウォレットが同期されるまでお待ちください" + "exchange_sync_alert_content" : "ウォレットが同期されるまでお待ちください", + + "use_ssl" : "SSLを使用する" } \ No newline at end of file diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index d23973bf1..edc2a385c 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "돌아 가기", "seed_alert_yes" : "네, 있어요", - "exchange_sync_alert_content" : "지갑이 동기화 될 때까지 기다리십시오" + "exchange_sync_alert_content" : "지갑이 동기화 될 때까지 기다리십시오", + + "use_ssl" : "SSL 사용" } \ No newline at end of file diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index 81ee4ce92..133533c97 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Ga terug", "seed_alert_yes" : "Ja ik heb", - "exchange_sync_alert_content" : "Wacht tot uw portemonnee is gesynchroniseerd" + "exchange_sync_alert_content" : "Wacht tot uw portemonnee is gesynchroniseerd", + + "use_ssl" : "Gebruik SSL" } \ No newline at end of file diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index 1f10fc004..c33c24598 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Wróć", "seed_alert_yes" : "Tak", - "exchange_sync_alert_content" : "Poczekaj, aż portfel zostanie zsynchronizowany" + "exchange_sync_alert_content" : "Poczekaj, aż portfel zostanie zsynchronizowany", + + "use_ssl" : "Użyj SSL" } \ No newline at end of file diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index 55b40ed71..c640d40a0 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Volte", "seed_alert_yes" : "Sim, eu tenho", - "exchange_sync_alert_content" : "Por favor, espere até que sua carteira seja sincronizada" + "exchange_sync_alert_content" : "Por favor, espere até que sua carteira seja sincronizada", + + "use_ssl" : "Use SSL" } diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index f873cd482..d75693189 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Назад", "seed_alert_yes" : "Да", - "exchange_sync_alert_content" : "Подождите, пока ваш кошелек синхронизируется" + "exchange_sync_alert_content" : "Подождите, пока ваш кошелек синхронизируется", + + "use_ssl" : "Использовать SSL" } \ No newline at end of file diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index eeebf2468..90a515c73 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "Назад", "seed_alert_yes" : "Так", - "exchange_sync_alert_content" : "Зачекайте, поки ваш гаманець не синхронізується" + "exchange_sync_alert_content" : "Зачекайте, поки ваш гаманець не синхронізується", + + "use_ssl" : "Використати SSL" } \ No newline at end of file diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index a2c752371..0f6f88de0 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -412,5 +412,7 @@ "seed_alert_back" : "回去", "seed_alert_yes" : "是的,我有", - "exchange_sync_alert_content" : "請等待,直到您的錢包同步" + "exchange_sync_alert_content" : "請等待,直到您的錢包同步", + + "use_ssl" : "使用SSL" } \ No newline at end of file From 4f280e103ee0ad7667cd8712eb3c6853bc6eb618 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Wed, 2 Dec 2020 20:26:41 +0200 Subject: [PATCH 7/9] CAKE-169 | added NodeSSL class with getter useSSl; applied useSSL in the connectToNode() method in the monero_wallet.dart; added dynamic parameter to ExecutedSuccessfullyState class; applied ExecuteState class to connect() method in the node_create_or_edit_view_model.dart; deleted connection_state.dart; deleted _isEffectsInstalled parameter from node_create_or_edit_page.dart --- lib/core/execution_state.dart | 6 +- lib/entities/node_ssl.dart | 11 +++ lib/monero/monero_wallet.dart | 4 +- .../nodes/node_create_or_edit_page.dart | 82 ++++++++----------- .../node_list/connection_state.dart | 17 ---- .../node_create_or_edit_view_model.dart | 11 ++- 6 files changed, 59 insertions(+), 72 deletions(-) create mode 100644 lib/entities/node_ssl.dart delete mode 100644 lib/view_model/node_list/connection_state.dart diff --git a/lib/core/execution_state.dart b/lib/core/execution_state.dart index d4e3faeec..18dc81030 100644 --- a/lib/core/execution_state.dart +++ b/lib/core/execution_state.dart @@ -4,7 +4,11 @@ class InitialExecutionState extends ExecutionState {} class IsExecutingState extends ExecutionState {} -class ExecutedSuccessfullyState extends ExecutionState {} +class ExecutedSuccessfullyState extends ExecutionState { + ExecutedSuccessfullyState({this.payload}); + + final dynamic payload; +} class FailureState extends ExecutionState { FailureState(this.error); diff --git a/lib/entities/node_ssl.dart b/lib/entities/node_ssl.dart new file mode 100644 index 000000000..4775d7304 --- /dev/null +++ b/lib/entities/node_ssl.dart @@ -0,0 +1,11 @@ +import 'package:cake_wallet/entities/node.dart'; + +class NodeSSL { + NodeSSL(this._node) : + _useSSL = _node.useSSL ?? false; + + final Node _node; + final bool _useSSL; + + bool get useSSL => _useSSL; +} \ No newline at end of file diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart index 6c801b6e3..5dabd4805 100644 --- a/lib/monero/monero_wallet.dart +++ b/lib/monero/monero_wallet.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:cake_wallet/entities/node_ssl.dart'; import 'package:cake_wallet/monero/monero_amount_format.dart'; import 'package:cake_wallet/monero/monero_transaction_creation_exception.dart'; import 'package:flutter/foundation.dart'; @@ -143,11 +144,12 @@ abstract class MoneroWalletBase extends WalletBase with Store { Future connectToNode({@required Node node}) async { try { syncStatus = ConnectingSyncStatus(); + final nodeSSL = NodeSSL(node); await monero_wallet.setupNode( address: node.uri, login: node.login, password: node.password, - useSSL: node.useSSL ?? false, + useSSL: nodeSSL.useSSL, isLightWallet: false); // FIXME: hardcoded value syncStatus = ConnectedSyncStatus(); } catch (e) { diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index 70dae96d1..6cfa67285 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -1,7 +1,7 @@ +import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; -import 'package:cake_wallet/view_model/node_list/connection_state.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -14,7 +14,6 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart'; -import 'package:cake_wallet/view_model/node_list/connection_state.dart'; class NodeCreateOrEditPage extends BasePage { NodeCreateOrEditPage(this.nodeCreateOrEditViewModel) @@ -65,8 +64,6 @@ class NodeCreateOrEditPage extends BasePage { final TextEditingController _loginController; final TextEditingController _passwordController; - bool _effectsInstalled = false; - @override String get title => S.current.node_new; @@ -74,7 +71,38 @@ class NodeCreateOrEditPage extends BasePage { @override Widget body(BuildContext context) { - _setEffects(context); + + reaction((_) => nodeCreateOrEditViewModel.connectionState, + (ExecutionState state) { + if (state is ExecutedSuccessfullyState) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showPopUp( + context: context, + builder: (BuildContext context) => + AlertWithOneAction( + alertTitle: S.of(context).new_node_testing, + alertContent: state.payload as bool + ? S.of(context).node_connection_successful + : S.of(context).node_connection_failed, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop())); + }); + } + + if (state is FailureState) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showPopUp( + context: context, + builder: (BuildContext context) { + return AlertWithOneAction( + alertTitle: S.of(context).error, + alertContent: state.error, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop()); + }); + }); + } + }); return Container( padding: EdgeInsets.only(left: 24, right: 24), @@ -166,7 +194,7 @@ class NodeCreateOrEditPage extends BasePage { await nodeCreateOrEditViewModel.connect(); }, isLoading: nodeCreateOrEditViewModel - .connectionState is IsConnectingState, + .connectionState is IsExecutingState, text: S.of(context).node_test, isDisabled: !nodeCreateOrEditViewModel.isReady, color: Colors.orange, @@ -189,51 +217,11 @@ class NodeCreateOrEditPage extends BasePage { textColor: Colors.white, isDisabled: (!nodeCreateOrEditViewModel.isReady)|| (nodeCreateOrEditViewModel - .connectionState is IsConnectingState), + .connectionState is IsExecutingState), ), )), ], )), )); } - - void _setEffects(BuildContext context) { - if (_effectsInstalled) { - return; - } - - reaction((_) => nodeCreateOrEditViewModel.connectionState, - (ConnectionToNodeState state) { - if (state is ConnectedSuccessfullyState) { - WidgetsBinding.instance.addPostFrameCallback((_) { - showPopUp( - context: context, - builder: (BuildContext context) => - AlertWithOneAction( - alertTitle: S.of(context).new_node_testing, - alertContent: state.isAlive - ? S.of(context).node_connection_successful - : S.of(context).node_connection_failed, - buttonText: S.of(context).ok, - buttonAction: () => Navigator.of(context).pop())); - }); - } - - if (state is FailureConnectedState) { - WidgetsBinding.instance.addPostFrameCallback((_) { - showPopUp( - context: context, - builder: (BuildContext context) { - return AlertWithOneAction( - alertTitle: S.of(context).error, - alertContent: state.error, - buttonText: S.of(context).ok, - buttonAction: () => Navigator.of(context).pop()); - }); - }); - } - }); - - _effectsInstalled = true; - } } diff --git a/lib/view_model/node_list/connection_state.dart b/lib/view_model/node_list/connection_state.dart deleted file mode 100644 index eb13e474c..000000000 --- a/lib/view_model/node_list/connection_state.dart +++ /dev/null @@ -1,17 +0,0 @@ -abstract class ConnectionToNodeState {} - -class InitialConnectionState extends ConnectionToNodeState {} - -class IsConnectingState extends ConnectionToNodeState {} - -class ConnectedSuccessfullyState extends ConnectionToNodeState { - ConnectedSuccessfullyState(this.isAlive); - - final bool isAlive; -} - -class FailureConnectedState extends ConnectionToNodeState { - FailureConnectedState(this.error); - - final String error; -} \ No newline at end of file diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index ce4404051..0a5e07266 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -1,5 +1,4 @@ import 'package:cake_wallet/core/execution_state.dart'; -import 'package:cake_wallet/view_model/node_list/connection_state.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/core/wallet_base.dart'; @@ -14,7 +13,7 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase abstract class NodeCreateOrEditViewModelBase with Store { NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet) : state = InitialExecutionState(), - connectionState = InitialConnectionState(), + connectionState = InitialExecutionState(), useSSL = false; @observable @@ -33,7 +32,7 @@ abstract class NodeCreateOrEditViewModelBase with Store { String password; @observable - ConnectionToNodeState connectionState; + ExecutionState connectionState; @observable bool useSSL; @@ -83,13 +82,13 @@ abstract class NodeCreateOrEditViewModelBase with Store { @action Future connect() async { try { - connectionState = IsConnectingState(); + connectionState = IsExecutingState(); final node = Node(uri: uri, type: _wallet.type, login: login, password: password); final isAlive = await node.requestNode(); - connectionState = ConnectedSuccessfullyState(isAlive); + connectionState = ExecutedSuccessfullyState(payload: isAlive); } catch (e) { - connectionState = FailureConnectedState(e.toString()); + connectionState = FailureState(e.toString()); } } } From 2322a4a73ae60cc33018655d1132f368c55c9644 Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Wed, 2 Dec 2020 20:47:53 +0200 Subject: [PATCH 8/9] CAKE-169 | fixed string resources --- lib/generated/i18n.dart | 69 +++++++++++++++++++++++++++++++++++++++ res/values/strings_de.arb | 1 + res/values/strings_en.arb | 1 + res/values/strings_es.arb | 1 + res/values/strings_hi.arb | 1 + res/values/strings_ja.arb | 1 + res/values/strings_ko.arb | 1 + res/values/strings_nl.arb | 1 + res/values/strings_pl.arb | 1 + res/values/strings_pt.arb | 1 + res/values/strings_ru.arb | 1 + res/values/strings_uk.arb | 1 + res/values/strings_zh.arb | 1 + 13 files changed, 81 insertions(+) diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index d7e5de584..4ec6aa3c6 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -138,6 +138,9 @@ class S implements WidgetsLocalizations { String get please_make_selection => "Please make selection below to create or recover your wallet."; String get please_select => "Please select:"; String get please_try_to_connect_to_another_node => "Please try to connect to another node"; + String get pre_seed_button_text => "I understand. Show me my seed"; + String get pre_seed_description => "On the next page you will see a series of 25 words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; + String get pre_seed_title => "IMPORTANT"; String get private_key => "Private key"; String get public_key => "Public key"; String get receive => "Receive"; @@ -502,6 +505,8 @@ class $de extends S { @override String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:"; @override + String get pre_seed_description => "Auf der nächsten Seite sehen Sie eine Reihe von 25 Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; + @override String get node_connection_successful => "Die Verbindung war erfolgreich"; @override String get confirm => "Bestätigen"; @@ -510,6 +515,8 @@ class $de extends S { @override String get change_wallet_alert_title => "Ändern Sie die aktuelle Brieftasche"; @override + String get pre_seed_button_text => "Ich verstehe. Zeig mir meinen Samen"; + @override String get placeholder_transactions => "Ihre Transaktionen werden hier angezeigt"; @override String get trade_details_provider => "Anbieter"; @@ -960,6 +967,8 @@ class $de extends S { @override String get restore_title_from_seed => "Aus Seed wiederherstellen"; @override + String get pre_seed_title => "WICHTIG"; + @override String get restore_description_from_backup => "Sie können die gesamte Cake Wallet-App von wiederherstellen Ihre Sicherungsdatei"; @override String get error_text_node_port => "Der Knotenport kann nur Nummern zwischen 0 und 65535 enthalten"; @@ -1182,6 +1191,8 @@ class $hi extends S { @override String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:"; @override + String get pre_seed_description => "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; + @override String get node_connection_successful => "कनेक्शन सफल रहा"; @override String get confirm => "की पुष्टि करें"; @@ -1190,6 +1201,8 @@ class $hi extends S { @override String get change_wallet_alert_title => "वर्तमान बटुआ बदलें"; @override + String get pre_seed_button_text => "मै समझता हुँ। मुझे अपना बीज दिखाओ"; + @override String get placeholder_transactions => "आपके लेनदेन यहां प्रदर्शित होंगे"; @override String get trade_details_provider => "प्रदाता"; @@ -1640,6 +1653,8 @@ class $hi extends S { @override String get restore_title_from_seed => "बीज से पुनर्स्थापित करें"; @override + String get pre_seed_title => "महत्वपूर्ण"; + @override String get restore_description_from_backup => "आप से पूरे केक वॉलेट एप्लिकेशन को पुनर्स्थापित कर सकते हैं आपकी बैक-अप फ़ाइल"; @override String get error_text_node_port => "नोड पोर्ट में केवल 0 और 65535 के बीच संख्याएँ हो सकती हैं"; @@ -1862,6 +1877,8 @@ class $ru extends S { @override String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:"; @override + String get pre_seed_description => "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; + @override String get node_connection_successful => "Подключение прошло успешно"; @override String get confirm => "Подтвердить"; @@ -1870,6 +1887,8 @@ class $ru extends S { @override String get change_wallet_alert_title => "Изменить текущий кошелек"; @override + String get pre_seed_button_text => "Понятно. Покажите мнемоническую фразу"; + @override String get placeholder_transactions => "Ваши транзакции будут отображаться здесь"; @override String get trade_details_provider => "Провайдер"; @@ -2320,6 +2339,8 @@ class $ru extends S { @override String get restore_title_from_seed => "Восстановить из мнемонической фразы"; @override + String get pre_seed_title => "ВАЖНО"; + @override String get restore_description_from_backup => "Вы можете восстановить Cake Wallet из вашего back-up файла"; @override String get error_text_node_port => "Порт ноды может содержать только цифры от 0 до 65535"; @@ -2542,6 +2563,8 @@ class $ko extends S { @override String get choose_wallet_currency => "지갑 통화를 선택하십시오:"; @override + String get pre_seed_description => "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; + @override String get node_connection_successful => "성공적으로 연결되었습니다."; @override String get confirm => "확인"; @@ -2550,6 +2573,8 @@ class $ko extends S { @override String get change_wallet_alert_title => "현재 지갑 변경"; @override + String get pre_seed_button_text => "이해 했어요. 내 씨앗을 보여줘"; + @override String get placeholder_transactions => "거래가 여기에 표시됩니다"; @override String get trade_details_provider => "공급자"; @@ -3000,6 +3025,8 @@ class $ko extends S { @override String get restore_title_from_seed => "종자에서 복원"; @override + String get pre_seed_title => "중대한"; + @override String get restore_description_from_backup => "백업 파일에서 전체 Cake Wallet 앱을 복원 할 수 있습니다."; @override String get error_text_node_port => "노드 포트는 0에서 65535 사이의 숫자 만 포함 할 수 있습니다"; @@ -3222,6 +3249,8 @@ class $pt extends S { @override String get choose_wallet_currency => "Escolha a moeda da carteira:"; @override + String get pre_seed_description => "Na próxima página, você verá uma série de 25 palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; + @override String get node_connection_successful => "A conexão foi bem sucedida"; @override String get confirm => "Confirmar"; @@ -3230,6 +3259,8 @@ class $pt extends S { @override String get change_wallet_alert_title => "Alterar carteira atual"; @override + String get pre_seed_button_text => "Compreendo. Me mostre minha semente"; + @override String get placeholder_transactions => "Suas transações serão exibidas aqui"; @override String get trade_details_provider => "Provedor"; @@ -3680,6 +3711,8 @@ class $pt extends S { @override String get restore_title_from_seed => "Restaurar a partir de semente"; @override + String get pre_seed_title => "IMPORTANTE"; + @override String get restore_description_from_backup => "Você pode restaurar todo o aplicativo Cake Wallet de seu arquivo de backup"; @override String get error_text_node_port => "A porta do nó deve conter apenas números entre 0 e 65535"; @@ -3902,6 +3935,8 @@ class $uk extends S { @override String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:"; @override + String get pre_seed_description => "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; + @override String get node_connection_successful => "З'єднання було успішним"; @override String get confirm => "Підтвердити"; @@ -3910,6 +3945,8 @@ class $uk extends S { @override String get change_wallet_alert_title => "Змінити поточний гаманець"; @override + String get pre_seed_button_text => "Зрозуміло. Покажіть мнемонічну фразу"; + @override String get placeholder_transactions => "Тут відображатимуться ваші транзакції"; @override String get trade_details_provider => "Провайдер"; @@ -4360,6 +4397,8 @@ class $uk extends S { @override String get restore_title_from_seed => "Відновити з мнемонічної фрази"; @override + String get pre_seed_title => "ВАЖЛИВО"; + @override String get restore_description_from_backup => "Ви можете відновити Cake Wallet з вашого резервного файлу"; @override String get error_text_node_port => "Порт вузла може містити тільки цифри від 0 до 65535"; @@ -4582,6 +4621,8 @@ class $ja extends S { @override String get choose_wallet_currency => "ウォレット通貨を選択してください:"; @override + String get pre_seed_description => "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; + @override String get node_connection_successful => "接続に成功しました"; @override String get confirm => "確認する"; @@ -4590,6 +4631,8 @@ class $ja extends S { @override String get change_wallet_alert_title => "現在のウォレットを変更する"; @override + String get pre_seed_button_text => "わかります。 種を見せて"; + @override String get placeholder_transactions => "あなたの取引はここに表示されます"; @override String get trade_details_provider => "プロバイダー"; @@ -5040,6 +5083,8 @@ class $ja extends S { @override String get restore_title_from_seed => "シードから復元"; @override + String get pre_seed_title => "重要"; + @override String get restore_description_from_backup => "Cake Walletアプリ全体を復元できますバックアップファイル"; @override String get error_text_node_port => "ノードポートには、0〜65535の数字のみを含めることができます"; @@ -5266,6 +5311,8 @@ class $pl extends S { @override String get choose_wallet_currency => "Wybierz walutę portfela:"; @override + String get pre_seed_description => "Na następnej stronie zobaczysz serię 25 słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; + @override String get node_connection_successful => "Połączenie powiodło się"; @override String get confirm => "Potwierdzać"; @@ -5274,6 +5321,8 @@ class $pl extends S { @override String get change_wallet_alert_title => "Zmień obecny portfel"; @override + String get pre_seed_button_text => "Rozumiem. Pokaż mi moje nasienie"; + @override String get placeholder_transactions => "Twoje transakcje zostaną wyświetlone tutaj"; @override String get trade_details_provider => "Dostawca"; @@ -5724,6 +5773,8 @@ class $pl extends S { @override String get restore_title_from_seed => "Przywróć z nasion"; @override + String get pre_seed_title => "WAŻNY"; + @override String get restore_description_from_backup => "Możesz przywrócić całą aplikację Cake Wallet z plik kopii zapasowej"; @override String get error_text_node_port => "Port węzła może zawierać tylko liczby od 0 do 65535"; @@ -5946,6 +5997,8 @@ class $es extends S { @override String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:"; @override + String get pre_seed_description => "En la página siguiente verá una serie de 25 palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; + @override String get node_connection_successful => "La conexión fue exitosa"; @override String get confirm => "Confirmar"; @@ -5954,6 +6007,8 @@ class $es extends S { @override String get change_wallet_alert_title => "Cambiar billetera actual"; @override + String get pre_seed_button_text => "Entiendo. Muéstrame mi semilla"; + @override String get placeholder_transactions => "Sus transacciones se mostrarán aquí"; @override String get trade_details_provider => "Proveedor"; @@ -6404,6 +6459,8 @@ class $es extends S { @override String get restore_title_from_seed => "De la semilla"; @override + String get pre_seed_title => "IMPORTANTE"; + @override String get restore_description_from_backup => "Puede restaurar toda la aplicación Cake Wallet desde ysu archivo de respaldo"; @override String get error_text_node_port => "El puerto de nodo solo puede contener números entre 0 y 65535"; @@ -6626,6 +6683,8 @@ class $nl extends S { @override String get choose_wallet_currency => "Kies een portemonnee-valuta:"; @override + String get pre_seed_description => "Op de volgende pagina ziet u een reeks van 25 woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; + @override String get node_connection_successful => "Verbinding is gelukt"; @override String get confirm => "Bevestigen"; @@ -6634,6 +6693,8 @@ class $nl extends S { @override String get change_wallet_alert_title => "Wijzig huidige portemonnee"; @override + String get pre_seed_button_text => "Ik begrijp het. Laat me mijn zaad zien"; + @override String get placeholder_transactions => "Uw transacties worden hier weergegeven"; @override String get trade_details_provider => "Leverancier"; @@ -7084,6 +7145,8 @@ class $nl extends S { @override String get restore_title_from_seed => "Herstel van zaad"; @override + String get pre_seed_title => "BELANGRIJK"; + @override String get restore_description_from_backup => "Je kunt de hele Cake Wallet-app herstellen van uw back-upbestand"; @override String get error_text_node_port => "Knooppuntpoort kan alleen nummers tussen 0 en 65535 bevatten"; @@ -7306,6 +7369,8 @@ class $zh extends S { @override String get choose_wallet_currency => "請選擇錢包貨幣:"; @override + String get pre_seed_description => "在下一頁上,您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; + @override String get node_connection_successful => "連接成功"; @override String get confirm => "确认"; @@ -7314,6 +7379,8 @@ class $zh extends S { @override String get change_wallet_alert_title => "更換當前錢包"; @override + String get pre_seed_button_text => "我明白。 給我看我的種子"; + @override String get placeholder_transactions => "您的交易將顯示在這裡"; @override String get trade_details_provider => "提供者"; @@ -7764,6 +7831,8 @@ class $zh extends S { @override String get restore_title_from_seed => "从种子还原"; @override + String get pre_seed_title => "重要"; + @override String get restore_description_from_backup => "您可以从还原整个Cake Wallet应用您的备份文件"; @override String get error_text_node_port => "节点端口只能包含0到65535之间的数字"; diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index 48a2bb674..67d271fd6 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "Auf der nächsten Seite sehen Sie eine Reihe von 25 Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren.", "pre_seed_button_text" : "Ich verstehe. Zeig mir meinen Samen", + "use_ssl" : "Verwenden Sie SSL" } \ No newline at end of file diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index d0b620bf5..08a42569d 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "On the next page you will see a series of 25 words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app.", "pre_seed_button_text" : "I understand. Show me my seed", + "use_ssl" : "Use SSL" } \ No newline at end of file diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index db685e024..425828499 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "En la página siguiente verá una serie de 25 palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet.", "pre_seed_button_text" : "Entiendo. Muéstrame mi semilla", + "use_ssl" : "Utilice SSL" } \ No newline at end of file diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index ea3cf1b26..2a6182d6b 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।", "pre_seed_button_text" : "मै समझता हुँ। मुझे अपना बीज दिखाओ", + "use_ssl" : "उपयोग SSL" } \ No newline at end of file diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index 26518bf33..e3d3d7675 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。", "pre_seed_button_text" : "わかります。 種を見せて", + "use_ssl" : "SSLを使用する" } \ No newline at end of file diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index 3f11dd705..29b2972ca 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다.", "pre_seed_button_text" : "이해 했어요. 내 씨앗을 보여줘", + "use_ssl" : "SSL 사용" } \ No newline at end of file diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index e6edeaf44..c4bcf0e25 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "Op de volgende pagina ziet u een reeks van 25 woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app.", "pre_seed_button_text" : "Ik begrijp het. Laat me mijn zaad zien", + "use_ssl" : "Gebruik SSL" } \ No newline at end of file diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index f2bac8205..2401fc6b3 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "Na następnej stronie zobaczysz serię 25 słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet.", "pre_seed_button_text" : "Rozumiem. Pokaż mi moje nasienie", + "use_ssl" : "Użyj SSL" } \ No newline at end of file diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index 97d08aedf..8f0841b7f 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "Na próxima página, você verá uma série de 25 palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet.", "pre_seed_button_text" : "Compreendo. Me mostre minha semente", + "use_ssl" : "Use SSL" } diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index 68001adc6..311aa75f2 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet.", "pre_seed_button_text" : "Понятно. Покажите мнемоническую фразу", + "use_ssl" : "Использовать SSL" } \ No newline at end of file diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index 0aef52a46..36a921a44 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet.", "pre_seed_button_text" : "Зрозуміло. Покажіть мнемонічну фразу", + "use_ssl" : "Використати SSL" } \ No newline at end of file diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index c20e97a4a..b83408490 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -418,5 +418,6 @@ "pre_seed_description" : "在下一頁上,您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。", "pre_seed_button_text" : "我明白。 給我看我的種子", + "use_ssl" : "使用SSL" } \ No newline at end of file From 1dd6e78ae91e62fb3ba37b124a7bb19faa8ced0e Mon Sep 17 00:00:00 2001 From: M Date: Thu, 3 Dec 2020 12:07:26 +0200 Subject: [PATCH 9/9] Removed NodeSSL, added isSSL proprty to Node class. --- lib/entities/node.dart | 2 ++ lib/entities/node_ssl.dart | 11 ----------- lib/monero/monero_wallet.dart | 4 +--- lib/store/dashboard/trade_filter_store.dart | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 lib/entities/node_ssl.dart diff --git a/lib/entities/node.dart b/lib/entities/node.dart index 0b8da1acb..48f3c9d8e 100644 --- a/lib/entities/node.dart +++ b/lib/entities/node.dart @@ -43,6 +43,8 @@ class Node extends HiveObject with Keyable { @HiveField(4) bool useSSL; + bool get isSSL => useSSL ?? false; + @override dynamic get keyIndex { _keyIndex ??= key; diff --git a/lib/entities/node_ssl.dart b/lib/entities/node_ssl.dart deleted file mode 100644 index 4775d7304..000000000 --- a/lib/entities/node_ssl.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:cake_wallet/entities/node.dart'; - -class NodeSSL { - NodeSSL(this._node) : - _useSSL = _node.useSSL ?? false; - - final Node _node; - final bool _useSSL; - - bool get useSSL => _useSSL; -} \ No newline at end of file diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart index 5dabd4805..bf912a4fd 100644 --- a/lib/monero/monero_wallet.dart +++ b/lib/monero/monero_wallet.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:cake_wallet/entities/node_ssl.dart'; import 'package:cake_wallet/monero/monero_amount_format.dart'; import 'package:cake_wallet/monero/monero_transaction_creation_exception.dart'; import 'package:flutter/foundation.dart'; @@ -144,12 +143,11 @@ abstract class MoneroWalletBase extends WalletBase with Store { Future connectToNode({@required Node node}) async { try { syncStatus = ConnectingSyncStatus(); - final nodeSSL = NodeSSL(node); await monero_wallet.setupNode( address: node.uri, login: node.login, password: node.password, - useSSL: nodeSSL.useSSL, + useSSL: node.isSSL, isLightWallet: false); // FIXME: hardcoded value syncStatus = ConnectedSyncStatus(); } catch (e) { diff --git a/lib/store/dashboard/trade_filter_store.dart b/lib/store/dashboard/trade_filter_store.dart index 46e1193bb..02ad383e7 100644 --- a/lib/store/dashboard/trade_filter_store.dart +++ b/lib/store/dashboard/trade_filter_store.dart @@ -3,7 +3,7 @@ import 'package:mobx/mobx.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/view_model/dashboard/trade_list_item.dart'; -part 'trade_filter_store.g.dart'; +part'trade_filter_store.g.dart'; class TradeFilterStore = TradeFilterStoreBase with _$TradeFilterStore;