chore(experemantal_features): Remove activity center settings and enable by default
Closes: #5922
This commit is contained in:
parent
d6cc1ed1ab
commit
7cacadd9be
|
@ -12,8 +12,6 @@ const LSS_KEY_NODE_MANAGEMENT_ENABLED* = "nodeManagementEnabled"
|
||||||
const DEFAULT_NODE_MANAGEMENT_ENABLED = false
|
const DEFAULT_NODE_MANAGEMENT_ENABLED = false
|
||||||
const LSS_KEY_IS_BROWSER_ENABLED* = "isExperimentalBrowserEnabled"
|
const LSS_KEY_IS_BROWSER_ENABLED* = "isExperimentalBrowserEnabled"
|
||||||
const DEFAULT_IS_BROWSER_ENABLED = false
|
const DEFAULT_IS_BROWSER_ENABLED = false
|
||||||
const LSS_KEY_IS_ACTIVITY_CENTER_ENABLED* = "isActivityCenterEnabled"
|
|
||||||
const DEFAULT_IS_ACTIVITY_CENTER_ENABLED = false
|
|
||||||
const LSS_KEY_SHOW_ONLINE_USERS* = "showOnlineUsers"
|
const LSS_KEY_SHOW_ONLINE_USERS* = "showOnlineUsers"
|
||||||
const DEFAULT_SHOW_ONLINE_USERS = true
|
const DEFAULT_SHOW_ONLINE_USERS = true
|
||||||
const LSS_KEY_EXPAND_USERS_LIST* = "expandUsersList"
|
const LSS_KEY_EXPAND_USERS_LIST* = "expandUsersList"
|
||||||
|
@ -231,20 +229,6 @@ QtObject:
|
||||||
write = setIsBrowserEnabled
|
write = setIsBrowserEnabled
|
||||||
notify = isBrowserEnabledChanged
|
notify = isBrowserEnabledChanged
|
||||||
|
|
||||||
|
|
||||||
proc isActivityCenterEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
|
||||||
proc getIsActivityCenterEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
|
||||||
getSettingsProp[bool](self, LSS_KEY_IS_ACTIVITY_CENTER_ENABLED, newQVariant(DEFAULT_IS_ACTIVITY_CENTER_ENABLED))
|
|
||||||
proc setIsActivityCenterEnabled*(self: LocalAccountSensitiveSettings, value: bool) {.slot.} =
|
|
||||||
setSettingsProp(self, LSS_KEY_IS_ACTIVITY_CENTER_ENABLED, newQVariant(value)):
|
|
||||||
self.isActivityCenterEnabledChanged()
|
|
||||||
|
|
||||||
QtProperty[bool] isActivityCenterEnabled:
|
|
||||||
read = getIsActivityCenterEnabled
|
|
||||||
write = setIsActivityCenterEnabled
|
|
||||||
notify = isActivityCenterEnabledChanged
|
|
||||||
|
|
||||||
|
|
||||||
proc showOnlineUsersChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
proc showOnlineUsersChanged*(self: LocalAccountSensitiveSettings) {.signal.}
|
||||||
proc getShowOnlineUsers*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
proc getShowOnlineUsers*(self: LocalAccountSensitiveSettings): bool {.slot.} =
|
||||||
getSettingsProp[bool](self, LSS_KEY_SHOW_ONLINE_USERS, newQVariant(DEFAULT_SHOW_ONLINE_USERS))
|
getSettingsProp[bool](self, LSS_KEY_SHOW_ONLINE_USERS, newQVariant(DEFAULT_SHOW_ONLINE_USERS))
|
||||||
|
@ -772,7 +756,6 @@ QtObject:
|
||||||
of LSS_KEY_IS_WALLET_ENABLED: self.isWalletEnabledChanged()
|
of LSS_KEY_IS_WALLET_ENABLED: self.isWalletEnabledChanged()
|
||||||
of LSS_KEY_NODE_MANAGEMENT_ENABLED: self.nodeManagementEnabledChanged()
|
of LSS_KEY_NODE_MANAGEMENT_ENABLED: self.nodeManagementEnabledChanged()
|
||||||
of LSS_KEY_IS_BROWSER_ENABLED: self.isBrowserEnabledChanged()
|
of LSS_KEY_IS_BROWSER_ENABLED: self.isBrowserEnabledChanged()
|
||||||
of LSS_KEY_IS_ACTIVITY_CENTER_ENABLED: self.isActivityCenterEnabledChanged()
|
|
||||||
of LSS_KEY_SHOW_ONLINE_USERS: self.showOnlineUsersChanged()
|
of LSS_KEY_SHOW_ONLINE_USERS: self.showOnlineUsersChanged()
|
||||||
of LSS_KEY_EXPAND_USERS_LIST: self.expandUsersListChanged()
|
of LSS_KEY_EXPAND_USERS_LIST: self.expandUsersListChanged()
|
||||||
of LSS_KEY_IS_GIF_WIDGET_ENABLED: self.isGifWidgetEnabledChanged()
|
of LSS_KEY_IS_GIF_WIDGET_ENABLED: self.isGifWidgetEnabledChanged()
|
||||||
|
|
|
@ -829,16 +829,16 @@ method onStatusUrlRequested*[T](self: Module[T], action: StatusUrlAction, commun
|
||||||
i.inc
|
i.inc
|
||||||
self.resolveENS(id, "", STATUS_URL_ENS_RESOLVE_REASON & $StatusUrlAction.OpenOrCreateGroupChat)
|
self.resolveENS(id, "", STATUS_URL_ENS_RESOLVE_REASON & $StatusUrlAction.OpenOrCreateGroupChat)
|
||||||
|
|
||||||
elif(action == StatusUrlAction.RequestToJoinCommunity and singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled()):
|
elif(action == StatusUrlAction.RequestToJoinCommunity):
|
||||||
let item = self.view.model().getItemById(singletonInstance.userProfile.getPubKey())
|
let item = self.view.model().getItemById(singletonInstance.userProfile.getPubKey())
|
||||||
self.setActiveSection(item)
|
self.setActiveSection(item)
|
||||||
self.communitiesModule.requestToJoinCommunity(communityId, singletonInstance.userProfile.getName())
|
self.communitiesModule.requestToJoinCommunity(communityId, singletonInstance.userProfile.getName())
|
||||||
|
|
||||||
elif(action == StatusUrlAction.OpenCommunity and singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled()):
|
elif(action == StatusUrlAction.OpenCommunity):
|
||||||
let item = self.view.model().getItemById(communityId)
|
let item = self.view.model().getItemById(communityId)
|
||||||
self.setActiveSection(item)
|
self.setActiveSection(item)
|
||||||
|
|
||||||
elif(action == StatusUrlAction.OpenCommunityChannel and singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled()):
|
elif(action == StatusUrlAction.OpenCommunityChannel):
|
||||||
for cId, cModule in self.channelGroupModules.pairs:
|
for cId, cModule in self.channelGroupModules.pairs:
|
||||||
if(cId == singletonInstance.userProfile.getPubKey()):
|
if(cId == singletonInstance.userProfile.getPubKey()):
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -35,10 +35,6 @@ proc delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
proc init*(self: Controller) =
|
proc init*(self: Controller) =
|
||||||
self.events.on(TOGGLE_SECTION) do(e:Args):
|
|
||||||
let args = ToggleSectionArgs(e)
|
|
||||||
self.delegate.onToggleSection(args.sectionType)
|
|
||||||
|
|
||||||
self.events.on(SIGNAL_COMMUNITY_JOINED) do(e:Args):
|
self.events.on(SIGNAL_COMMUNITY_JOINED) do(e:Args):
|
||||||
let args = CommunityArgs(e)
|
let args = CommunityArgs(e)
|
||||||
if(args.error.len > 0):
|
if(args.error.len > 0):
|
||||||
|
|
|
@ -28,9 +28,6 @@ method saveExemptions*(self: AccessInterface, itemId: string, muteAllMessages: b
|
||||||
globalMentions: string, allMessages: string) {.base.} =
|
globalMentions: string, allMessages: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method onToggleSection*(self: AccessInterface, sectionType: SectionType) {.base.} =
|
|
||||||
raise newException(ValueError, "No implementation available")
|
|
||||||
|
|
||||||
method addCommunity*(self: AccessInterface, communityDto: CommunityDto) {.base.} =
|
method addCommunity*(self: AccessInterface, communityDto: CommunityDto) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
|
@ -109,19 +109,6 @@ method saveExemptions*(self: Module, itemId: string, muteAllMessages: bool, pers
|
||||||
if(self.controller.setNotifSettingExemptions(itemId, exemptions)):
|
if(self.controller.setNotifSettingExemptions(itemId, exemptions)):
|
||||||
self.view.exemptionsModel().updateExemptions(itemId, muteAllMessages, personalMentions, globalMentions, otherMessages)
|
self.view.exemptionsModel().updateExemptions(itemId, muteAllMessages, personalMentions, globalMentions, otherMessages)
|
||||||
|
|
||||||
method onToggleSection*(self: Module, sectionType: SectionType) =
|
|
||||||
if(sectionType != SectionType.Community):
|
|
||||||
return
|
|
||||||
|
|
||||||
let channelGroups = self.controller.getChannelGroups()
|
|
||||||
for cg in channelGroups:
|
|
||||||
if cg.channelGroupType == ChannelGroupType.Community:
|
|
||||||
let ind = self.view.exemptionsModel().findIndexForItemId(cg.id)
|
|
||||||
if(ind != -1):
|
|
||||||
continue
|
|
||||||
let item = self.createItem(cg.id, cg.name, cg.images.thumbnail, cg.color, joinedTimestamp = 0, item.Type.Community)
|
|
||||||
self.view.exemptionsModel().addItem(item)
|
|
||||||
|
|
||||||
method addCommunity*(self: Module, communityDto: CommunityDto) =
|
method addCommunity*(self: Module, communityDto: CommunityDto) =
|
||||||
let ind = self.view.exemptionsModel().findIndexForItemId(communityDto.id)
|
let ind = self.view.exemptionsModel().findIndexForItemId(communityDto.id)
|
||||||
if(ind != -1):
|
if(ind != -1):
|
||||||
|
|
|
@ -180,7 +180,6 @@ ColumnLayout {
|
||||||
chatContentModule.chatDetails.isUsersListAvailable
|
chatContentModule.chatDetails.isUsersListAvailable
|
||||||
}
|
}
|
||||||
membersButton.highlighted: localAccountSensitiveSettings.expandUsersList
|
membersButton.highlighted: localAccountSensitiveSettings.expandUsersList
|
||||||
notificationButton.visible: localAccountSensitiveSettings.isActivityCenterEnabled
|
|
||||||
notificationButton.tooltip.offset: localAccountSensitiveSettings.expandUsersList && membersButton.visible ? 0 : 14
|
notificationButton.tooltip.offset: localAccountSensitiveSettings.expandUsersList && membersButton.visible ? 0 : 14
|
||||||
|
|
||||||
notificationCount: activityCenter.unreadNotificationsCount
|
notificationCount: activityCenter.unreadNotificationsCount
|
||||||
|
|
|
@ -161,24 +161,6 @@ SettingsContentBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: replace with StatusQ component
|
|
||||||
StatusSettingsLineButton {
|
|
||||||
anchors.leftMargin: 0
|
|
||||||
anchors.rightMargin: 0
|
|
||||||
//% "Activity Center"
|
|
||||||
text: qsTrId("activity-center")
|
|
||||||
isSwitch: true
|
|
||||||
switchChecked: localAccountSensitiveSettings.isActivityCenterEnabled
|
|
||||||
onClicked: {
|
|
||||||
if (!localAccountSensitiveSettings.isActivityCenterEnabled) {
|
|
||||||
confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.activityCenter
|
|
||||||
confirmationPopup.open()
|
|
||||||
} else {
|
|
||||||
root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.activityCenter)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: replace with StatusQ component
|
// TODO: replace with StatusQ component
|
||||||
StatusSettingsLineButton {
|
StatusSettingsLineButton {
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
|
|
Loading…
Reference in New Issue