From f29e926d280d1b4ba57c970eb30c8e561c2b6790 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Sun, 20 Nov 2022 18:22:20 -0800 Subject: [PATCH 1/3] fix lunux scripts LD_LIBRARY_PATH to include Tor (for ssl etc) and fix color of add/edit profile button --- lib/views/addeditprofileview.dart | 2 +- linux/cwtch | 2 +- linux/cwtch.home.sh | 2 +- linux/cwtch.sys.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index e5f26ed8..8faac9ee 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -339,7 +339,7 @@ class _AddEditProfileViewState extends State { showAlertDialog(context); }, icon: Icon(Icons.delete_forever), - label: Text(AppLocalizations.of(context)!.deleteBtn), + label: Text(AppLocalizations.of(context)!.deleteBtn, style: TextStyle(color: Provider.of(context).theme.defaultButtonActiveColor)), ))) ])))))); }); diff --git a/linux/cwtch b/linux/cwtch index 28f613a4..358bd37b 100755 --- a/linux/cwtch +++ b/linux/cwtch @@ -1,3 +1,3 @@ #!/bin/sh -exec env LD_LIBRARY_PATH=./lib/ ./lib/cwtch +exec env LD_LIBRARY_PATH=./lib/:./lib/Tor ./lib/cwtch diff --git a/linux/cwtch.home.sh b/linux/cwtch.home.sh index 44f55253..3df2ef61 100755 --- a/linux/cwtch.home.sh +++ b/linux/cwtch.home.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec env LD_LIBRARY_PATH=~/.local/lib/cwtch/ ~/.local/lib/cwtch/cwtch +exec env LD_LIBRARY_PATH=~/.local/lib/cwtch/:~/.local/lib/cwtch/Tor ~/.local/lib/cwtch/cwtch diff --git a/linux/cwtch.sys.sh b/linux/cwtch.sys.sh index 8a927666..c3b43577 100755 --- a/linux/cwtch.sys.sh +++ b/linux/cwtch.sys.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec env LD_LIBRARY_PATH=/usr/lib/cwtch /usr/lib/cwtch/cwtch +exec env LD_LIBRARY_PATH=/usr/lib/cwtch:/usr/lib/cwtch/Tor /usr/lib/cwtch/cwtch From d4546199e4f9ddc121fcfdff7988e27a16e4322a Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 5 Dec 2022 11:58:44 -0800 Subject: [PATCH 2/3] support (de)activatePeerEngine; turning peers on/off; autostart peers; new UI update for offline contacts/profiles --- LIBCWTCH-GO-MACOS.version | 2 +- LIBCWTCH-GO.version | 2 +- .../kotlin/im/cwtch/flwtch/MainActivity.kt | 8 ++++ lib/cwtch/cwtch.dart | 6 +++ lib/cwtch/cwtchNotifier.dart | 2 +- lib/cwtch/ffi.dart | 18 +++++++++ lib/cwtch/gomobile.dart | 10 +++++ lib/models/profile.dart | 23 +++++++++++ lib/models/profilelist.dart | 6 ++- lib/views/addeditprofileview.dart | 39 +++++++++++++++++++ lib/widgets/contactrow.dart | 2 +- lib/widgets/profileimage.dart | 27 ++++++++++++- lib/widgets/profilerow.dart | 1 + 13 files changed, 139 insertions(+), 7 deletions(-) diff --git a/LIBCWTCH-GO-MACOS.version b/LIBCWTCH-GO-MACOS.version index 5c6fe988..71778c8a 100644 --- a/LIBCWTCH-GO-MACOS.version +++ b/LIBCWTCH-GO-MACOS.version @@ -1 +1 @@ -2022-11-30-14-27-v1.10.0 \ No newline at end of file +2022-12-05-13-24-v1.10.0-6-g0d05a07 \ No newline at end of file diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index e13a9db5..b719558a 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -2022-11-30-19-28-v1.10.0 \ No newline at end of file +2022-12-05-18-24-v1.10.0-6-g0d05a07 \ No newline at end of file diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt index a35a3b22..06d41f35 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/MainActivity.kt @@ -364,6 +364,14 @@ class MainActivity: FlutterActivity() { val pass: String = call.argument("pass") ?: "" Cwtch.loadProfiles(pass) } + "ActivatePeerEngine" -> { + val profile: String = call.argument("profile") ?: "" + Cwtch.activatePeerEngine(profile) + } + "DeactivatePeerEngine" -> { + val profile: String = call.argument("profile") ?: "" + Cwtch.deactivatePeerEngine(profile) + } "ChangePassword" -> { val profile: String = call.argument("ProfileOnion") ?: "" val pass: String = call.argument("OldPass") ?: "" diff --git a/lib/cwtch/cwtch.dart b/lib/cwtch/cwtch.dart index 49c25403..2e920780 100644 --- a/lib/cwtch/cwtch.dart +++ b/lib/cwtch/cwtch.dart @@ -12,6 +12,12 @@ abstract class Cwtch { // ignore: non_constant_identifier_names void CreateProfile(String nick, String pass); + + // ignore: non_constant_identifier_names + void ActivatePeerEngine(String profile); + // ignore: non_constant_identifier_names + void DeactivatePeerEngine(String profile); + // ignore: non_constant_identifier_names void LoadProfiles(String pass); // ignore: non_constant_identifier_names diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index b2d4dea6..874b1226 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -72,7 +72,7 @@ class CwtchNotifier { } EnvironmentConfig.debugLog("NewPeer $data"); // if tag != v1-defaultPassword then it is either encrypted OR it is an unencrypted account created during pre-beta... - profileCN.add(data["Identity"], data["name"], data["picture"], data["defaultPicture"], data["ContactsJson"], data["ServerList"], data["Online"] == "true", data["tag"] != "v1-defaultPassword"); + profileCN.add(data["Identity"], data["name"], data["picture"], data["defaultPicture"], data["ContactsJson"], data["ServerList"], data["Online"] == "true", data["autostart"] == "true", data["tag"] != "v1-defaultPassword"); break; case "ContactCreated": EnvironmentConfig.debugLog("ContactCreated $data"); diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index a6fc8c33..ae6867fb 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -301,6 +301,24 @@ class CwtchFfi implements Cwtch { malloc.free(ut8pass); } + // ignore: non_constant_identifier_names + void ActivatePeerEngine(String profile) { + var activatePeerEngineC = library.lookup>("c_ActivatePeerEngine"); + final ActivatePeerEngine = activatePeerEngineC.asFunction(); + final ut8profile = profile.toNativeUtf8(); + ActivatePeerEngine(ut8profile, ut8profile.length); + malloc.free(ut8profile); + } + + // ignore: non_constant_identifier_names + void DeactivatePeerEngine(String profile) { + var deactivatePeerEngineC = library.lookup>("c_ActivatePeerEngine"); + final DeactivatePeerEngine = deactivatePeerEngineC.asFunction(); + final ut8profile = profile.toNativeUtf8(); + DeactivatePeerEngine(ut8profile, ut8profile.length); + malloc.free(ut8profile); + } + // ignore: non_constant_identifier_names void LoadProfiles(String pass) { var loadProfileC = library.lookup>("c_LoadProfiles"); diff --git a/lib/cwtch/gomobile.dart b/lib/cwtch/gomobile.dart index e1b650ea..eda73982 100644 --- a/lib/cwtch/gomobile.dart +++ b/lib/cwtch/gomobile.dart @@ -75,6 +75,16 @@ class CwtchGomobile implements Cwtch { cwtchPlatform.invokeMethod("CreateProfile", {"nick": nick, "pass": pass}); } + // ignore: non_constant_identifier_names + void ActivatePeerEngine(String profile) { + cwtchPlatform.invokeMethod("ActivatePeerEngine", {"profile": profile}); + } + + // ignore: non_constant_identifier_names + void DeactivatePeerEngine(String profile) { + cwtchPlatform.invokeMethod("DeactivatePeerEngine", {"profile": profile}); + } + // ignore: non_constant_identifier_names void LoadProfiles(String pass) { cwtchPlatform.invokeMethod("LoadProfiles", {"pass": pass}); diff --git a/lib/models/profile.dart b/lib/models/profile.dart index 177b8e5b..7d24b308 100644 --- a/lib/models/profile.dart +++ b/lib/models/profile.dart @@ -26,6 +26,9 @@ class ProfileInfoState extends ChangeNotifier { // in the constructor if the profile is encrypted with the defacto password. bool _encrypted = true; + bool _autostart = true; + bool _enabled = false; + ProfileInfoState({ required this.onion, nickname = "", @@ -35,6 +38,7 @@ class ProfileInfoState extends ChangeNotifier { contactsJson = "", serversJson = "", online = false, + autostart = true, encrypted = true, String, }) { @@ -43,6 +47,11 @@ class ProfileInfoState extends ChangeNotifier { this._defaultImagePath = defaultImagePath; this._unreadMessages = unreadMessages; this._online = online; + this._enabled = _enabled; + this._autostart = autostart; + if (autostart) { + this._enabled = true; + } this._encrypted = encrypted; _contacts.connectServers(this._servers); @@ -130,6 +139,20 @@ class ProfileInfoState extends ChangeNotifier { notifyListeners(); } + bool get enabled => this._enabled; + + set enabled(bool newVal) { + this._enabled = newVal; + notifyListeners(); + } + + bool get autostart => this._autostart; + + set autostart(bool newVal) { + this._autostart = newVal; + notifyListeners(); + } + String get defaultImagePath => this._defaultImagePath; set defaultImagePath(String newVal) { diff --git a/lib/models/profilelist.dart b/lib/models/profilelist.dart index bb3cd406..14ed466b 100644 --- a/lib/models/profilelist.dart +++ b/lib/models/profilelist.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/widgets.dart'; @@ -7,11 +9,11 @@ class ProfileListState extends ChangeNotifier { List _profiles = []; int get num => _profiles.length; - void add(String onion, String name, String picture, String defaultPicture, String contactsJson, String serverJson, bool online, bool encrypted) { + void add(String onion, String name, String picture, String defaultPicture, String contactsJson, String serverJson, bool online, bool autostart, bool encrypted) { var idx = _profiles.indexWhere((element) => element.onion == onion); if (idx == -1) { _profiles.add(ProfileInfoState( - onion: onion, nickname: name, imagePath: picture, defaultImagePath: defaultPicture, contactsJson: contactsJson, serversJson: serverJson, online: online, encrypted: encrypted)); + onion: onion, nickname: name, imagePath: picture, defaultImagePath: defaultPicture, contactsJson: contactsJson, serversJson: serverJson, online: online, autostart: autostart, encrypted: encrypted)); } else { _profiles[idx].updateFrom(onion, name, picture, contactsJson, serverJson, online); } diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index 8faac9ee..f6ab0f01 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -169,6 +169,45 @@ class _AddEditProfileViewState extends State { ) ])), // We only allow setting password types on profile creation + + // Enabled + Visibility( + visible: Provider.of(context).onion.isNotEmpty, + child: SwitchListTile( + title: Text(AppLocalizations.of(context)!.serverEnabled, style: TextStyle(color: Provider.of(context).current().mainTextColor)), + subtitle: Text(AppLocalizations.of(context)!.serverEnabledDescription), + value: Provider.of(context).enabled, + onChanged: (bool value) { + Provider.of(context).enabled = value; + if (value) { + Provider.of(context, listen: false).cwtch.ActivatePeerEngine(Provider.of(context).onion); + } else { + Provider.of(context, listen: false).cwtch.DeactivatePeerEngine(Provider.of(context).onion); + } + }, + activeTrackColor: Provider.of(context).theme.defaultButtonColor, + inactiveTrackColor: Provider.of(context).theme.defaultButtonDisabledColor, + secondary: Icon(CwtchIcons.negative_heart_24px, color: Provider.of(context).current().mainTextColor), + )), + + // Auto start + SwitchListTile( + title: Text(AppLocalizations.of(context)!.serverAutostartLabel, style: TextStyle(color: Provider.of(context).current().mainTextColor)), + subtitle: Text(AppLocalizations.of(context)!.serverAutostartDescription), + value: Provider.of(context).autostart, + onChanged: (bool value) { + Provider.of(context).autostart = value; + + if (!Provider.of(context).onion.isEmpty) { + Provider.of(context, listen: false).cwtch.SetProfileAttribute(Provider.of(context).onion, "profile.autostart", value ? "true" : "false"); + } + }, + activeTrackColor: Provider.of(context).theme.defaultButtonColor, + inactiveTrackColor: Provider.of(context).theme.defaultButtonDisabledColor, + secondary: Icon(CwtchIcons.favorite_24dp, color: Provider.of(context).current().mainTextColor), + ), + + Visibility( visible: Provider.of(context).onion.isEmpty, child: SizedBox( diff --git a/lib/widgets/contactrow.dart b/lib/widgets/contactrow.dart index 9cc978c4..66332612 100644 --- a/lib/widgets/contactrow.dart +++ b/lib/widgets/contactrow.dart @@ -51,7 +51,7 @@ class _ContactRowState extends State { badgeTextColor: Provider.of(context).theme.portraitContactBadgeTextColor, diameter: 64.0, imagePath: Provider.of(context).isExperimentEnabled(ImagePreviewsExperiment) ? contact.imagePath : contact.defaultImagePath, - maskOut: !contact.isOnline(), + disabled: !contact.isOnline(), border: contact.isOnline() ? Provider.of(context).theme.portraitOnlineBorderColor : contact.isBlocked diff --git a/lib/widgets/profileimage.dart b/lib/widgets/profileimage.dart index cf21f531..15a55934 100644 --- a/lib/widgets/profileimage.dart +++ b/lib/widgets/profileimage.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'dart:math'; +import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:flutter/material.dart'; import 'package:cwtch/themes/opaque.dart'; import 'package:provider/provider.dart'; @@ -17,6 +18,7 @@ class ProfileImage extends StatefulWidget { required this.badgeTextColor, this.maskOut = false, this.tooltip = "", + this.disabled = false, this.badgeEdit = false, this.badgeIcon = null}); final double diameter; @@ -26,6 +28,7 @@ class ProfileImage extends StatefulWidget { final Color badgeColor; final Color badgeTextColor; final bool maskOut; + final bool disabled; final bool badgeEdit; final String tooltip; final Widget? badgeIcon; @@ -79,10 +82,15 @@ class _ProfileImageState extends State { width: widget.diameter, height: widget.diameter, color: widget.border, + foregroundDecoration: widget.disabled ? BoxDecoration( + color: Provider.of(context).theme.portraitBackgroundColor, //Colors.grey, + backgroundBlendMode: BlendMode.color, //saturation, + ) : null, child: Padding( padding: const EdgeInsets.all(2.0), //border size child: ClipOval(clipBehavior: Clip.antiAlias, child: widget.tooltip == "" ? image : Tooltip(message: widget.tooltip, child: image))))), - Visibility( + // badge + Visibility( visible: widget.badgeIcon != null || widget.badgeEdit || widget.badgeCount > 0, child: Positioned( bottom: 0.0, @@ -98,6 +106,23 @@ class _ProfileImageState extends State { : (widget.badgeIcon != null ? widget.badgeIcon : Text(widget.badgeCount > 99 ? "99+" : widget.badgeCount.toString(), style: TextStyle(color: widget.badgeTextColor, fontSize: 8.0))), ), )), + // disabled center icon + Visibility( + visible: widget.disabled, + child: Container( + width: widget.diameter, + height: widget.diameter, + child: + Center( + + + child: ImageIcon( + AssetImage("assets/core/negative_heart_512px.png"), + size: widget.diameter / 1.25, + color: Provider.of(context).theme.portraitOfflineBorderColor, + ) + + ))), ])); } } diff --git a/lib/widgets/profilerow.dart b/lib/widgets/profilerow.dart index b017ec2a..dfc362b0 100644 --- a/lib/widgets/profilerow.dart +++ b/lib/widgets/profilerow.dart @@ -37,6 +37,7 @@ class _ProfileRowState extends State { badgeCount: profile.unreadMessages, badgeColor: Provider.of(context).theme.portraitProfileBadgeColor, badgeTextColor: Provider.of(context).theme.portraitProfileBadgeTextColor, + disabled: !profile.enabled, diameter: 64.0, imagePath: Provider.of(context).isExperimentEnabled(ImagePreviewsExperiment) ? profile.imagePath : profile.defaultImagePath, border: profile.isOnline ? Provider.of(context).theme.portraitOnlineBorderColor : Provider.of(context).theme.portraitOfflineBorderColor)), From 6746abacd72d7663aa4ff9007579ebabb72a9915 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 5 Dec 2022 12:26:17 -0800 Subject: [PATCH 3/3] fix translations for new feature, use icon --- lib/l10n/intl_cy.arb | 6 +++++- lib/l10n/intl_da.arb | 6 +++++- lib/l10n/intl_de.arb | 22 +++++++++++++--------- lib/l10n/intl_el.arb | 6 +++++- lib/l10n/intl_en.arb | 6 +++++- lib/l10n/intl_es.arb | 6 +++++- lib/l10n/intl_fr.arb | 20 ++++++++++++-------- lib/l10n/intl_it.arb | 6 +++++- lib/l10n/intl_lb.arb | 6 +++++- lib/l10n/intl_nl.arb | 8 ++++++-- lib/l10n/intl_no.arb | 6 +++++- lib/l10n/intl_pl.arb | 6 +++++- lib/l10n/intl_pt.arb | 6 +++++- lib/l10n/intl_pt_BR.arb | 14 +++++++++----- lib/l10n/intl_ro.arb | 6 +++++- lib/l10n/intl_ru.arb | 6 +++++- lib/l10n/intl_tr.arb | 8 ++++++-- lib/views/addeditprofileview.dart | 9 +++++---- lib/widgets/profileimage.dart | 6 +++--- 19 files changed, 114 insertions(+), 45 deletions(-) diff --git a/lib/l10n/intl_cy.arb b/lib/l10n/intl_cy.arb index b2c37d2f..12db6f32 100644 --- a/lib/l10n/intl_cy.arb +++ b/lib/l10n/intl_cy.arb @@ -1,6 +1,10 @@ { "@@locale": "cy", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_da.arb b/lib/l10n/intl_da.arb index 3aafcac1..820fae1c 100644 --- a/lib/l10n/intl_da.arb +++ b/lib/l10n/intl_da.arb @@ -1,6 +1,10 @@ { "@@locale": "da", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index 4327f170..78b46269 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -1,14 +1,18 @@ { "@@locale": "de", - "@@last_modified": "2022-11-18T15:19:11+01:00", - "localePtBr": "Brazilian Portuguese \/ Português do Brasil", - "localeNl": "Dutch \/ Dutch", - "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", - "enableExperimentQRCode": "QR Codes", - "shareMenuQRCode": "Show QR Code", - "shareProfileMenuTooltop": "Share profile via...", - "acquiredTicketsFromServer": "Antispam Challenge Complete", - "acquiringTicketsFromServer": "Performing Antispam Challenge", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", + "acquiringTicketsFromServer": "Antispam-Herausforderung meistern", + "acquiredTicketsFromServer": "Antispam-Herausforderung abgeschlossen", + "shareProfileMenuTooltop": "Profil teilen über...", + "localeNl": "Niederländisch \/ Nederlands", + "localePtBr": "Brasilianisches Portugiesisch \/ Português do Brasil", + "shareMenuQRCode": "QR-Code anzeigen", + "enableExperimentQRCode": "QR-Codes", + "experimentQRCodeDescription": "QR-Code-Unterstützung ermöglicht den Austausch von Daten (z. B. Profilidentität) über QR-Codes", "localeIt": "Italienisch \/ Italiano", "errorDownloadDirectoryDoesNotExist": "Die Dateifreigabe kann nicht aktiviert werden, da der Download-Ordner nicht festgelegt wurde oder auf einen nicht vorhandenen Ordner festgelegt ist.", "localeTr": "Türkisch \/ Türk", diff --git a/lib/l10n/intl_el.arb b/lib/l10n/intl_el.arb index 20bcde04..e8b5bd9e 100644 --- a/lib/l10n/intl_el.arb +++ b/lib/l10n/intl_el.arb @@ -1,6 +1,10 @@ { "@@locale": "el", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 73fc8ea1..a1cb0793 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -1,6 +1,10 @@ { "@@locale": "en", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index 17ac828e..7acf83de 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -1,6 +1,10 @@ { "@@locale": "es", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 08d6fe7d..73557354 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -1,14 +1,18 @@ { "@@locale": "fr", - "@@last_modified": "2022-11-18T15:19:11+01:00", - "localePtBr": "Brazilian Portuguese \/ Português do Brasil", - "localeNl": "Dutch \/ Dutch", - "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", + "shareProfileMenuTooltop": "Partager le profil via...", + "shareMenuQRCode": "Afficher le QR code", + "localePtBr": "Portugais du Brésil \/ Português do Brasil", + "localeNl": "néerlandais \/ néerlandais", + "experimentQRCodeDescription": "La prise en charge des QR codes permet de partager des données (telles que l'identité du profil) par des QR codes \n", "enableExperimentQRCode": "QR Codes", - "shareMenuQRCode": "Show QR Code", - "shareProfileMenuTooltop": "Share profile via...", - "acquiredTicketsFromServer": "Antispam Challenge Complete", - "acquiringTicketsFromServer": "Performing Antispam Challenge", + "acquiringTicketsFromServer": "Réaliser un défi anti-spam", + "acquiredTicketsFromServer": "Défi anti-spam terminé", "errorDownloadDirectoryDoesNotExist": "Le partage de fichiers ne peut pas être activé car le dossier de téléchargement n'a pas été défini ou est défini sur un dossier qui n'existe pas.", "localeIt": "italien \/ italien", "localeTr": "Turc \/ Türk", diff --git a/lib/l10n/intl_it.arb b/lib/l10n/intl_it.arb index 9cc30f24..ca39b32d 100644 --- a/lib/l10n/intl_it.arb +++ b/lib/l10n/intl_it.arb @@ -1,6 +1,10 @@ { "@@locale": "it", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "tooltipPinConversation": "Aggiungi la conversazione in cima alla lista \"Conversazioni\"", diff --git a/lib/l10n/intl_lb.arb b/lib/l10n/intl_lb.arb index 90b03f29..3d54cab8 100644 --- a/lib/l10n/intl_lb.arb +++ b/lib/l10n/intl_lb.arb @@ -1,6 +1,10 @@ { "@@locale": "lb", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_nl.arb b/lib/l10n/intl_nl.arb index 5d30ba5f..c5084d54 100644 --- a/lib/l10n/intl_nl.arb +++ b/lib/l10n/intl_nl.arb @@ -1,7 +1,11 @@ { "@@locale": "nl", - "@@last_modified": "2022-11-18T15:19:11+01:00", - "localePtBr": "Brazilian Portuguese \/ Português do Brasil", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", + "localePtBr": "Braziliaans Portugees \/ Português do Brasil", "acquiredTicketsFromServer": "Anti-spam uitdaging voltooid", "acquiringTicketsFromServer": "Anti-spam uitdaging uitvoeren", "acknowledgedLabel": "Erkend", diff --git a/lib/l10n/intl_no.arb b/lib/l10n/intl_no.arb index 396bc5bd..f0711b25 100644 --- a/lib/l10n/intl_no.arb +++ b/lib/l10n/intl_no.arb @@ -1,6 +1,10 @@ { "@@locale": "no", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb index 7014169a..485f9977 100644 --- a/lib/l10n/intl_pl.arb +++ b/lib/l10n/intl_pl.arb @@ -1,6 +1,10 @@ { "@@locale": "pl", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_pt.arb b/lib/l10n/intl_pt.arb index 6c350817..4ba9acd7 100644 --- a/lib/l10n/intl_pt.arb +++ b/lib/l10n/intl_pt.arb @@ -1,6 +1,10 @@ { "@@locale": "pt", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_pt_BR.arb b/lib/l10n/intl_pt_BR.arb index 02f20ed0..1ecfa75d 100644 --- a/lib/l10n/intl_pt_BR.arb +++ b/lib/l10n/intl_pt_BR.arb @@ -1,6 +1,10 @@ { "@@locale": "pt_BR", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Português do Brasil \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "O suporte a QR Code permite o compartilhamento de dados (como identidade de perfil) através dos QR Codes", @@ -289,7 +293,7 @@ "password1Label": "Senha", "currentPasswordLabel": "Senha Atual", "yourDisplayName": "Seu nome de exibição", - "profileOnionLabel": "Envie este endereço para contatos que você deseja se conectar", + "profileOnionLabel": "Send this address to contacts you want to connect with", "noPasswordWarning": "Não usar uma senha nesta conta significa que todos os dados armazenados localmente não serão criptografados", "radioNoPassword": "Descriptografado (Sem senha)", "radioUsePassword": "Senha", @@ -299,13 +303,13 @@ "profileName": "Nome de exibição", "editProfileTitle": "Editar perfil", "addProfileTitle": "Adicionar novo perfil", - "deleteBtn": "Deletar", + "deleteBtn": "Delete", "unblockBtn": "Desbloquear Contato", "dontSavePeerHistory": "Deletar histórico", "savePeerHistoryDescription": "Determina se deve excluir algum histórico associado com o contato.", "savePeerHistory": "Salvar histórico", "blockBtn": "Bloquear Contato", - "saveBtn": "Salvar", + "saveBtn": "Save", "displayNameLabel": "Nome de Exibição", "copiedToClipboardNotification": "Copiado", "addressLabel": "Endereço", @@ -339,7 +343,7 @@ "serverConnectivityConnected": "Servidor Conectado", "serverInfo": "Informação do Servidor", "invitationLabel": "Convite", - "serverLabel": "Servidor", + "serverLabel": "Server", "search": "Pesquisar...", "blocked": "Bloqueado", "pasteAddressToAddContact": "… cole um endereço aqui para adicionar um contato…", diff --git a/lib/l10n/intl_ro.arb b/lib/l10n/intl_ro.arb index 349951aa..023dff44 100644 --- a/lib/l10n/intl_ro.arb +++ b/lib/l10n/intl_ro.arb @@ -1,6 +1,10 @@ { "@@locale": "ro", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index 511c2b55..f80f2328 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -1,6 +1,10 @@ { "@@locale": "ru", - "@@last_modified": "2022-11-18T15:19:11+01:00", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", "localePtBr": "Brazilian Portuguese \/ Português do Brasil", "localeNl": "Dutch \/ Dutch", "experimentQRCodeDescription": "QR Code support allows sharing data (such as profile identity) by QR Codes", diff --git a/lib/l10n/intl_tr.arb b/lib/l10n/intl_tr.arb index 83f70361..d69332b4 100644 --- a/lib/l10n/intl_tr.arb +++ b/lib/l10n/intl_tr.arb @@ -1,7 +1,11 @@ { "@@locale": "tr", - "@@last_modified": "2022-11-18T15:19:11+01:00", - "localePtBr": "Brazilian Portuguese \/ Português do Brasil", + "@@last_modified": "2022-12-05T21:06:07+01:00", + "profileEnabledDescription": "Start or stop the profile", + "profileAutostartDescription": "Controls if the profile will be automatically launched on startup", + "profileEnabled": "Enable", + "profileAutostartLabel": "Autostart", + "localePtBr": "Brezilya Portekizcesi \/ Português do Brasil", "experimentQRCodeDescription": "QR Kod desteği profil kimliği gibi verilerin QR Kodla paylaşılmasına olanak tanır", "acquiringTicketsFromServer": "Spame Karşı Sınama", "acquiredTicketsFromServer": "Spame Karşı Sınama Tamamlandı", diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index f6ab0f01..b172a1af 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -174,8 +174,8 @@ class _AddEditProfileViewState extends State { Visibility( visible: Provider.of(context).onion.isNotEmpty, child: SwitchListTile( - title: Text(AppLocalizations.of(context)!.serverEnabled, style: TextStyle(color: Provider.of(context).current().mainTextColor)), - subtitle: Text(AppLocalizations.of(context)!.serverEnabledDescription), + title: Text(AppLocalizations.of(context)!.profileEnabled, style: TextStyle(color: Provider.of(context).current().mainTextColor)), + subtitle: Text(AppLocalizations.of(context)!.profileEnabledDescription), value: Provider.of(context).enabled, onChanged: (bool value) { Provider.of(context).enabled = value; @@ -192,8 +192,8 @@ class _AddEditProfileViewState extends State { // Auto start SwitchListTile( - title: Text(AppLocalizations.of(context)!.serverAutostartLabel, style: TextStyle(color: Provider.of(context).current().mainTextColor)), - subtitle: Text(AppLocalizations.of(context)!.serverAutostartDescription), + title: Text(AppLocalizations.of(context)!.profileAutostartLabel, style: TextStyle(color: Provider.of(context).current().mainTextColor)), + subtitle: Text(AppLocalizations.of(context)!.profileAutostartDescription), value: Provider.of(context).autostart, onChanged: (bool value) { Provider.of(context).autostart = value; @@ -397,6 +397,7 @@ class _AddEditProfileViewState extends State { // match (and are provided if the user has requested an encrypted profile). if (_formKey.currentState!.validate()) { if (Provider.of(context, listen: false).onion.isEmpty) { + // TODO: save autostart in create flow if (usePassword == true) { Provider.of(context, listen: false).cwtch.CreateProfile(ctrlrNick.value.text, ctrlrPass.value.text); Navigator.of(context).pop(); diff --git a/lib/widgets/profileimage.dart b/lib/widgets/profileimage.dart index 15a55934..cc6a2c54 100644 --- a/lib/widgets/profileimage.dart +++ b/lib/widgets/profileimage.dart @@ -116,9 +116,9 @@ class _ProfileImageState extends State { Center( - child: ImageIcon( - AssetImage("assets/core/negative_heart_512px.png"), - size: widget.diameter / 1.25, + child: Icon( + CwtchIcons.negative_heart_24px, + size: widget.diameter / 1.5, color: Provider.of(context).theme.portraitOfflineBorderColor, )