Skip to content

Commit

Permalink
Add new showAdvancedUI setting
Browse files Browse the repository at this point in the history
This will allow us to hide some settings and other UI elements for
non-advanced users.
  • Loading branch information
tmolitor-stud-tu committed Sep 26, 2024
1 parent 0e17839 commit cd602a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Monal/Classes/GeneralSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class GeneralSettingsDefaultsDB: ObservableObject {

@defaultsDB("hardlinkFiletransfersIntoDocuments")
var hardlinkFiletransfersIntoDocuments: Bool

@defaultsDB("showAdvancedUI")
var showAdvancedUI: Bool
}


Expand Down Expand Up @@ -235,6 +238,10 @@ struct UserInterfaceSettings: View {
.font(.footnote)
.fixedSize(horizontal: false, vertical: true)
}
SettingsToggle(isOn: $generalSettingsDefaultsDB.showAdvancedUI) {
Text("Show advanced options in UI")
Text("Show power-user options in settings and other parts of the user interface.")
}
}
}
.navigationBarTitle(Text("User Interface"), displayMode: .inline)
Expand Down Expand Up @@ -280,17 +287,18 @@ struct SecuritySettings: View {
Text("Every new contact will have encryption enabled, but already known contacts will preserve their encryption settings.")
}

SettingsToggle(isOn: $generalSettingsDefaultsDB.useDnssecForAllConnections) {
Text("Use DNSSEC validation for all connections")
Text(
if generalSettingsDefaultsDB.showAdvancedUI {
SettingsToggle(isOn: $generalSettingsDefaultsDB.useDnssecForAllConnections) {
Text("Use DNSSEC validation for all connections")
Text(
"""
Use DNSSEC to validate all DNS query responses before connecting to the IP address designated \
in the DNS response.\n\
While being more secure, this can lead to connection problems in certain networks \
like hotel wifi, ugly mobile carriers etc.
"""
)
}
)
}

SettingsToggle(isOn: $generalSettingsDefaultsDB.webrtcAllowP2P) {
Text("Calls: Allow P2P sessions")
Expand Down Expand Up @@ -399,7 +407,7 @@ struct PrivacySettingsSubview: View {
#if !IS_QUICKSY
SettingsToggle(isOn: $generalSettingsDefaultsDB.webrtcUseFallbackTurn) {
Text("Calls: Allow TURN fallback to Monal-Servers")
Text("This will make calls possible even if your XMPP server does not provide a TURN server.")
Text("This will make calls possible even if your XMPP server does not provide a TURN server, but leaks your IP to Monal's servers if your XMPP server does not provide a TURN server.")
}
#endif
}
Expand Down
2 changes: 2 additions & 0 deletions Monal/Classes/MLXMPPManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ -(void) defaultSettings

[self upgradeBoolUserSettingsIfUnset:@"hardlinkFiletransfersIntoDocuments" toDefault:YES];

[self upgradeBoolUserSettingsIfUnset:@"showAdvancedUI" toDefault:NO];

// //always show onboarding on simulator for now
// #if TARGET_OS_SIMULATOR
// [[HelperTools defaultsDB] setBool:NO forKey:@"hasCompletedOnboarding"];
Expand Down

0 comments on commit cd602a1

Please sign in to comment.