Make splash scren stateful; add translations; add message and progress bar for storage migration

This commit is contained in:
Dan Ballard 2021-12-17 18:23:18 -05:00
parent 6ba447f941
commit 6adea075e7
11 changed files with 104 additions and 57 deletions

View File

@ -374,6 +374,12 @@ class CwtchNotifier {
break;
case "ImportingProfileEvent":
break;
case "StartingStorageMigration":
appState.SetModalState(ModalState.storageMigration);
break;
case "DoneStorageMigration":
appState.SetModalState(ModalState.none);
break;
default:
EnvironmentConfig.debugLog("unhandled event: $type");
}

View File

@ -1,6 +1,8 @@
{
"@@locale": "de",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",

View File

@ -1,6 +1,8 @@
{
"@@locale": "en",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",

View File

@ -1,6 +1,8 @@
{
"@@locale": "es",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",

View File

@ -1,21 +1,23 @@
{
"@@locale": "fr",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",
"themeNameMidnight": "Midnight",
"themeNameMermaid": "Mermaid",
"themeNamePumpkin": "Pumpkin",
"themeNameGhost": "Ghost",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"experimentClickableLinksDescription": "L'expérience des liens cliquables vous permet de cliquer sur les URLs partagés dans les messages",
"themeNameWitch": "Sorcière",
"themeNameVampire": "Vampire",
"themeNameWitch": "Witch",
"themeNamePumpkin": "Citrouille",
"themeNameNeon2": "Néon2",
"themeNameNeon1": "Néon1",
"themeNameMidnight": "Minuit",
"themeNameMermaid": "Sirène",
"themeNameGhost": "Fantôme",
"themeNameCwtch": "Cwtch",
"settingDownloadFolder": "Download Folder",
"settingImagePreviewsDescription": "Images will be downloaded and previewed automatically. Please note that image previews can often lead to security vulnerabilities, and you should not enable this Experiment if you use Cwtch with untrusted contacts. Profile pictures are planned for Cwtch 1.6.",
"settingImagePreviews": "Image Previews and Profile Pictures",
"experimentClickableLinksDescription": "The clickable links experiment allows you to click on URLs shared in messages",
"enableExperimentClickableLinks": "Enable Clickable Links",
"themeColorLabel": "Thème de couleur",
"settingImagePreviewsDescription": "Les images seront téléchargées et prévisualisées automatiquement. Veuillez noter que la prévisualisation des images peut souvent conduire à des failles de sécurité, et vous ne devriez pas activer cette expérience si vous utilisez Cwtch avec des contacts non fiables. Les images de profil sont prévues pour Cwtch 1.6.",
"settingImagePreviews": "Aperçu des images et photos de profil",
"settingDownloadFolder": "Dossier de téléchargement",
"enableExperimentClickableLinks": "Activer les liens cliquables",
"serverMetricsLabel": "Métriques du serveur",
"serverTotalMessagesLabel": "Nombre total de messages",
"serverConnectionsLabel": "Connexion",
@ -279,4 +281,4 @@
"newBulletinLabel": "Nouveau bulletin",
"createGroupBtn": "Créer",
"createGroupTitle": "Créer un groupe"
}
}

View File

@ -1,6 +1,8 @@
{
"@@locale": "it",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",

View File

@ -1,6 +1,8 @@
{
"@@locale": "pl",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",

View File

@ -1,6 +1,8 @@
{
"@@locale": "pt",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",

View File

@ -1,36 +1,40 @@
{
"@@locale": "ru",
"@@last_modified": "2021-12-15T20:46:48+01:00",
"themeColorLabel": "Color Theme",
"themeNameNeon2": "Neon2",
"themeNameNeon1": "Neon1",
"themeNameMidnight": "Midnight",
"themeNameMermaid": "Mermaid",
"themeNamePumpkin": "Pumpkin",
"themeNameGhost": "Ghost",
"themeNameVampire": "Vampire",
"themeNameWitch": "Witch",
"@@last_modified": "2021-12-17T23:48:01+01:00",
"storageMigrationModalMessage": "Migrating profiles to new storage format. This could take a few minutes...",
"loadingCwtch": "Loading Cwtch...",
"themeColorLabel": "Тема",
"themeNameNeon2": "Неон2",
"themeNameNeon1": "Неон1",
"themeNameMidnight": "Полночь",
"themeNameMermaid": "Русалка",
"themeNamePumpkin": "Тыква",
"themeNameGhost": "Призрак",
"themeNameVampire": "Вампир",
"themeNameWitch": "Ведьма",
"themeNameCwtch": "Cwtch",
"settingDownloadFolder": "Download Folder",
"settingImagePreviewsDescription": "Images will be downloaded and previewed automatically. Please note that image previews can often lead to security vulnerabilities, and you should not enable this Experiment if you use Cwtch with untrusted contacts. Profile pictures are planned for Cwtch 1.6.",
"settingImagePreviews": "Image Previews and Profile Pictures",
"experimentClickableLinksDescription": "The clickable links experiment allows you to click on URLs shared in messages",
"enableExperimentClickableLinks": "Enable Clickable Links",
"serverConnectionsLabel": "Connection",
"serverTotalMessagesLabel": "Total Messages",
"serverMetricsLabel": "Server Metrics",
"saveBtn": "Сохранить",
"settingDownloadFolder": "Скачать папку",
"settingImagePreviewsDescription": "Автоматическая загрузка изображений. Обратите внимание, что предварительный просмотр изображений часто может использоваться для взлома или деаномизации. Не используйте данную функцию если Вы контактируете с ненадежными контактами. Аватары профиля запланированы для версии Cwtch 1.6.",
"settingImagePreviews": "Предпросмотр изображений и фотографий профиля",
"experimentClickableLinksDescription": "Экспериментальная функция которая позволяет нажимать на URL адреса в сообщениях",
"enableExperimentClickableLinks": "Включить кликабельные ссылки",
"serverConnectionsLabel": "Соединение",
"serverTotalMessagesLabel": "Всего сообщений",
"serverMetricsLabel": "Показатели сервера",
"manageKnownServersShort": "Серверы",
"manageKnownServersLong": "Управление серверами",
"displayNameTooltip": "Введите отображаемое имя",
"manageKnownServersButton": "Управление серверами",
"fieldDescriptionLabel": "Описание",
"groupsOnThisServerLabel": "Группы, в которых я нахожусь, размещены на этом сервере",
"importLocalServerButton": "Импорт %1",
"importLocalServerSelectText": "Выбрать локальный сервер",
"importLocalServerLabel": "Импортировать локальный сервер",
"newMessagesLabel": "Новое сообщение",
"localeRU": "Русский",
"profileOnionLabel": "Send this address to contacts you want to connect with",
"manageKnownServersShort": "Servers",
"manageKnownServersLong": "Manage Known Servers",
"displayNameTooltip": "Please enter a display name",
"manageKnownServersButton": "Manage Known Servers",
"fieldDescriptionLabel": "Description",
"groupsOnThisServerLabel": "Groups I am in hosted on this server",
"importLocalServerButton": "Import %1",
"importLocalServerSelectText": "Select Local Server",
"importLocalServerLabel": "Import a locally hosted server",
"newMessagesLabel": "New Messages",
"savePeerHistory": "Хранить историю",
"saveBtn": "Сохранить",
"networkStatusOnline": "В сети",
"copiedToClipboardNotification": "Скопировано в буфер обмена",
"defaultProfileName": "Алиса",
@ -39,7 +43,6 @@
"groupNameLabel": "Имя группы",
"serverLabel": "Сервер",
"copyBtn": "Копировать",
"localeRU": "Russian",
"copyServerKeys": "Копировать ключи",
"verfiyResumeButton": "Проверить\/продолжить",
"fileCheckingStatus": "Проверка статуса загрузки",
@ -220,7 +223,6 @@
"unblockBtn": "Разблокировать контакт",
"dontSavePeerHistory": "Удалить историю",
"savePeerHistoryDescription": "Определяет политуку хранения или удаления переписки с данным контактом.",
"savePeerHistory": "Хранить исторую",
"blockBtn": "Заблокировать контакт",
"displayNameLabel": "Отображаемое имя",
"addressLabel": "Адрес",

View File

@ -53,6 +53,11 @@ class AppState extends ChangeNotifier {
notifyListeners();
}
void SetModalState(ModalState newState) {
modalState = newState;
notifyListeners();
}
String? get selectedProfile => _selectedProfile;
set selectedProfile(String? newVal) {
this._selectedProfile = newVal;

View File

@ -1,11 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../model.dart';
import '../settings.dart';
class SplashView extends StatelessWidget {
class SplashView extends StatefulWidget {
@override
_SplashViewState createState() => _SplashViewState();
}
class _SplashViewState extends State<SplashView> {
@override
Widget build(BuildContext context) {
return Consumer<AppState>(
@ -25,10 +31,24 @@ class SplashView extends StatelessWidget {
isAntiAlias: true,
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Text(appState.appError == "" ? "Loading Cwtch..." : appState.appError,
style: TextStyle(fontSize: 16.0, color: appState.appError == "" ? Provider.of<Settings>(context).theme.mainTextColor : Provider.of<Settings>(context).theme.textfieldErrorColor)),
),
padding: const EdgeInsets.all(20.0),
child: Column(children: [
Padding(
padding: EdgeInsets.all(6.0),
child: Text(
appState.appError != ""
? appState.appError
: appState.modalState == ModalState.none
? AppLocalizations.of(context)!.loadingCwtch
: AppLocalizations.of(context)!.storageMigrationModalMessage,
style: TextStyle(
fontSize: 16.0, color: appState.appError == "" ? Provider.of<Settings>(context).theme.mainTextColor : Provider.of<Settings>(context).theme.textfieldErrorColor))),
Visibility(
visible: appState.modalState == ModalState.storageMigration,
child: LinearProgressIndicator(
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor,
))
])),
Image(image: AssetImage("assets/Open_Privacy_Logo_lightoutline.png")),
])),
));