2023-02-15 08:27:18 +00:00
|
|
|
import QtQuick 2.15
|
2021-12-14 18:47:32 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var advancedModule
|
2023-10-03 13:30:42 +00:00
|
|
|
property var walletModule
|
2024-03-20 17:29:45 +00:00
|
|
|
property var networksModuleInst: networksModule
|
2021-12-14 18:47:32 +00:00
|
|
|
|
|
|
|
// Advanced Module Properties
|
2022-01-11 23:16:17 +00:00
|
|
|
property string fleet: advancedModule? advancedModule.fleet : ""
|
|
|
|
property bool wakuV2LightClientEnabled: advancedModule? advancedModule.wakuV2LightClientEnabled : false
|
|
|
|
property bool isTelemetryEnabled: advancedModule? advancedModule.isTelemetryEnabled : false
|
|
|
|
property bool isAutoMessageEnabled: advancedModule? advancedModule.isAutoMessageEnabled : false
|
2024-02-20 19:07:22 +00:00
|
|
|
property bool isNimbusProxyEnabled: advancedModule? advancedModule.isNimbusProxyEnabled : false
|
2022-01-11 23:16:17 +00:00
|
|
|
property bool isDebugEnabled: advancedModule? advancedModule.isDebugEnabled : false
|
2023-09-25 16:18:22 +00:00
|
|
|
readonly property bool isWakuV2ShardedCommunitiesEnabled: localAppSettings.wakuV2ShardedCommunitiesEnabled ?? false
|
2023-05-08 20:00:32 +00:00
|
|
|
property int logMaxBackups: advancedModule ? advancedModule.logMaxBackups : 1
|
2024-02-05 17:11:27 +00:00
|
|
|
property bool isRuntimeLogLevelSet: advancedModule ? advancedModule.isRuntimeLogLevelSet: false
|
2024-04-29 20:37:22 +00:00
|
|
|
readonly property bool archiveProtocolEnabled: advancedModule ? advancedModule.archiveProtocolEnabled : false
|
2024-07-19 18:45:40 +00:00
|
|
|
readonly property bool ensCommunityPermissionsEnabled: localAccountSensitiveSettings.ensCommunityPermissionsEnabled
|
2021-12-14 18:47:32 +00:00
|
|
|
|
2022-01-11 23:16:17 +00:00
|
|
|
property var customNetworksModel: advancedModule? advancedModule.customNetworksModel : []
|
2021-12-16 10:33:27 +00:00
|
|
|
|
2023-02-15 08:27:18 +00:00
|
|
|
readonly property bool isFakeLoadingScreenEnabled: localAppSettings.fakeLoadingScreenEnabled ?? false
|
2024-04-29 18:35:44 +00:00
|
|
|
readonly property bool createCommunityEnabled: localAppSettings.createCommunityEnabled ?? false
|
2023-10-10 10:31:45 +00:00
|
|
|
property bool isManageCommunityOnTestModeEnabled: false
|
2021-12-24 08:24:26 +00:00
|
|
|
readonly property QtObject experimentalFeatures: QtObject {
|
|
|
|
readonly property string browser: "browser"
|
|
|
|
readonly property string communities: "communities"
|
|
|
|
readonly property string activityCenter: "activityCenter"
|
|
|
|
readonly property string nodeManagement: "nodeManagement"
|
|
|
|
readonly property string onlineUsers: "onlineUsers"
|
2022-05-23 13:11:30 +00:00
|
|
|
readonly property string communitiesPortal: "communitiesPortal"
|
2022-06-09 15:27:14 +00:00
|
|
|
readonly property string communityPermissions: "communityPermissions"
|
2022-08-18 14:25:06 +00:00
|
|
|
readonly property string discordImportTool: "discordImportTool"
|
2023-01-09 12:51:31 +00:00
|
|
|
readonly property string communityTokens: "communityTokens"
|
2021-12-24 08:24:26 +00:00
|
|
|
}
|
|
|
|
|
2023-04-07 15:06:41 +00:00
|
|
|
readonly property bool isCustomScrollingEnabled: localAppSettings.isCustomMouseScrollingEnabled ?? false
|
|
|
|
readonly property real scrollVelocity: localAppSettings.scrollVelocity
|
|
|
|
readonly property real scrollDeceleration: localAppSettings.scrollDeceleration
|
|
|
|
|
2024-05-21 08:53:33 +00:00
|
|
|
readonly property bool refreshTokenEnabled: localAppSettings.refreshTokenEnabled ?? false
|
|
|
|
|
2024-03-20 17:29:45 +00:00
|
|
|
readonly property bool isGoerliEnabled: networksModuleInst.isGoerliEnabled
|
2023-10-03 13:30:42 +00:00
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
function logDir() {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return ""
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
return root.advancedModule.logDir()
|
|
|
|
}
|
|
|
|
|
|
|
|
function setNetworkName(networkName) {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
root.advancedModule.setNetworkName(networkName)
|
|
|
|
}
|
|
|
|
|
|
|
|
function setFleet(fleetName) {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
root.advancedModule.setFleet(fleetName)
|
|
|
|
}
|
|
|
|
|
|
|
|
function setWakuV2LightClientEnabled(mode) {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
root.advancedModule.setWakuV2LightClientEnabled(mode)
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleTelemetry() {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
root.advancedModule.toggleTelemetry()
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleAutoMessage() {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
root.advancedModule.toggleAutoMessage()
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleDebug() {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
root.advancedModule.toggleDebug()
|
|
|
|
}
|
2021-12-16 10:33:27 +00:00
|
|
|
|
2024-02-20 19:07:22 +00:00
|
|
|
function toggleNimbusProxy() {
|
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
|
|
|
root.advancedModule.toggleNimbusProxy()
|
|
|
|
}
|
|
|
|
|
2023-05-08 20:00:32 +00:00
|
|
|
function setMaxLogBackups(value) {
|
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
|
|
|
root.advancedModule.setMaxLogBackups(value)
|
|
|
|
}
|
|
|
|
|
2022-02-02 22:06:23 +00:00
|
|
|
function enableDeveloperFeatures() {
|
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
|
|
|
root.advancedModule.enableDeveloperFeatures()
|
|
|
|
}
|
|
|
|
|
2021-12-24 08:24:26 +00:00
|
|
|
function toggleExperimentalFeature(feature) {
|
2022-01-11 23:16:17 +00:00
|
|
|
if(!root.advancedModule)
|
|
|
|
return
|
|
|
|
|
2023-03-14 09:43:51 +00:00
|
|
|
if (feature === experimentalFeatures.browser) {
|
2021-12-24 08:24:26 +00:00
|
|
|
advancedModule.toggleBrowserSection()
|
|
|
|
}
|
|
|
|
else if (feature === experimentalFeatures.communities) {
|
|
|
|
advancedModule.toggleCommunitySection()
|
|
|
|
}
|
2022-05-23 13:11:30 +00:00
|
|
|
else if (feature === experimentalFeatures.communitiesPortal) {
|
|
|
|
advancedModule.toggleCommunitiesPortalSection()
|
|
|
|
}
|
2021-12-24 08:24:26 +00:00
|
|
|
else if (feature === experimentalFeatures.activityCenter) {
|
|
|
|
localAccountSensitiveSettings.isActivityCenterEnabled = !localAccountSensitiveSettings.isActivityCenterEnabled
|
|
|
|
}
|
|
|
|
else if (feature === experimentalFeatures.nodeManagement) {
|
|
|
|
advancedModule.toggleNodeManagementSection()
|
|
|
|
}
|
|
|
|
else if (feature === experimentalFeatures.onlineUsers) {
|
|
|
|
localAccountSensitiveSettings.showOnlineUsers = !localAccountSensitiveSettings.showOnlineUsers
|
|
|
|
}
|
|
|
|
}
|
2023-02-15 08:27:18 +00:00
|
|
|
|
|
|
|
function toggleFakeLoadingScreen() {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
|
|
|
|
localAppSettings.fakeLoadingScreenEnabled = !localAppSettings.fakeLoadingScreenEnabled
|
|
|
|
}
|
2023-04-07 15:06:41 +00:00
|
|
|
|
2024-04-29 18:35:44 +00:00
|
|
|
function toggleCreateCommunityEnabled() {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
|
|
|
|
localAppSettings.createCommunityEnabled = !localAppSettings.createCommunityEnabled
|
|
|
|
}
|
|
|
|
|
2024-04-29 20:37:22 +00:00
|
|
|
function toggleArchiveProtocolEnabled() {
|
|
|
|
if(!advancedModule)
|
|
|
|
return
|
|
|
|
|
|
|
|
if (root.archiveProtocolEnabled) {
|
|
|
|
advancedModule.disableCommunityHistoryArchiveSupport()
|
|
|
|
} else {
|
|
|
|
advancedModule.enableCommunityHistoryArchiveSupport()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-19 18:45:40 +00:00
|
|
|
function toggleEnsCommunityPermissionsEnabled() {
|
|
|
|
localAccountSensitiveSettings.ensCommunityPermissionsEnabled = !root.ensCommunityPermissionsEnabled
|
|
|
|
}
|
|
|
|
|
2023-10-10 10:31:45 +00:00
|
|
|
function toggleManageCommunityOnTestnet() {
|
|
|
|
root.isManageCommunityOnTestModeEnabled = !root.isManageCommunityOnTestModeEnabled
|
|
|
|
}
|
|
|
|
|
2023-09-25 16:18:22 +00:00
|
|
|
function toggleWakuV2ShardedCommunities() {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
|
|
|
|
localAppSettings.wakuV2ShardedCommunitiesEnabled = !localAppSettings.wakuV2ShardedCommunitiesEnabled
|
|
|
|
}
|
|
|
|
|
2024-05-21 08:53:33 +00:00
|
|
|
function toggleRefreshTokenEnabled() {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
localAppSettings.refreshTokenEnabled = !localAppSettings.refreshTokenEnabled
|
|
|
|
}
|
|
|
|
|
2023-04-07 15:06:41 +00:00
|
|
|
function setCustomScrollingEnabled(value) {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
|
|
|
|
localAppSettings.isCustomMouseScrollingEnabled = value
|
|
|
|
}
|
|
|
|
|
|
|
|
function setScrollVelocity(value) {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
|
|
|
|
localAppSettings.scrollVelocity = value
|
|
|
|
}
|
|
|
|
|
|
|
|
function setScrollDeceleration(value) {
|
|
|
|
if(!localAppSettings)
|
|
|
|
return
|
|
|
|
|
|
|
|
localAppSettings.scrollDeceleration = value
|
|
|
|
}
|
2023-10-03 13:30:42 +00:00
|
|
|
|
2024-02-20 09:31:04 +00:00
|
|
|
function toggleIsGoerliEnabled(){
|
|
|
|
networksModule.toggleIsGoerliEnabled()
|
2023-10-03 13:30:42 +00:00
|
|
|
}
|
|
|
|
|
2021-12-14 18:47:32 +00:00
|
|
|
}
|