From a6b8fbe4b3487efacb24f1afc2e21f7ab1f20a40 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Fri, 24 Dec 2021 09:24:26 +0100 Subject: [PATCH] refactor(@desktop/settings-advanced): hook to the toggled experimental features from the advanced tab added --- src/app/global/app_signals.nim | 11 ++++ src/app/modules/main/controller.nim | 15 ++---- src/app/modules/main/module.nim | 27 ++++++++-- .../module_controller_delegate_interface.nim | 5 +- .../profile_section/advanced/controller.nim | 22 +++++++- .../advanced/controller_interface.nim | 14 ++++- .../main/profile_section/advanced/module.nim | 21 ++++++-- .../module_view_delegate_interface.nim | 14 ++++- .../main/profile_section/advanced/view.nim | 14 ++++- .../modules/main/profile_section/module.nim | 2 +- src/app/modules/main/view.nim | 10 ---- .../modules/shared_models/section_model.nim | 6 +++ .../Profile/stores/AdvancedStore.qml | 38 ++++++++++++++ .../AppLayouts/Profile/views/AdvancedView.qml | 52 ++++++------------- ui/app/AppMain.qml | 6 +++ 15 files changed, 184 insertions(+), 73 deletions(-) create mode 100644 src/app/global/app_signals.nim diff --git a/src/app/global/app_signals.nim b/src/app/global/app_signals.nim new file mode 100644 index 0000000000..7c0b80dac0 --- /dev/null +++ b/src/app/global/app_signals.nim @@ -0,0 +1,11 @@ +from ../modules/shared_models/section_item import SectionType + +import eventemitter + +export SectionType + +type + ToggleSectionArgs* = ref object of Args + sectionType*: SectionType + +const TOGGLE_SECTION* = "toggleSection" \ No newline at end of file diff --git a/src/app/modules/main/controller.nim b/src/app/modules/main/controller.nim index c2f0a1184f..49b66c9c82 100644 --- a/src/app/modules/main/controller.nim +++ b/src/app/modules/main/controller.nim @@ -1,6 +1,6 @@ import ../shared_models/section_item, controller_interface, io_interface, chronicles import ../../global/global_singleton - +import ../../global/app_signals import ../../../app_service/service/settings/service_interface as settings_service import ../../../app_service/service/keychain/service as keychain_service import ../../../app_service/service/accounts/service_interface as accounts_service @@ -87,16 +87,9 @@ method init*(self: Controller) = self.messageService ) - self.events.on("sectionAvailabilityChanged") do(e:Args): - ## We will receive here a signal with two fields: - ## sectionType: int - ## enabled: bool - ## - ## Then we only need to do something like: - ## if(enabled): - ## self.delegate.enableSection(sectionType) - ## else: - ## self.delegate.disableSection(sectionType) + self.events.on(TOGGLE_SECTION) do(e:Args): + let args = ToggleSectionArgs(e) + self.delegate.toggleSection(args.sectionType) discard method getJoinedCommunities*(self: Controller): seq[CommunityDto] = diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index 748f5bffd5..9e9ee66dfe 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -2,6 +2,7 @@ import NimQml, Tables import io_interface, view, controller, ../shared_models/section_item, ../shared_models/section_model import ../../global/app_sections_config as conf +import ../../global/app_signals import ../../global/global_singleton import chat_section/module as chat_section_module @@ -415,11 +416,29 @@ method activeSectionSet*[T](self: Module[T], sectionId: string) = self.notifySubModulesAboutChange(sectionId) -method enableSection*[T](self: Module[T], sectionType: SectionType) = - self.view.model().enableSection(sectionType) +proc setSectionAvailability[T](self: Module[T], sectionType: SectionType, available: bool) = + if(available): + self.view.model().enableSection(sectionType) + else: + self.view.model().disableSection(sectionType) -method disableSection*[T](self: Module[T], sectionType: SectionType) = - self.view.disableSection(sectionType) +method toggleSection*[T](self: Module[T], sectionType: SectionType) = + if (sectionType == SectionType.Wallet): + let enabled = singletonInstance.localAccountSensitiveSettings.getIsWalletEnabled() + self.setSectionAvailability(sectionType, not enabled) + singletonInstance.localAccountSensitiveSettings.setIsWalletEnabled(not enabled) + elif (sectionType == SectionType.Browser): + let enabled = singletonInstance.localAccountSensitiveSettings.getIsBrowserEnabled() + self.setSectionAvailability(sectionType, not enabled) + singletonInstance.localAccountSensitiveSettings.setIsBrowserEnabled(not enabled) + elif (sectionType == SectionType.Community): + let enabled = singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled() + self.setSectionAvailability(sectionType, not enabled) + singletonInstance.localAccountSensitiveSettings.setCommunitiesEnabled(not enabled) + elif (sectionType == SectionType.NodeManagement): + let enabled = singletonInstance.localAccountSensitiveSettings.getNodeManagementEnabled() + self.setSectionAvailability(sectionType, not enabled) + singletonInstance.localAccountSensitiveSettings.setNodeManagementEnabled(not enabled) method setUserStatus*[T](self: Module[T], status: bool) = self.controller.setUserStatus(status) diff --git a/src/app/modules/main/private_interfaces/module_controller_delegate_interface.nim b/src/app/modules/main/private_interfaces/module_controller_delegate_interface.nim index 166ba4ae60..696bb27a36 100644 --- a/src/app/modules/main/private_interfaces/module_controller_delegate_interface.nim +++ b/src/app/modules/main/private_interfaces/module_controller_delegate_interface.nim @@ -12,10 +12,7 @@ method emitStoringPasswordSuccess*(self: AccessInterface) {.base.} = method activeSectionSet*(self: AccessInterface, sectionId: string) {.base.} = raise newException(ValueError, "No implementation available") -method enableSection*(self: AccessInterface, sectionType: SectionType) {.base.} = - raise newException(ValueError, "No implementation available") - -method disableSection*(self: AccessInterface, sectionType: SectionType) {.base.} = +method toggleSection*(self: AccessInterface, sectionType: SectionType) {.base.} = raise newException(ValueError, "No implementation available") method communityJoined*(self: AccessInterface, community: CommunityDto, events: EventEmitter, diff --git a/src/app/modules/main/profile_section/advanced/controller.nim b/src/app/modules/main/profile_section/advanced/controller.nim index 32a0e58d47..236bcdf3b7 100644 --- a/src/app/modules/main/profile_section/advanced/controller.nim +++ b/src/app/modules/main/profile_section/advanced/controller.nim @@ -3,9 +3,12 @@ import controller_interface import io_interface import ../../../../core/fleets/fleet_configuration +import ../../../../global/app_signals import ../../../../../app_service/service/settings/service_interface as settings_service import ../../../../../app_service/service/node_configuration/service_interface as node_configuration_service +import eventemitter + export controller_interface logScope: @@ -14,13 +17,16 @@ logScope: type Controller* = ref object of controller_interface.AccessInterface delegate: io_interface.AccessInterface + events: EventEmitter settingsService: settings_service.ServiceInterface nodeConfigurationService: node_configuration_service.ServiceInterface -proc newController*(delegate: io_interface.AccessInterface, settingsService: settings_service.ServiceInterface, +proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter, + settingsService: settings_service.ServiceInterface, nodeConfigurationService: node_configuration_service.ServiceInterface): Controller = result = Controller() result.delegate = delegate + result.events = events result.settingsService = settingsService result.nodeConfigurationService = nodeConfigurationService @@ -146,4 +152,16 @@ method addCustomNetwork*(self: Controller, network: settings_service.Network) = error "an error occurred, we couldn't add a custom network" return - self.delegate.onCustomNetworkAdded(network) \ No newline at end of file + self.delegate.onCustomNetworkAdded(network) + +method toggleWalletSection*(self: Controller) = + self.events.emit(TOGGLE_SECTION, ToggleSectionArgs(sectionType: SectionType.Wallet)) + +method toggleBrowserSection*(self: Controller) = + self.events.emit(TOGGLE_SECTION, ToggleSectionArgs(sectionType: SectionType.Browser)) + +method toggleCommunitySection*(self: Controller) = + self.events.emit(TOGGLE_SECTION, ToggleSectionArgs(sectionType: SectionType.Community)) + +method toggleNodeManagementSection*(self: Controller) = + self.events.emit(TOGGLE_SECTION, ToggleSectionArgs(sectionType: SectionType.NodeManagement)) \ No newline at end of file diff --git a/src/app/modules/main/profile_section/advanced/controller_interface.nim b/src/app/modules/main/profile_section/advanced/controller_interface.nim index b4d59369c8..b49ec122ab 100644 --- a/src/app/modules/main/profile_section/advanced/controller_interface.nim +++ b/src/app/modules/main/profile_section/advanced/controller_interface.nim @@ -56,4 +56,16 @@ method getCustomNetworks*(self: AccessInterface): seq[settings_service_type.Netw raise newException(ValueError, "No implementation available") method addCustomNetwork*(self: AccessInterface, network: Network) {.base.} = - raise newException(ValueError, "No implementation available") \ No newline at end of file + raise newException(ValueError, "No implementation available") + +method toggleWalletSection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") + +method toggleBrowserSection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") + +method toggleCommunitySection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") + +method toggleNodeManagementSection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") \ No newline at end of file diff --git a/src/app/modules/main/profile_section/advanced/module.nim b/src/app/modules/main/profile_section/advanced/module.nim index 652385069c..e52b3cae71 100644 --- a/src/app/modules/main/profile_section/advanced/module.nim +++ b/src/app/modules/main/profile_section/advanced/module.nim @@ -8,6 +8,8 @@ import ../../../../global/global_singleton import ../../../../../app_service/service/settings/service_interface as settings_service import ../../../../../app_service/service/node_configuration/service_interface as node_configuration_service +import eventemitter + export io_interface logScope: @@ -21,13 +23,14 @@ type controller: controller.AccessInterface moduleLoaded: bool -proc newModule*(delegate: delegate_interface.AccessInterface, settingsService: settings_service.ServiceInterface, +proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, + settingsService: settings_service.ServiceInterface, nodeConfigurationService: node_configuration_service.ServiceInterface): Module = result = Module() result.delegate = delegate result.view = view.newView(result) result.viewVariant = newQVariant(result.view) - result.controller = controller.newController(result, settingsService, nodeConfigurationService) + result.controller = controller.newController(result, events, settingsService, nodeConfigurationService) result.moduleLoaded = false method delete*(self: Module) = @@ -139,4 +142,16 @@ method addCustomNetwork*(self: Module, name: string, endpoint: string, networkId self.controller.addCustomNetwork(network) method onCustomNetworkAdded*(self: Module, network: settings_service.Network) = - self.view.customNetworksModel().add(network.id, network.name) \ No newline at end of file + self.view.customNetworksModel().add(network.id, network.name) + +method toggleWalletSection*(self: Module) = + self.controller.toggleWalletSection() + +method toggleBrowserSection*(self: Module) = + self.controller.toggleBrowserSection() + +method toggleCommunitySection*(self: Module) = + self.controller.toggleCommunitySection() + +method toggleNodeManagementSection*(self: Module) = + self.controller.toggleNodeManagementSection() \ No newline at end of file diff --git a/src/app/modules/main/profile_section/advanced/private_interfaces/module_view_delegate_interface.nim b/src/app/modules/main/profile_section/advanced/private_interfaces/module_view_delegate_interface.nim index d61806c795..144c43a4cd 100644 --- a/src/app/modules/main/profile_section/advanced/private_interfaces/module_view_delegate_interface.nim +++ b/src/app/modules/main/profile_section/advanced/private_interfaces/module_view_delegate_interface.nim @@ -51,4 +51,16 @@ method toggleDebug*(self: AccessInterface) {.base.} = method addCustomNetwork*(self: AccessInterface, name: string, endpoint: string, networkId: int, networkType: string) {.slot.} = - raise newException(ValueError, "No implementation available") \ No newline at end of file + raise newException(ValueError, "No implementation available") + +method toggleWalletSection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") + +method toggleBrowserSection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") + +method toggleCommunitySection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") + +method toggleNodeManagementSection*(self: AccessInterface) {.base.} = + raise newException(ValueError, "No implementation available") \ No newline at end of file diff --git a/src/app/modules/main/profile_section/advanced/view.nim b/src/app/modules/main/profile_section/advanced/view.nim index d78a0d20fc..7bf3f33cb7 100644 --- a/src/app/modules/main/profile_section/advanced/view.nim +++ b/src/app/modules/main/profile_section/advanced/view.nim @@ -140,4 +140,16 @@ QtObject: notify = customNetworksModelChanged proc addCustomNetwork*(self: View, name: string, endpoint: string, networkId: int, networkType: string) {.slot.} = - self.delegate.addCustomNetwork(name, endpoint, networkId, networkType) \ No newline at end of file + self.delegate.addCustomNetwork(name, endpoint, networkId, networkType) + + proc toggleWalletSection*(self: View) {.slot.} = + self.delegate.toggleWalletSection() + + proc toggleBrowserSection*(self: View) {.slot.} = + self.delegate.toggleBrowserSection() + + proc toggleCommunitySection*(self: View) {.slot.} = + self.delegate.toggleCommunitySection() + + proc toggleNodeManagementSection*(self: View) {.slot.} = + self.delegate.toggleNodeManagementSection() \ No newline at end of file diff --git a/src/app/modules/main/profile_section/module.nim b/src/app/modules/main/profile_section/module.nim index 30f86a3f68..6c799a9aae 100644 --- a/src/app/modules/main/profile_section/module.nim +++ b/src/app/modules/main/profile_section/module.nim @@ -66,7 +66,7 @@ proc newModule*[T](delegate: T, result.mnemonicModule = mnemonic_module.newModule(result, mnemonicService) result.privacyModule = privacy_module.newModule(result, privacyService, accountsService) result.aboutModule = about_module.newModule(result, events, aboutService) - result.advancedModule = advanced_module.newModule(result, settingsService, nodeConfigurationService) + result.advancedModule = advanced_module.newModule(result, events, settingsService, nodeConfigurationService) singletonInstance.engine.setRootContextProperty("profileSectionModule", result.viewVariant) diff --git a/src/app/modules/main/view.nim b/src/app/modules/main/view.nim index 80fcb31471..d4098276c0 100644 --- a/src/app/modules/main/view.nim +++ b/src/app/modules/main/view.nim @@ -90,16 +90,6 @@ QtObject: let item = self.model.getItemBySectionType(sectionType.SectionType) self.delegate.setActiveSection(item) - proc enableSection*(self: View, sectionType: SectionType) = - # Since enable/disable section is possible only from the `Profile` tab, there is no need for setting - # `activeSection` in this moment, as it will be in any case set to `ProfileSettings` type. - self.model.enableSection(sectionType) - - proc disableSection*(self: View, sectionType: SectionType) = - # Since enable/disable section is possible only from the `Profile` tab, there is no need for setting - # `activeSection` in this moment, as it will be in any case set to `ProfileSettings` type. - self.model.disableSection(sectionType) - proc setUserStatus*(self: View, status: bool) {.slot.} = self.delegate.setUserStatus(status) diff --git a/src/app/modules/shared_models/section_model.nim b/src/app/modules/shared_models/section_model.nim index 4b05c16862..8c10700822 100644 --- a/src/app/modules/shared_models/section_model.nim +++ b/src/app/modules/shared_models/section_model.nim @@ -143,6 +143,8 @@ QtObject: self.items[i].active = true self.dataChanged(index, index, @[ModelRole.Active.int]) + proc sectionVisibilityUpdated*(self: SectionModel) {.signal.} + proc enableDisableSection(self: SectionModel, sectionType: SectionType, value: bool) = if(sectionType != SectionType.Community): for i in 0 ..< self.items.len: @@ -165,6 +167,10 @@ QtObject: let bottomIndex = self.createIndex(bottomInd, 0, nil) self.dataChanged(topIndex, bottomIndex, @[ModelRole.Enabled.int]) + # This signal is emitted to update buttons visibility in the left navigation bar, + # `dataChanged` signal doesn't do the job because of `DelegateModel` used in `StatusAppNavBar` component + self.sectionVisibilityUpdated() + proc enableSection*(self: SectionModel, sectionType: SectionType) = self.enableDisableSection(sectionType, true) diff --git a/ui/app/AppLayouts/Profile/stores/AdvancedStore.qml b/ui/app/AppLayouts/Profile/stores/AdvancedStore.qml index 81e0b171e8..30e0528041 100644 --- a/ui/app/AppLayouts/Profile/stores/AdvancedStore.qml +++ b/ui/app/AppLayouts/Profile/stores/AdvancedStore.qml @@ -21,6 +21,17 @@ QtObject { property bool isWakuV2: root.fleet === Constants.waku_prod || root.fleet === Constants.waku_test + readonly property QtObject experimentalFeatures: QtObject { + readonly property string wallet: "wallet" + 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" + readonly property string gifWidget: "gifWidget" + readonly property string keycard: "keycard" + } + function logDir() { return root.advancedModule.logDir() } @@ -56,4 +67,31 @@ QtObject { function addCustomNetwork(name, endpoint, networkId, networkType) { root.advancedModule.addCustomNetwork(name, endpoint, networkId, networkType) } + + function toggleExperimentalFeature(feature) { + if (feature === experimentalFeatures.wallet) { + advancedModule.toggleWalletSection() + } + else if (feature === experimentalFeatures.browser) { + advancedModule.toggleBrowserSection() + } + else if (feature === experimentalFeatures.communities) { + advancedModule.toggleCommunitySection() + } + 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 + } + else if (feature === experimentalFeatures.gifWidget) { + localAccountSensitiveSettings.isGifWidgetEnabled = !localAccountSensitiveSettings.isGifWidgetEnabled + } + else if (feature === experimentalFeatures.keycard) { + localAccountSettings.isKeycardEnabled = !localAccountSettings.isKeycardEnabled + } + } } diff --git a/ui/app/AppLayouts/Profile/views/AdvancedView.qml b/ui/app/AppLayouts/Profile/views/AdvancedView.qml index 29a5fc93e7..6f8dd4e48c 100644 --- a/ui/app/AppLayouts/Profile/views/AdvancedView.qml +++ b/ui/app/AppLayouts/Profile/views/AdvancedView.qml @@ -16,8 +16,6 @@ import "../panels" ScrollView { id: root - property bool isWakuV2: store.fleet == Constants.waku_prod || store.fleet === Constants.waku_test - property var store property int profileContentWidth height: parent.height @@ -116,25 +114,10 @@ ScrollView { switchChecked: localAccountSensitiveSettings.isWalletEnabled onClicked: { if (!localAccountSensitiveSettings.isWalletEnabled) { - confirmationPopup.settingsProp = "isWalletEnabled" + confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.wallet confirmationPopup.open() } else { - localAccountSensitiveSettings.isWalletEnabled = false - } - } - } - - // TODO: replace with StatusQ component - StatusSettingsLineButton { - text: qsTr("Wallet v2 - do not use, under active development") - isSwitch: true - switchChecked: localAccountSensitiveSettings.isWalletV2Enabled - onClicked: { - if (!localAccountSensitiveSettings.isWalletV2Enabled) { - confirmationPopup.settingsProp = "isWalletV2Enabled" - confirmationPopup.open() - } else { - localAccountSensitiveSettings.isWalletV2Enabled = false + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.wallet) } } } @@ -147,10 +130,10 @@ ScrollView { switchChecked: localAccountSensitiveSettings.isBrowserEnabled onClicked: { if (!localAccountSensitiveSettings.isBrowserEnabled) { - confirmationPopup.settingsProp = "isBrowserEnabled" + confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.browser confirmationPopup.open() } else { - localAccountSensitiveSettings.isBrowserEnabled = false + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.browser) } } } @@ -163,10 +146,10 @@ ScrollView { switchChecked: localAccountSensitiveSettings.communitiesEnabled onClicked: { if (!localAccountSensitiveSettings.communitiesEnabled) { - confirmationPopup.settingsProp = "communitiesEnabled" + confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.communities confirmationPopup.open() } else { - localAccountSensitiveSettings.communitiesEnabled = false + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.communities) } } } @@ -179,10 +162,10 @@ ScrollView { switchChecked: localAccountSensitiveSettings.isActivityCenterEnabled onClicked: { if (!localAccountSensitiveSettings.isActivityCenterEnabled) { - confirmationPopup.settingsProp = "isActivityCenterEnabled" + confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.activityCenter confirmationPopup.open() } else { - localAccountSensitiveSettings.isActivityCenterEnabled = false + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.activityCenter) } } } @@ -195,10 +178,10 @@ ScrollView { switchChecked: localAccountSensitiveSettings.nodeManagementEnabled onClicked: { if (!localAccountSensitiveSettings.nodeManagementEnabled) { - confirmationPopup.settingsProp = "nodeManagementEnabled" + confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.nodeManagement confirmationPopup.open() } else { - localAccountSensitiveSettings.nodeManagementEnabled = false + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.nodeManagement) } } } @@ -211,7 +194,7 @@ ScrollView { isSwitch: true switchChecked: localAccountSensitiveSettings.showOnlineUsers onClicked: { - localAccountSensitiveSettings.showOnlineUsers = !localAccountSensitiveSettings.showOnlineUsers + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.onlineUsers) } } @@ -222,7 +205,7 @@ ScrollView { isSwitch: true switchChecked: localAccountSensitiveSettings.isGifWidgetEnabled onClicked: { - localAccountSensitiveSettings.isGifWidgetEnabled = !localAccountSensitiveSettings.isGifWidgetEnabled + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.gifWidget) } } @@ -233,7 +216,7 @@ ScrollView { isSwitch: true switchChecked: localAccountSettings.isKeycardEnabled onClicked: { - localAccountSettings.isKeycardEnabled = !localAccountSettings.isKeycardEnabled + root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.keycard) } } @@ -510,16 +493,15 @@ ScrollView { ConfirmationDialog { id: confirmationPopup - property string settingsProp: "" + property string experimentalFeature: "" showCancelButton: true //% "This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk." - confirmationText: (settingsProp === "isWalletV2Enabled" ? qsTr("--DO NOT USE - UNDER ACTIVE DEVELOPMENT--\n") : "") + - qsTrId("this-feature-is-experimental-and-is-meant-for-testing-purposes-by-core-contributors-and-the-community--it-s-not-meant-for-real-use-and-makes-no-claims-of-security-or-integrity-of-funds-or-data--use-at-your-own-risk-") + confirmationText: qsTrId("this-feature-is-experimental-and-is-meant-for-testing-purposes-by-core-contributors-and-the-community--it-s-not-meant-for-real-use-and-makes-no-claims-of-security-or-integrity-of-funds-or-data--use-at-your-own-risk-") //% "I understand" confirmButtonLabel: qsTrId("i-understand") onConfirmButtonClicked: { - localAccountSensitiveSettings[settingsProp] = true - settingsProp = "" + root.advancedStore.toggleExperimentalFeature(experimentalFeature) + experimentalFeature = "" close() } diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 4b82dbd339..5ff43995ea 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -176,6 +176,12 @@ Item { communityTypeValue: Constants.appSection.community sectionModel: mainModule.sectionsModel + Component.onCompleted: { + mainModule.sectionsModel.sectionVisibilityUpdated.connect(function(){ + triggerUpdate() + }) + } + property bool communityAdded: false onAboutToUpdateFilteredRegularModel: {