Select Profile Image tooltip + restrict selection only when image previews are enabled

This commit is contained in:
Sarah Jamie Lewis 2022-02-07 12:20:54 -08:00
parent c6192ef736
commit d158d7d619
11 changed files with 31 additions and 21 deletions

View File

@ -4,7 +4,7 @@ import 'package:file_picker/file_picker.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
void showFilePicker(BuildContext ctx, int maxBytes, Function(File) onSuccess, Function onCancel, Function onError) async { void showFilePicker(BuildContext ctx, int maxBytes, Function(File) onSuccess, Function onError, Function onCancel) async {
// only allow one file picker at a time // only allow one file picker at a time
// note: ideally we would destroy file picker when leaving a conversation // note: ideally we would destroy file picker when leaving a conversation
// but we don't currently have that option. // but we don't currently have that option.

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "de", "@@locale": "de",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network", "labelTorNetwork": "Tor Network",
@ -162,7 +163,7 @@
"newPassword": "Neues Passwort", "newPassword": "Neues Passwort",
"yesLeave": "Ja, diese Unterhaltung beenden", "yesLeave": "Ja, diese Unterhaltung beenden",
"reallyLeaveThisGroupPrompt": "Bist du sicher, dass du diese Unterhaltung beenden möchtest? Alle Nachrichten und Attribute werden gelöscht.", "reallyLeaveThisGroupPrompt": "Bist du sicher, dass du diese Unterhaltung beenden möchtest? Alle Nachrichten und Attribute werden gelöscht.",
"leaveGroup": "Unterhaltung beenden", "leaveConversation": "Unterhaltung beenden",
"inviteToGroup": "Du wurdest eingeladen einer Gruppe beizutreten:", "inviteToGroup": "Du wurdest eingeladen einer Gruppe beizutreten:",
"titleManageServers": "Server verwalten", "titleManageServers": "Server verwalten",
"dateNever": "Nie", "dateNever": "Nie",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "en", "@@locale": "en",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"editProfile": "Edit Profile", "editProfile": "Edit Profile",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
@ -164,7 +165,7 @@
"newPassword": "New Password", "newPassword": "New Password",
"yesLeave": "Yes, Leave This Conversation", "yesLeave": "Yes, Leave This Conversation",
"reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.", "reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.",
"leaveGroup": "Leave This Conversation", "leaveConversation": "Leave This Conversation",
"inviteToGroup": "You have been invited to join a group:", "inviteToGroup": "You have been invited to join a group:",
"pasteAddressToAddContact": "Paste a cwtch address, invitation or key bundle here to add a new conversation", "pasteAddressToAddContact": "Paste a cwtch address, invitation or key bundle here to add a new conversation",
"tooltipAddContact": "Add a new contact or conversation", "tooltipAddContact": "Add a new contact or conversation",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "es", "@@locale": "es",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network", "labelTorNetwork": "Tor Network",
@ -148,7 +149,7 @@
"newPassword": "New Password", "newPassword": "New Password",
"yesLeave": "Yes, Leave This Conversation", "yesLeave": "Yes, Leave This Conversation",
"reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.", "reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.",
"leaveGroup": "Leave This Conversation", "leaveConversation": "Leave This Conversation",
"inviteToGroup": "You have been invited to join a group:", "inviteToGroup": "You have been invited to join a group:",
"titleManageServers": "Manage Servers", "titleManageServers": "Manage Servers",
"dateNever": "Never", "dateNever": "Never",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "fr", "@@locale": "fr",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"editProfile": "Modifier le profil", "editProfile": "Modifier le profil",
"settingTheme": "Utilisez des thèmes clairs", "settingTheme": "Utilisez des thèmes clairs",
"torSettingsUseCustomTorServiceConfiguration": "Utiliser une configuration personnalisée du service Tor (torrc)", "torSettingsUseCustomTorServiceConfiguration": "Utiliser une configuration personnalisée du service Tor (torrc)",
@ -213,7 +214,7 @@
"dateNever": "Jamais", "dateNever": "Jamais",
"titleManageServers": "Gérer les serveurs", "titleManageServers": "Gérer les serveurs",
"inviteToGroup": "Vous avez été invité à rejoindre un groupe :", "inviteToGroup": "Vous avez été invité à rejoindre un groupe :",
"leaveGroup": "Quittez cette conversation", "leaveConversation": "Quittez cette conversation",
"reallyLeaveThisGroupPrompt": "Êtes-vous sûr de vouloir quitter cette conversation ? Tous les messages et attributs seront supprimés.", "reallyLeaveThisGroupPrompt": "Êtes-vous sûr de vouloir quitter cette conversation ? Tous les messages et attributs seront supprimés.",
"yesLeave": "Oui, quittez cette conversation", "yesLeave": "Oui, quittez cette conversation",
"noPasswordWarning": "Ne pas utiliser de mot de passe sur ce compte signifie que toutes les données stockées localement ne seront pas chiffrées.", "noPasswordWarning": "Ne pas utiliser de mot de passe sur ce compte signifie que toutes les données stockées localement ne seront pas chiffrées.",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "it", "@@locale": "it",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network", "labelTorNetwork": "Tor Network",
@ -38,7 +39,7 @@
"copiedToClipboardNotification": "Copiato negli Appunti", "copiedToClipboardNotification": "Copiato negli Appunti",
"groupNameLabel": "Nome del gruppo", "groupNameLabel": "Nome del gruppo",
"titleManageServers": "Gestisci i Server", "titleManageServers": "Gestisci i Server",
"leaveGroup": "Lascia Questa Conversazione", "leaveConversation": "Lascia Questa Conversazione",
"yesLeave": "Sì, Lascia Questa Conversazione", "yesLeave": "Sì, Lascia Questa Conversazione",
"newPassword": "Nuova Password", "newPassword": "Nuova Password",
"sendMessage": "Invia Messaggio", "sendMessage": "Invia Messaggio",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "pl", "@@locale": "pl",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network", "labelTorNetwork": "Tor Network",
@ -209,7 +210,7 @@
"chatHistoryDefault": "Ta konwersacja zostanie usunięta gdy zamkniesz Cwtch! Możesz włączyć zapisywanie wiadomości dla każdej konwersacji osobno w menu w prawym górnym rogu.", "chatHistoryDefault": "Ta konwersacja zostanie usunięta gdy zamkniesz Cwtch! Możesz włączyć zapisywanie wiadomości dla każdej konwersacji osobno w menu w prawym górnym rogu.",
"yesLeave": "Opuść", "yesLeave": "Opuść",
"reallyLeaveThisGroupPrompt": "Na pewno chcesz opuścić tę grupę? Wszystkie wiadomości i atrybuty zostaną usunięte.", "reallyLeaveThisGroupPrompt": "Na pewno chcesz opuścić tę grupę? Wszystkie wiadomości i atrybuty zostaną usunięte.",
"leaveGroup": "Opuść grupę", "leaveConversation": "Opuść grupę",
"inviteToGroup": "Zaproszono Cię do grupy:", "inviteToGroup": "Zaproszono Cię do grupy:",
"dateNever": "Nigdy", "dateNever": "Nigdy",
"dateLastYear": "Rok temu", "dateLastYear": "Rok temu",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "pt", "@@locale": "pt",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network", "labelTorNetwork": "Tor Network",
@ -148,7 +149,7 @@
"newPassword": "New Password", "newPassword": "New Password",
"yesLeave": "Yes, Leave This Conversation", "yesLeave": "Yes, Leave This Conversation",
"reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.", "reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.",
"leaveGroup": "Leave This Conversation", "leaveConversation": "Leave This Conversation",
"inviteToGroup": "You have been invited to join a group:", "inviteToGroup": "You have been invited to join a group:",
"titleManageServers": "Manage Servers", "titleManageServers": "Manage Servers",
"dateNever": "Never", "dateNever": "Never",

View File

@ -1,6 +1,7 @@
{ {
"@@locale": "ru", "@@locale": "ru",
"@@last_modified": "2022-01-28T19:57:41+01:00", "@@last_modified": "2022-02-07T21:17:01+01:00",
"tooltipSelectACustomProfileImage": "Select a Custom Profile Image",
"torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.", "torSettingsEnabledCacheDescription": "Cache the current downloaded Tor consensus to reuse next time Cwtch is opened. This will allow Tor to start faster. When disabled, Cwtch will purge cached data on start up.",
"torSettingsEnableCache": "Cache Tor Consensus", "torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network", "labelTorNetwork": "Tor Network",
@ -164,7 +165,7 @@
"newPassword": "Новый пароль", "newPassword": "Новый пароль",
"yesLeave": "Да, оставить этот чат", "yesLeave": "Да, оставить этот чат",
"reallyLeaveThisGroupPrompt": "Вы уверены, что хотите закончить этот разговор? Все сообщения будут удалены.", "reallyLeaveThisGroupPrompt": "Вы уверены, что хотите закончить этот разговор? Все сообщения будут удалены.",
"leaveGroup": "Да, оставить этот чат", "leaveConversation": "Да, оставить этот чат",
"inviteToGroup": "Вас пригласили присоединиться к группе:", "inviteToGroup": "Вас пригласили присоединиться к группе:",
"titleManageServers": "Управление серверами", "titleManageServers": "Управление серверами",
"dateNever": "Никогда", "dateNever": "Никогда",

View File

@ -91,9 +91,10 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty, visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty,
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
MouseRegion( MouseRegion(
cursor: SystemMouseCursors.click, cursor: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? SystemMouseCursors.click : SystemMouseCursors.basic,
child: GestureDetector( child: GestureDetector(
onTap: Provider.of<AppState>(context).disableFilePicker // don't allow setting of profile images if the image previews experiment is disabled.
onTap: Provider.of<AppState>(context).disableFilePicker || !Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment)
? null ? null
: () { : () {
filesharing.showFilePicker(context, MaxImageFileSharingSize, (File file) { filesharing.showFilePicker(context, MaxImageFileSharingSize, (File file) {
@ -113,6 +114,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
child: ProfileImage( child: ProfileImage(
imagePath: Provider.of<ProfileInfoState>(context).imagePath, imagePath: Provider.of<ProfileInfoState>(context).imagePath,
diameter: 120, diameter: 120,
tooltip: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? AppLocalizations.of(context)!.tooltipSelectACustomProfileImage : "",
maskOut: false, maskOut: false,
border: theme.theme.portraitOnlineBorderColor, border: theme.theme.portraitOnlineBorderColor,
badgeTextColor: Colors.red, badgeTextColor: Colors.red,

View File

@ -159,7 +159,7 @@ class _GroupSettingsViewState extends State<GroupSettingsView> {
), ),
Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [ Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [
Tooltip( Tooltip(
message: AppLocalizations.of(context)!.leaveGroup, message: AppLocalizations.of(context)!.leaveConversation,
child: TextButton.icon( child: TextButton.icon(
onPressed: () { onPressed: () {
showAlertDialog(context); showAlertDialog(context);
@ -167,7 +167,7 @@ class _GroupSettingsViewState extends State<GroupSettingsView> {
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.transparent)), style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.transparent)),
icon: Icon(CwtchIcons.leave_group), icon: Icon(CwtchIcons.leave_group),
label: Text( label: Text(
AppLocalizations.of(context)!.leaveGroup, AppLocalizations.of(context)!.leaveConversation,
style: TextStyle(decoration: TextDecoration.underline), style: TextStyle(decoration: TextDecoration.underline),
), ),
)) ))