diff --git a/cw_core/lib/node.dart b/cw_core/lib/node.dart index 7de2e84b6..dd5969b99 100644 --- a/cw_core/lib/node.dart +++ b/cw_core/lib/node.dart @@ -20,7 +20,8 @@ class Node extends HiveObject with Keyable { @required WalletType type, this.login, this.password, - this.useSSL}) { + this.useSSL, + this.trusted}) { uriRaw = uri; this.type = type; } @@ -30,7 +31,8 @@ class Node extends HiveObject with Keyable { login = map['login'] as String, password = map['password'] as String, typeRaw = map['typeRaw'] as int, - useSSL = map['useSSL'] as bool; + useSSL = map['useSSL'] as bool, + trusted = map['trusted'] as bool ?? false; static const typeId = 1; static const boxName = 'Nodes'; @@ -50,8 +52,13 @@ class Node extends HiveObject with Keyable { @HiveField(4) bool useSSL; + @HiveField(5) + bool trusted; + bool get isSSL => useSSL ?? false; + bool get isTrusted => trusted ?? false; + Uri get uri { switch (type) { case WalletType.monero: 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 6cfa67285..857bde023 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -174,7 +174,22 @@ class NodeCreateOrEditPage extends BasePage { caption: S.of(context).use_ssl, )) ], - )) + )), + Padding( + padding: EdgeInsets.only(top: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Observer( + builder: (_) => StandardCheckbox( + value: nodeCreateOrEditViewModel.trusted, + onChanged: (value) => + nodeCreateOrEditViewModel.trusted = value, + caption: S.of(context).trusted, + )) + ], + )), ] ], )), 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 ef7e03189..c14bdda5e 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 @@ abstract class NodeCreateOrEditViewModelBase with Store { NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet) : state = InitialExecutionState(), connectionState = InitialExecutionState(), - useSSL = false; + useSSL = false, + trusted = false; @observable ExecutionState state; @@ -37,6 +38,9 @@ abstract class NodeCreateOrEditViewModelBase with Store { @observable bool useSSL; + @observable + bool trusted; + @computed bool get isReady => (address?.isNotEmpty ?? false) && (port?.isNotEmpty ?? false); @@ -64,6 +68,7 @@ abstract class NodeCreateOrEditViewModelBase with Store { login = ''; password = ''; useSSL = false; + trusted = false; } @action @@ -72,7 +77,7 @@ abstract class NodeCreateOrEditViewModelBase with Store { state = IsExecutingState(); final node = Node(uri: uri, type: _wallet.type, login: login, password: password, - useSSL: useSSL); + useSSL: useSSL, trusted: trusted); await _nodeSource.add(node); state = ExecutedSuccessfullyState(); } catch (e) { diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index 3457f8ab2..fa04a6a8e 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider}-Fehler", "use_ssl" : "SSL verwenden", + "trusted" : "Vertrauenswürdige", "color_theme" : "Farbthema", "light_theme" : "Hell", diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index ef8e6e495..4a46d36c8 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} error", "use_ssl" : "Use SSL", + "trusted" : "Trusted", "color_theme" : "Color theme", "light_theme" : "Light", diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index 7c996134e..756ac3e11 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} error", "use_ssl" : "Utilice SSL", + "trusted" : "de confianza", "color_theme" : "Tema de color", "light_theme" : "Ligera", diff --git a/res/values/strings_fr.arb b/res/values/strings_fr.arb index b347086ae..04462943e 100644 --- a/res/values/strings_fr.arb +++ b/res/values/strings_fr.arb @@ -434,6 +434,7 @@ "provider_error" : "Erreur de ${provider}", "use_ssl" : "Utiliser SSL", + "trusted" : "de confiance", "color_theme" : "Thème", "light_theme" : "Clair", diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index 83c0808c4..f8bad76e2 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} त्रुटि", "use_ssl" : "उपयोग SSL", + "trusted" : "भरोसा", "color_theme" : "रंग विषय", "light_theme" : "रोशनी", diff --git a/res/values/strings_hr.arb b/res/values/strings_hr.arb index 97d4d335c..0e27e3a2c 100644 --- a/res/values/strings_hr.arb +++ b/res/values/strings_hr.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} greška", "use_ssl" : "Koristi SSL", + "trusted" : "vjerovao", "color_theme" : "Shema boja", "light_theme" : "Svijetla", diff --git a/res/values/strings_it.arb b/res/values/strings_it.arb index cd779471f..ea9bbd5be 100644 --- a/res/values/strings_it.arb +++ b/res/values/strings_it.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} errore", "use_ssl" : "Usa SSL", + "trusted" : "di fiducia", "color_theme" : "Colore tema", "light_theme" : "Bianco", diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index 2b3920862..5ae3a5a1a 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} エラー", "use_ssl" : "SSLを使用する", + "trusted" : "信頼できる", "color_theme" : "カラーテーマ", "light_theme" : "光", diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index 85ece0603..f934784ba 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} 오류", "use_ssl" : "SSL 사용", + "trusted" : "신뢰할 수 있는", "color_theme" : "색상 테마", "light_theme" : "빛", diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index 15da6fd7b..428da3d76 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} fout", "use_ssl" : "Gebruik SSL", + "trusted" : "vertrouwd", "color_theme" : "Kleur thema", "light_theme" : "Licht", diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index 26d8a38d4..fda0ea721 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} pomyłka", "use_ssl" : "Użyj SSL", + "trusted" : "zaufany", "color_theme" : "Motyw kolorystyczny", "light_theme" : "Lekki", diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index bfb4a2d0a..6a55cf534 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} erro", "use_ssl" : "Use SSL", + "trusted" : "confiável", "color_theme" : "Tema de cor", "light_theme" : "Luz", @@ -544,7 +545,6 @@ "create_account": "Criar conta", "privacy_policy": "Política de privacidade", "welcome_to_cakepay": "Bem-vindo ao Cake Pay!", - "create_account": "Registar-se", "forgot_password": "Esqueci a senha", "reset_password": "Redefinir senha", "gift_cards": "Cartões de presente", diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index 94a5b3c0b..ebc4a615c 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -436,6 +436,7 @@ "provider_error" : "${provider} ошибка", "use_ssl" : "Использовать SSL", + "trusted" : "доверенный", "color_theme" : "Цветовая тема", "light_theme" : "Светлая", diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index b139750be..efbd5a3b8 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -435,6 +435,7 @@ "provider_error" : "${provider} помилка", "use_ssl" : "Використати SSL", + "trusted" : "довіряють", "color_theme" : "Кольорова тема", "light_theme" : "Світла", diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index 487c6be52..83990cf2e 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -435,6 +435,7 @@ "provider_error" : "${provider} 错误", "use_ssl" : "使用SSL", + "trusted" : "值得信赖", "color_theme" : "主题", "light_theme" : "艳丽",