2021-04-28 19:03:41 +00:00
|
|
|
import QtQuick 2.13
|
2021-07-19 16:21:43 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2021-10-19 08:52:08 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../../popups/community"
|
2021-04-28 19:03:41 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2021-11-02 19:39:18 +00:00
|
|
|
property var activeCommunity
|
|
|
|
|
2021-04-28 19:03:41 +00:00
|
|
|
id: root
|
|
|
|
height: childrenRect.height + Style.current.padding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
border.color: Style.current.border
|
|
|
|
radius: 16
|
|
|
|
color: Style.current.transparent
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 66
|
|
|
|
height: 4
|
|
|
|
color: Style.current.secondaryMenuBackground
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -2
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
|
2021-10-19 08:52:08 +00:00
|
|
|
StatusRoundIcon {
|
2021-04-28 19:03:41 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: 40
|
|
|
|
height: 40
|
2021-10-19 08:52:08 +00:00
|
|
|
icon.name: "objects"
|
2021-04-28 19:03:41 +00:00
|
|
|
}
|
|
|
|
|
2021-10-19 08:52:08 +00:00
|
|
|
StatusBaseText {
|
2021-04-28 19:03:41 +00:00
|
|
|
id: backUpText
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Back up community key"
|
|
|
|
text: qsTrId("back-up-community-key")
|
2021-04-28 19:03:41 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 48
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: 15
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.xlPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
2021-10-19 08:52:08 +00:00
|
|
|
color: Theme.palette.directColor1
|
2021-04-28 19:03:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: backUpBtn
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Back up"
|
|
|
|
text: qsTrId("back-up")
|
2021-04-28 19:03:41 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: backUpText.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
2021-04-29 14:48:16 +00:00
|
|
|
onClicked: {
|
2021-07-21 11:00:32 +00:00
|
|
|
openPopup(transferOwnershipPopup, {privateKey: chatsModel.communities.exportCommunity()})
|
2021-04-29 14:48:16 +00:00
|
|
|
}
|
2021-04-28 19:03:41 +00:00
|
|
|
}
|
2021-07-16 12:36:27 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: transferOwnershipPopup
|
|
|
|
TransferOwnershipPopup {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
onClosed: {
|
2021-11-02 19:39:18 +00:00
|
|
|
let hiddenBannerIds = localAccountSensitiveSettings.hiddenCommunityBackUpBanners || []
|
|
|
|
if (hiddenBannerIds.includes(root.activeCommunity.id)) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
hiddenBannerIds.push(root.activeCommunity.id)
|
2021-10-20 09:50:50 +00:00
|
|
|
localAccountSensitiveSettings.hiddenCommunityBackUpBanners = hiddenBannerIds
|
2021-07-16 12:36:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-28 19:03:41 +00:00
|
|
|
}
|
|
|
|
|