2021-08-05 18:06:19 +00:00
|
|
|
import QtQuick 2.12
|
2022-07-04 10:47:29 +00:00
|
|
|
import QtQuick.Controls 2.14
|
2021-08-05 18:06:19 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQml.Models 2.3
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2022-03-09 10:27:32 +00:00
|
|
|
import shared.controls.chat 1.0
|
|
|
|
import shared.panels 1.0
|
2024-02-14 12:52:54 +00:00
|
|
|
import shared.controls.chat.menuItems 1.0
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2024-08-27 14:35:52 +00:00
|
|
|
import StatusQ 0.1
|
2021-10-20 22:47:23 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-07-04 10:47:29 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-10-20 22:47:23 +00:00
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.stores 1.0
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusMenu {
|
2021-08-05 18:06:19 +00:00
|
|
|
id: root
|
2022-03-09 10:27:32 +00:00
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
property RootStore store
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
ProfileHeader {
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
displayName: root.store.userProfileInst.name
|
|
|
|
pubkey: root.store.userProfileInst.pubKey
|
|
|
|
icon: root.store.userProfileInst.icon
|
2022-12-13 09:37:27 +00:00
|
|
|
userIsEnsVerified: !!root.store.userProfileInst.preferredName
|
2023-12-21 17:10:26 +00:00
|
|
|
objectName: 'onlineIdentifierProfileHeader'
|
2022-03-09 10:27:32 +00:00
|
|
|
}
|
|
|
|
|
2022-07-04 10:47:29 +00:00
|
|
|
StatusMenuSeparator {
|
2022-03-09 10:27:32 +00:00
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2024-02-14 12:52:54 +00:00
|
|
|
ViewProfileMenuItem {
|
2022-08-18 07:38:47 +00:00
|
|
|
objectName: "userStatusViewMyProfileAction"
|
2022-03-09 10:27:32 +00:00
|
|
|
onTriggered: {
|
|
|
|
Global.openProfilePopup(root.store.userProfileInst.pubKey)
|
|
|
|
root.close()
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-14 12:52:54 +00:00
|
|
|
StatusAction {
|
2024-08-27 07:34:00 +00:00
|
|
|
objectName: "userStatusCopyLinkAction"
|
2024-02-14 12:52:54 +00:00
|
|
|
text: qsTr("Copy link to profile")
|
|
|
|
icon.name: "copy"
|
|
|
|
onTriggered: {
|
2024-08-27 14:35:52 +00:00
|
|
|
ClipboardUtils.setText(root.store.contactStore.getLinkToProfile(root.store.userProfileInst.pubKey))
|
2024-02-14 12:52:54 +00:00
|
|
|
root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-04 10:47:29 +00:00
|
|
|
StatusMenuSeparator {
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-07-04 10:47:29 +00:00
|
|
|
id: alwaysOnlineAction
|
2022-08-12 16:31:39 +00:00
|
|
|
objectName: "userStatusMenuAlwaysOnlineAction"
|
2022-06-10 09:01:31 +00:00
|
|
|
text: qsTr("Always online")
|
2022-12-01 16:58:37 +00:00
|
|
|
assetSettings.name: "statuses/online"
|
|
|
|
assetSettings.width: 12
|
|
|
|
assetSettings.height: 12
|
|
|
|
assetSettings.color: "transparent"
|
2022-07-04 10:47:29 +00:00
|
|
|
fontSettings.bold: root.store.userProfileInst.currentUserStatus === Constants.currentUserStatus.alwaysOnline
|
2021-08-05 18:06:19 +00:00
|
|
|
onTriggered: {
|
2022-07-04 10:47:29 +00:00
|
|
|
store.setCurrentUserStatus(Constants.currentUserStatus.alwaysOnline)
|
2021-11-22 11:08:09 +00:00
|
|
|
root.close();
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-07-04 10:47:29 +00:00
|
|
|
id: inactiveAction
|
2022-08-12 16:31:39 +00:00
|
|
|
objectName: "userStatusMenuInactiveAction"
|
2022-06-10 09:01:31 +00:00
|
|
|
text: qsTr("Inactive")
|
2022-12-01 16:58:37 +00:00
|
|
|
assetSettings.name: "statuses/inactive"
|
|
|
|
assetSettings.width: 12
|
|
|
|
assetSettings.height: 12
|
|
|
|
assetSettings.color: "transparent"
|
2022-07-04 10:47:29 +00:00
|
|
|
fontSettings.bold: root.store.userProfileInst.currentUserStatus === Constants.currentUserStatus.inactive
|
2021-08-05 18:06:19 +00:00
|
|
|
onTriggered: {
|
2022-07-04 10:47:29 +00:00
|
|
|
store.setCurrentUserStatus(Constants.currentUserStatus.inactive)
|
2021-11-22 11:08:09 +00:00
|
|
|
root.close();
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-10 09:01:31 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-07-04 10:47:29 +00:00
|
|
|
id: automaticAction
|
2022-08-12 16:31:39 +00:00
|
|
|
objectName: "userStatusMenuAutomaticAction"
|
2022-06-10 09:01:31 +00:00
|
|
|
text: qsTr("Set status automatically")
|
2022-12-01 16:58:37 +00:00
|
|
|
assetSettings.name: "statuses/automatic"
|
|
|
|
assetSettings.color: "transparent"
|
2022-07-04 10:47:29 +00:00
|
|
|
fontSettings.bold: root.store.userProfileInst.currentUserStatus === Constants.currentUserStatus.automatic
|
2022-06-10 09:01:31 +00:00
|
|
|
onTriggered: {
|
2022-07-04 10:47:29 +00:00
|
|
|
store.setCurrentUserStatus(Constants.currentUserStatus.automatic)
|
2022-06-10 09:01:31 +00:00
|
|
|
root.close();
|
|
|
|
}
|
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|