2021-10-06 09:16:39 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: root
|
2023-04-05 14:39:52 +00:00
|
|
|
spacing: 8
|
2021-10-06 09:16:39 +00:00
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property var privacyStore
|
2022-06-28 18:11:18 +00:00
|
|
|
property var contactsStore
|
2021-10-06 09:16:39 +00:00
|
|
|
property alias mainMenuItems: mainMenuItems.model
|
|
|
|
property alias settingsMenuItems: settingsMenuItems.model
|
|
|
|
property alias extraMenuItems: extraMenuItems.model
|
2022-02-11 09:44:49 +00:00
|
|
|
property alias appsMenuItems: appsMenuItems.model
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
property bool browserMenuItemEnabled: false
|
2022-03-07 20:34:59 +00:00
|
|
|
property bool walletMenuItemEnabled: false
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
signal menuItemClicked(var menu_item)
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: mainMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
2022-08-11 13:27:13 +00:00
|
|
|
objectName: itemId + "-MainMenuItem"
|
2022-02-25 13:32:46 +00:00
|
|
|
itemId: model.subsection
|
2021-10-06 09:16:39 +00:00
|
|
|
title: model.text
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: model.icon
|
2022-02-25 13:32:46 +00:00
|
|
|
selected: Global.settingsSubsection === model.subsection
|
2021-10-06 09:16:39 +00:00
|
|
|
onClicked: root.menuItemClicked(model)
|
2022-05-26 13:40:41 +00:00
|
|
|
badge.value: {
|
|
|
|
switch (model.subsection) {
|
|
|
|
case Constants.settingsSubsection.backUpSeed:
|
|
|
|
return !root.privacyStore.mnemonicBackedUp
|
|
|
|
default: return "";
|
|
|
|
}
|
|
|
|
}
|
2022-04-21 10:50:01 +00:00
|
|
|
visible: {
|
2022-05-26 13:40:41 +00:00
|
|
|
switch (model.subsection) {
|
|
|
|
case Constants.settingsSubsection.ensUsernames:
|
|
|
|
return root.walletMenuItemEnabled;
|
|
|
|
case Constants.settingsSubsection.backUpSeed:
|
|
|
|
return !root.privacyStore.mnemonicBackedUp;
|
|
|
|
default: return true;
|
|
|
|
}
|
2022-04-21 10:50:01 +00:00
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
StatusListSectionHeadline {
|
|
|
|
text: qsTr("Apps")
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: appsMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
|
|
|
id: appsMenuDelegate
|
2022-08-11 13:27:13 +00:00
|
|
|
objectName: itemId + "-AppMenuItem"
|
2022-02-25 13:32:46 +00:00
|
|
|
itemId: model.subsection
|
2022-02-11 09:44:49 +00:00
|
|
|
title: model.text
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: model.icon
|
2022-02-25 13:32:46 +00:00
|
|
|
selected: Global.settingsSubsection === model.subsection
|
2022-02-11 09:44:49 +00:00
|
|
|
onClicked: root.menuItemClicked(model)
|
2022-03-04 11:09:45 +00:00
|
|
|
visible: {
|
2022-06-17 09:29:14 +00:00
|
|
|
(model.subsection !== Constants.settingsSubsection.browserSettings && model.subsection !== Constants.settingsSubsection.wallet) ||
|
2022-06-21 09:00:54 +00:00
|
|
|
(model.subsection === Constants.settingsSubsection.browserSettings && root.browserMenuItemEnabled) ||
|
|
|
|
(model.subsection === Constants.settingsSubsection.communitiesSettings) ||
|
2022-06-17 09:29:14 +00:00
|
|
|
(model.subsection === Constants.settingsSubsection.wallet && root.walletMenuItemEnabled)
|
2022-03-04 11:09:45 +00:00
|
|
|
}
|
2022-03-21 15:33:14 +00:00
|
|
|
badge.value: {
|
|
|
|
switch (model.subsection) {
|
|
|
|
case Constants.settingsSubsection.messaging:
|
2022-06-28 18:11:18 +00:00
|
|
|
return root.contactsStore.receivedContactRequestsModel.count
|
2022-03-21 15:33:14 +00:00
|
|
|
default: return ""
|
|
|
|
}
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
StatusListSectionHeadline { text: qsTr("Settings") }
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: settingsMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
|
|
|
id: settingsMenuDelegate
|
2022-08-11 13:27:13 +00:00
|
|
|
objectName: itemId + "-SettingsMenuItem"
|
2022-02-25 13:32:46 +00:00
|
|
|
itemId: model.subsection
|
2021-10-06 09:16:39 +00:00
|
|
|
title: model.text
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: model.icon
|
2022-02-25 13:32:46 +00:00
|
|
|
selected: Global.settingsSubsection === model.subsection
|
2021-10-06 09:16:39 +00:00
|
|
|
onClicked: root.menuItemClicked(model)
|
2022-02-25 13:32:46 +00:00
|
|
|
visible: model.subsection !== Constants.settingsSubsection.browserSettings || root.browserMenuItemEnabled
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-03 13:16:27 +00:00
|
|
|
StatusListSectionHeadline { text: qsTr("About & Help") }
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: extraMenuItems
|
|
|
|
delegate: StatusNavigationListItem {
|
2022-08-11 13:27:13 +00:00
|
|
|
objectName: itemId + "-ExtraMenuItem"
|
2022-02-25 13:32:46 +00:00
|
|
|
itemId: model.subsection
|
2021-10-06 09:16:39 +00:00
|
|
|
title: model.text
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: model.icon
|
2022-02-25 13:32:46 +00:00
|
|
|
selected: Global.settingsSubsection === model.subsection
|
|
|
|
visible: model.subsection !== Constants.settingsSubsection.browserSettings || root.browserMenuItemEnabled
|
2021-10-06 09:16:39 +00:00
|
|
|
onClicked: root.menuItemClicked(model)
|
|
|
|
}
|
|
|
|
}
|
2023-04-05 14:39:52 +00:00
|
|
|
}
|