buildin options and add to mobile (#8759)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-07-19 23:55:52 +08:00 committed by GitHub
parent 85ded0a3e5
commit 2b54a553c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 114 additions and 38 deletions

View file

@ -86,6 +86,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
var _autoDisconnectTimeout = "";
var _hideServer = false;
var _hideProxy = false;
var _hideNetwork = false;
@override
void initState() {
@ -112,8 +113,11 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
bind.mainGetOptionSync(key: kOptionAllowAutoDisconnect));
_autoDisconnectTimeout =
bind.mainGetOptionSync(key: kOptionAutoDisconnectTimeout);
_hideServer = bind.mainGetLocalOption(key: kOptionHideServerSetting) == 'Y';
_hideProxy = bind.mainGetLocalOption(key: kOptionHideProxySetting) == 'Y';
_hideServer =
bind.mainGetBuildinOption(key: kOptionHideServerSetting) == 'Y';
_hideProxy = bind.mainGetBuildinOption(key: kOptionHideProxySetting) == 'Y';
_hideNetwork =
bind.mainGetBuildinOption(key: kOptionHideNetworkSetting) == 'Y';
() async {
var update = false;
@ -535,6 +539,8 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
));
final disabledSettings = bind.isDisableSettings();
final hideSecuritySettings =
bind.mainGetBuildinOption(key: kOptionHideSecuritySetting) == 'Y';
final settings = SettingsList(
sections: [
customClientSection,
@ -558,14 +564,14 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
],
),
SettingsSection(title: Text(translate("Settings")), tiles: [
if (!disabledSettings && !_hideServer)
if (!disabledSettings && !_hideNetwork && !_hideServer)
SettingsTile(
title: Text(translate('ID/Relay Server')),
leading: Icon(Icons.cloud),
onPressed: (context) {
showServerSettings(gFFI.dialogManager);
}),
if (!isIOS && !_hideProxy)
if (!isIOS && !_hideNetwork && !_hideProxy)
SettingsTile(
title: Text(translate('Socks5/Http(s) Proxy')),
leading: Icon(Icons.network_ping),
@ -637,13 +643,19 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
),
],
),
if (isAndroid && !disabledSettings && !outgoingOnly)
if (isAndroid &&
!disabledSettings &&
!outgoingOnly &&
!hideSecuritySettings)
SettingsSection(
title: Text(translate("Share Screen")),
tiles: shareScreenTiles,
),
if (!bind.isIncomingOnly()) defaultDisplaySection(),
if (isAndroid && !disabledSettings && !outgoingOnly)
if (isAndroid &&
!disabledSettings &&
!outgoingOnly &&
!hideSecuritySettings)
SettingsSection(
title: Text(translate("Enhancements")),
tiles: enhancementsTiles,