Merge pull request 'New Icons, New Translations, More Complete Profile Menu' (#728) from stable-blockers into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #728
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2023-09-20 22:33:37 +00:00
commit feccc04933
35 changed files with 274 additions and 47 deletions

Binary file not shown.

View File

@ -40,14 +40,14 @@ StepDefinitionGeneric TorVersionPresent() {
context.expect(versionString, "#.#.#", reason: "error reading version string from fetch-tor.sh");
return;
}
context.world.attach( versionString.substring(0,4), "text/plain", "Then I expect the Tor version to be present");
context.world.attach(versionString.substring(0, 4), "text/plain", "Then I expect the Tor version to be present");
//context.reporter.message("test!!!", MessageLevel.info);
print("looking for version string $versionString");
return await context.world.appDriver.waitUntil(() async {
context.world.appDriver.waitForAppToSettle();
final finder = context.world.appDriver.findBy(
versionString.substring(0,4),
versionString.substring(0, 4),
FindType.text,
);
return await context.world.appDriver.isPresent(finder);

View File

@ -155,5 +155,5 @@ abstract class Cwtch {
Future<String> SearchConversations(String profile, String pattern);
void DeleteServerInfo(String profile, String handle);
void ConfigureConnections(String onion, bool listen, bool peers, bool servers);
Future<void> ConfigureConnections(String onion, bool listen, bool peers, bool servers);
}

View File

@ -1102,7 +1102,7 @@ class CwtchFfi implements Cwtch {
}
@override
void ConfigureConnections(String profile, bool listen, bool peers, bool servers) {
Future<void> ConfigureConnections(String profile, bool listen, bool peers, bool servers) async {
var configureConnections = library.lookup<NativeFunction<void_from_string_bool_bool_bool>>("c_ConfigureConnections");
// ignore: non_constant_identifier_names
final ConfigureConnections = configureConnections.asFunction<VoidFromStringBoolBoolBool>();

View File

@ -460,7 +460,8 @@ class CwtchGomobile implements Cwtch {
}
@override
void ConfigureConnections(String profile, bool listen, bool peers, bool servers) {
Future<void> ConfigureConnections(String profile, bool listen, bool peers, bool servers) async {
cwtchPlatform.invokeMethod("ConfigureConnections", {"ProfileOnion": profile, "listen": listen, "peers": peers, "servers": servers});
return;
}
}

View File

@ -1,5 +1,5 @@
/// Flutter icons Cwtch
/// Copyright (C) 2021-2022 by Open Privacy Research Society
/// Copyright (C) 2021-2023 by Open Privacy Research Society
/// This font was generated by FlutterIcon.com, which is derived from Fontello.
///
/// To use this font, place it in your fonts/ directory and include the
@ -124,6 +124,7 @@ class CwtchIcons {
static const IconData view_replies = IconData(0xe869, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData anti_spam_2 = IconData(0xe86b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData manage_files = IconData(0xe86c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData attached_file_2 = IconData(0xe86d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData anti_spam_3 = IconData(0xe86e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData attached_file_3 = IconData(0xe86f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData disconnect_from_contact = IconData(0xe870, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}

View File

@ -1,6 +1,11 @@
{
"@@locale": "cy",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "da",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "de",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "el",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "en",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "es",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "fr",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "it",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "ja",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "ko",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "lb",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "nl",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "no",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "pl",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "pt",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "pt_BR",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "ro",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "ru",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "sk",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "sv",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "sw",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "tr",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -1,6 +1,11 @@
{
"@@locale": "uk",
"@@last_modified": "2023-09-13T18:51:59+02:00",
"@@last_modified": "2023-09-20T21:00:37+02:00",
"profileAllowUnknownContacts": "Allow Unknown Contacts",
"profileBlockUnknownContacts": "Block Unknown Contacts",
"profileDisableProfile": "Disable Profile",
"profileEnableProfile": "Enable Profile",
"profileAppearOnline": "Appear Online",
"contactDisconnect": "Disconnect from Contact (if you do not have Appear Offline set this contact may still be able to reestablish a connection to you)",
"profileAppearOfflineDescription": "By default, when Cwtch profile is enabled it automatically attempts to connect to know contacts, and allows inbound connections. This settings disables those actions and allows you to choose, manually, which contacts to connect to.",
"profileAppearOffline": "Appear Offline",

View File

@ -286,6 +286,8 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
if (value == true && Provider.of<ProfileInfoState>(context, listen: false).enabled) {
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
} else {
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, true, true, true);
}
}
},

View File

@ -8,6 +8,7 @@ import 'package:cwtch/models/contactlist.dart';
import 'package:cwtch/models/profile.dart';
import 'package:cwtch/models/profilelist.dart';
import 'package:cwtch/models/search.dart';
import 'package:cwtch/views/globalsettingsview.dart';
import 'package:cwtch/views/profileserversview.dart';
import 'package:flutter/material.dart';
import 'package:cwtch/widgets/contactrow.dart';
@ -30,7 +31,7 @@ import 'messageview.dart';
enum ShareMenu { copyCode, qrcode }
enum ProfileStatusMenu { available, away, busy, appearOffline, editProfile }
enum ProfileStatusMenu { available, away, busy, appearOnline, appearOffline, allowUnknownContacts, blockUnknownContacts, enableProfile, disableProfile, editProfile }
class ContactsView extends StatefulWidget {
const ContactsView({Key? key}) : super(key: key);
@ -117,6 +118,9 @@ class _ContactsViewState extends State<ContactsView> {
@override
Widget build(BuildContext context) {
var enabled = Provider.of<ProfileInfoState>(context, listen: false).enabled;
var appearOffline = Provider.of<ProfileInfoState>(context, listen: false).appearOffline;
var settings = Provider.of<Settings>(context, listen: false);
return ScaffoldMessenger(
key: scaffoldKey,
child: Scaffold(
@ -181,6 +185,8 @@ class _ContactsViewState extends State<ContactsView> {
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.profile-status", "busy");
break;
case ProfileStatusMenu.appearOffline:
Provider.of<ProfileInfoState>(context, listen: false).appearOffline = true;
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.appear-offline", "true");
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
break;
@ -199,29 +205,131 @@ class _ContactsViewState extends State<ContactsView> {
transitionDuration: Duration(milliseconds: 200),
),
);
break;
case ProfileStatusMenu.appearOnline:
Provider.of<ProfileInfoState>(context, listen: false).appearOffline = false;
Provider.of<FlwtchState>(context, listen: false).cwtch.SetProfileAttribute(onion, "profile.appear-offline", "false");
// we only need to toggle all connections on here..
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, true, true, true);
break;
case ProfileStatusMenu.allowUnknownContacts:
settings.blockUnknownConnections = false;
saveSettings(context);
break;
case ProfileStatusMenu.blockUnknownContacts:
settings.blockUnknownConnections = true;
saveSettings(context);
break;
case ProfileStatusMenu.enableProfile:
Provider.of<ProfileInfoState>(context, listen: false).enabled = true;
if (Provider.of<ProfileInfoState>(context, listen: false).appearOffline) {
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, false, false, false);
} else {
Provider.of<FlwtchState>(context, listen: false).cwtch.ConfigureConnections(onion, true, true, true);
}
break;
case ProfileStatusMenu.disableProfile:
Provider.of<ProfileInfoState>(context, listen: false).enabled = false;
Provider.of<ProfileInfoState>(context, listen: false).deactivatePeerEngine(context);
break;
}
},
itemBuilder: (BuildContext context) => <PopupMenuEntry<ProfileStatusMenu>>[
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.available,
child: Text(AppLocalizations.of(context)!.availabilityStatusAvailable!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
enabled: enabled,
child: Row(children: [
Icon(
CwtchIcons.account_circle_24px,
color: Colors.white,
),
Expanded(
child: Text(AppLocalizations.of(context)!.availabilityStatusAvailable!,
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.away,
child: Text(AppLocalizations.of(context)!.availabilityStatusAway!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
enabled: enabled,
child: Row(children: [
Icon(
CwtchIcons.account_circle_24px,
color: Colors.yellowAccent,
),
Expanded(
child: Text(AppLocalizations.of(context)!.availabilityStatusAway!,
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.busy,
child: Text(AppLocalizations.of(context)!.availabilityStatusBusy!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.appearOffline,
child: Text(AppLocalizations.of(context)!.profileAppearOffline!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
enabled: enabled,
child: Row(children: [
Icon(
CwtchIcons.account_circle_24px,
color: Colors.redAccent,
),
Expanded(
child: Text(AppLocalizations.of(context)!.availabilityStatusBusy!,
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuDivider(),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.appearOffline,
enabled: enabled && !appearOffline,
child: Row(children: [
Icon(CwtchIcons.disconnect_from_contact),
Expanded(
child: Text(AppLocalizations.of(context)!.profileAppearOffline!,
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.appearOnline,
enabled: enabled && appearOffline,
child: Row(children: [
Icon(CwtchIcons.disconnect_from_contact),
Expanded(
child: Text(AppLocalizations.of(context)!.profileAppearOnline!,
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuDivider(),
PopupMenuItem<ProfileStatusMenu>(
value: !settings.blockUnknownConnections ? ProfileStatusMenu.blockUnknownContacts : ProfileStatusMenu.allowUnknownContacts,
child: Row(children: [
Icon(
CwtchIcons.block_unknown,
color: settings.theme.mainTextColor,
),
Expanded(
child: Text((settings.blockUnknownConnections ? AppLocalizations.of(context)!.profileAllowUnknownContacts! : AppLocalizations.of(context)!.profileBlockUnknownContacts!),
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuDivider(),
PopupMenuItem<ProfileStatusMenu>(
value: enabled ? ProfileStatusMenu.disableProfile : ProfileStatusMenu.enableProfile,
child: Row(children: [
Icon(CwtchIcons.favorite_24dp, color: settings.theme.mainTextColor),
Expanded(
child: Text((enabled ? AppLocalizations.of(context)!.profileDisableProfile! : AppLocalizations.of(context)!.profileEnableProfile!),
textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
PopupMenuItem<ProfileStatusMenu>(
value: ProfileStatusMenu.editProfile,
child: Text(AppLocalizations.of(context)!.editProfile!, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)),
enabled: true,
child: Row(children: [
Icon(
CwtchIcons.edit_24px,
color: settings.theme.mainTextColor,
),
Expanded(
child:
Text(AppLocalizations.of(context)!.editProfile!, textAlign: TextAlign.right, style: Provider.of<Settings>(context, listen: false).scaleFonts(defaultTextButtonStyle)))
]),
),
],
),

View File

@ -60,7 +60,7 @@ class _FileSharingViewState extends State<FileSharingView> {
value: sharedFiles[index]["Active"],
activeTrackColor: Provider.of<Settings>(context).theme.defaultButtonColor,
inactiveTrackColor: Provider.of<Settings>(context).theme.defaultButtonDisabledColor,
secondary: Icon(CwtchIcons.attached_file_2, color: Provider.of<Settings>(context).current().mainTextColor),
secondary: Icon(CwtchIcons.attached_file_3, color: Provider.of<Settings>(context).current().mainTextColor),
onChanged: (newValue) {
setState(() {
if (newValue) {

View File

@ -455,7 +455,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
},
activeTrackColor: settings.theme.defaultButtonColor,
inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
secondary: Icon(CwtchIcons.attached_file_2, color: settings.current().mainTextColor),
secondary: Icon(CwtchIcons.attached_file_3, color: settings.current().mainTextColor),
),
Visibility(
visible: settings.isExperimentEnabled(FileSharingExperiment),

View File

@ -109,7 +109,7 @@ class _MessageViewState extends State<MessageView> {
if (Provider.of<ContactInfoState>(context, listen: false).isOnline()) {
appBarButtons.add(IconButton(
splashRadius: Material.defaultSplashRadius / 2,
icon: Icon(Icons.speaker_notes_off),
icon: Icon(CwtchIcons.disconnect_from_contact),
tooltip: AppLocalizations.of(context)!.contactDisconnect,
onPressed: () {
if (Provider.of<ContactInfoState>(context, listen: false).isGroup) {
@ -146,7 +146,7 @@ class _MessageViewState extends State<MessageView> {
if (showFileSharing) {
appBarButtons.add(IconButton(
splashRadius: Material.defaultSplashRadius / 2,
icon: Icon(CwtchIcons.attached_file_2, size: 26, color: Provider.of<Settings>(context).theme.mainTextColor),
icon: Icon(CwtchIcons.attached_file_3, size: 26, color: Provider.of<Settings>(context).theme.mainTextColor),
tooltip: AppLocalizations.of(context)!.tooltipSendFile,
onPressed: Provider.of<AppState>(context).disableFilePicker
? null

View File

@ -139,7 +139,7 @@ class FileBubbleState extends State<FileBubble> {
} else if (widget.isPreview && myFile == null) {
return Row(
children: [
Icon(CwtchIcons.attached_file_2, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor),
Icon(CwtchIcons.attached_file_3, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor),
Flexible(child: Text(widget.nameSuggestion, style: TextStyle(fontWeight: FontWeight.bold, fontFamily: "Inter", color: Provider.of<Settings>(context).theme.messageFromMeTextColor)))
],
);
@ -340,7 +340,7 @@ class FileBubbleState extends State<FileBubble> {
maxLines: 4,
textWidthBasis: TextWidthBasis.parent,
),
leading: Icon(CwtchIcons.attached_file_2, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor));
leading: Icon(CwtchIcons.attached_file_3, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor));
}
// Construct an file chrome
@ -378,7 +378,7 @@ class FileBubbleState extends State<FileBubble> {
maxLines: 4,
textWidthBasis: TextWidthBasis.parent,
),
leading: Icon(CwtchIcons.attached_file_2, size: 32, color: Provider.of<Settings>(context).theme.messageFromOtherTextColor),
leading: Icon(CwtchIcons.attached_file_3, size: 32, color: Provider.of<Settings>(context).theme.messageFromOtherTextColor),
trailing: Visibility(
visible: speed != "0 B/s",
child: SelectableText(
@ -402,7 +402,7 @@ class FileBubbleState extends State<FileBubble> {
padding: EdgeInsets.all(10),
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
ListTile(
leading: Icon(CwtchIcons.attached_file_2),
leading: Icon(CwtchIcons.attached_file_3),
title: Text(meta),
trailing: IconButton(
icon: Icon(Icons.close),