Merge pull request 'lcgVBump and restrict mobile on servers' (#228) from lcgVBump into trunk

Reviewed-on: cwtch.im/cwtch-ui#228
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2021-11-03 20:17:29 +00:00
commit 07b00ee1d0
3 changed files with 24 additions and 20 deletions

View File

@ -1 +1 @@
v1.3.1-17-gbaddf63-2021-11-02-19-11 v1.3.1-23-gb47b270-2021-11-03-19-29

View File

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:cwtch/cwtch_icons_icons.dart';
import 'package:cwtch/models/servers.dart'; import 'package:cwtch/models/servers.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
@ -189,24 +190,27 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
inactiveTrackColor: settings.theme.defaultButtonDisabledColor(), inactiveTrackColor: settings.theme.defaultButtonDisabledColor(),
secondary: Icon(CwtchIcons.enable_groups, color: settings.current().mainTextColor()), secondary: Icon(CwtchIcons.enable_groups, color: settings.current().mainTextColor()),
), ),
SwitchListTile( Visibility(
title: Text(AppLocalizations.of(context)!.settingServers, style: TextStyle(color: settings.current().mainTextColor())), visible: !Platform.isAndroid && !Platform.isIOS,
subtitle: Text(AppLocalizations.of(context)!.settingServersDescription), child:
value: settings.isExperimentEnabled(ServerManagementExperiment), SwitchListTile(
onChanged: (bool value) { title: Text(AppLocalizations.of(context)!.settingServers, style: TextStyle(color: settings.current().mainTextColor())),
Provider.of<ServerListState>(context, listen: false).clear(); subtitle: Text(AppLocalizations.of(context)!.settingServersDescription),
if (value) { value: settings.isExperimentEnabled(ServerManagementExperiment),
settings.enableExperiment(ServerManagementExperiment); onChanged: (bool value) {
} else { Provider.of<ServerListState>(context, listen: false).clear();
settings.disableExperiment(ServerManagementExperiment); if (value) {
} settings.enableExperiment(ServerManagementExperiment);
// Save Settings... } else {
saveSettings(context); settings.disableExperiment(ServerManagementExperiment);
}, }
activeTrackColor: settings.theme.defaultButtonActiveColor(), // Save Settings...
inactiveTrackColor: settings.theme.defaultButtonDisabledColor(), saveSettings(context);
secondary: Icon(CwtchIcons.dns_24px, color: settings.current().mainTextColor()), },
), activeTrackColor: settings.theme.defaultButtonActiveColor(),
inactiveTrackColor: settings.theme.defaultButtonDisabledColor(),
secondary: Icon(CwtchIcons.dns_24px, color: settings.current().mainTextColor()),
)),
SwitchListTile( SwitchListTile(
title: Text(AppLocalizations.of(context)!.settingFileSharing, style: TextStyle(color: settings.current().mainTextColor())), title: Text(AppLocalizations.of(context)!.settingFileSharing, style: TextStyle(color: settings.current().mainTextColor())),
subtitle: Text(AppLocalizations.of(context)!.descriptionFileSharing), subtitle: Text(AppLocalizations.of(context)!.descriptionFileSharing),

View File

@ -99,7 +99,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
)); ));
// Servers // Servers
if (Provider.of<Settings>(context).isExperimentEnabled(ServerManagementExperiment)) { if (Provider.of<Settings>(context).isExperimentEnabled(ServerManagementExperiment) && !Platform.isAndroid && !Platform.isIOS) {
actions.add(IconButton(icon: Icon(CwtchIcons.dns_black_24dp), tooltip: AppLocalizations.of(context)!.serversManagerTitleShort, onPressed: _pushServers)); actions.add(IconButton(icon: Icon(CwtchIcons.dns_black_24dp), tooltip: AppLocalizations.of(context)!.serversManagerTitleShort, onPressed: _pushServers));
} }