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: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
// note: ideally we would destroy file picker when leaving a conversation
// but we don't currently have that option.

View File

@ -1,6 +1,7 @@
{
"@@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.",
"torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network",
@ -162,7 +163,7 @@
"newPassword": "Neues Passwort",
"yesLeave": "Ja, diese Unterhaltung beenden",
"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:",
"titleManageServers": "Server verwalten",
"dateNever": "Nie",

View File

@ -1,6 +1,7 @@
{
"@@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",
"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",
@ -164,7 +165,7 @@
"newPassword": "New Password",
"yesLeave": "Yes, Leave This Conversation",
"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:",
"pasteAddressToAddContact": "Paste a cwtch address, invitation or key bundle here to add a new conversation",
"tooltipAddContact": "Add a new contact or conversation",

View File

@ -1,6 +1,7 @@
{
"@@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.",
"torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network",
@ -148,7 +149,7 @@
"newPassword": "New Password",
"yesLeave": "Yes, Leave This Conversation",
"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:",
"titleManageServers": "Manage Servers",
"dateNever": "Never",

View File

@ -1,6 +1,7 @@
{
"@@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",
"settingTheme": "Utilisez des thèmes clairs",
"torSettingsUseCustomTorServiceConfiguration": "Utiliser une configuration personnalisée du service Tor (torrc)",
@ -213,7 +214,7 @@
"dateNever": "Jamais",
"titleManageServers": "Gérer les serveurs",
"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.",
"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.",

View File

@ -1,6 +1,7 @@
{
"@@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.",
"torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network",
@ -38,7 +39,7 @@
"copiedToClipboardNotification": "Copiato negli Appunti",
"groupNameLabel": "Nome del gruppo",
"titleManageServers": "Gestisci i Server",
"leaveGroup": "Lascia Questa Conversazione",
"leaveConversation": "Lascia Questa Conversazione",
"yesLeave": "Sì, Lascia Questa Conversazione",
"newPassword": "Nuova Password",
"sendMessage": "Invia Messaggio",

View File

@ -1,6 +1,7 @@
{
"@@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.",
"torSettingsEnableCache": "Cache Tor Consensus",
"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.",
"yesLeave": "Opuść",
"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:",
"dateNever": "Nigdy",
"dateLastYear": "Rok temu",

View File

@ -1,6 +1,7 @@
{
"@@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.",
"torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network",
@ -148,7 +149,7 @@
"newPassword": "New Password",
"yesLeave": "Yes, Leave This Conversation",
"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:",
"titleManageServers": "Manage Servers",
"dateNever": "Never",

View File

@ -1,6 +1,7 @@
{
"@@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.",
"torSettingsEnableCache": "Cache Tor Consensus",
"labelTorNetwork": "Tor Network",
@ -164,7 +165,7 @@
"newPassword": "Новый пароль",
"yesLeave": "Да, оставить этот чат",
"reallyLeaveThisGroupPrompt": "Вы уверены, что хотите закончить этот разговор? Все сообщения будут удалены.",
"leaveGroup": "Да, оставить этот чат",
"leaveConversation": "Да, оставить этот чат",
"inviteToGroup": "Вас пригласили присоединиться к группе:",
"titleManageServers": "Управление серверами",
"dateNever": "Никогда",

View File

@ -91,9 +91,10 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty,
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
MouseRegion(
cursor: SystemMouseCursors.click,
cursor: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? SystemMouseCursors.click : SystemMouseCursors.basic,
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
: () {
filesharing.showFilePicker(context, MaxImageFileSharingSize, (File file) {
@ -113,6 +114,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
child: ProfileImage(
imagePath: Provider.of<ProfileInfoState>(context).imagePath,
diameter: 120,
tooltip: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? AppLocalizations.of(context)!.tooltipSelectACustomProfileImage : "",
maskOut: false,
border: theme.theme.portraitOnlineBorderColor,
badgeTextColor: Colors.red,

View File

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