Commit fdd2211b authored by Martin Straka's avatar Martin Straka
Browse files

Added missing qml file

parent f4c20d8c
/*
* Copyright (C) 2014-2016 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Window 2.1
import QtQuick.Layouts 1.2
import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0
Component {
id: accountMenuPage
Item {
id: mainLayout
property int myWidht: mainLayout.width - 2 * defaultMargin
Rectangle {
id: header
anchors.top: parent.top
width: parent.width
height: headerHeight
color: datovkaPalette.highlight
Image {
id: backElement
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: defaultMargin
sourceSize.height: navImgHeight
source: "qrc:/ui/back.svg"
}
Rectangle {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
color: "transparent"
MouseArea {
anchors.fill: parent
onClicked: {
gAcntName = ""
gUserName = ""
pageView.pop(StackView.Immediate)
}
}
}
Column {
anchors.verticalCenter: parent.verticalCenter
anchors.left: backElement.right
anchors.leftMargin: defaultMargin
Label {
text: gAcntName + " (" + gUserName + ")"
font.bold: true
color: datovkaPalette.text
}
Label {
text: qsTr("Account properties")
font.bold: true
color: datovkaPalette.text
}
}
}
Rectangle {
anchors.top: header.bottom
anchors.bottom: parent.bottom
width: parent.width
color: "transparent"
ListModel {
id: accountMenuListModel
ListElement {
index: 0
name: qsTr("Account settings")
image: "qrc:/ui/settings.svg"
showNext: true
}
ListElement {
index: 1
name: qsTr("View account info")
image: "qrc:/ui/account-box.svg"
showNext: true
}
ListElement {
index: 2
name: qsTr("Update account info")
image: "qrc:/ui/account-search.svg"
showNext: false
}
ListElement {
index: 3
name: qsTr("Clean up the file database")
image: "qrc:/ui/database.svg"
showNext: false
}
ListElement {
index: 4
name: qsTr("Change password")
image: "qrc:/ui/account-key.svg"
showNext: false
}
ListElement {
index: 5
name: qsTr("Delete account")
image: "qrc:/ui/account-remove.svg"
showNext: false
}
}
Component {
id: accountMenuComponent
Rectangle {
color: datovkaPalette.base
height: headerHeight
width: parent.width
Image {
id: menuImage
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: defaultMargin
sourceSize.height: imgHeight * 0.7
source: image
}
ColorOverlay {
anchors.fill: menuImage
source: menuImage
color: datovkaPalette.text
}
Text {
anchors.verticalCenter: parent.verticalCenter
anchors.left: menuImage.right
anchors.leftMargin: defaultMargin
color: datovkaPalette.text
text: name
}
Rectangle {
id: next2
visible: showNext
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
height: parent.height
width: parent.width * 0.07
color: parent.color
Image {
id: nextImage2
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: defaultMargin
sourceSize.height: navImgHeight
source: "qrc:/ui/next.svg"
}
ColorOverlay {
anchors.fill: nextImage2
source: nextImage2
color: datovkaPalette.text
}
}
MouseArea {
anchors.fill: parent
onClicked: {
if (index == 0) {
pageView.push(accountSettingsPage, {"userName": gUserName}, StackView.Immediate)
} else if (index == 1) {
pageView.push(accountDetailPage, StackView.Immediate)
accounts.fillAccountInfo(gUserName)
} else if (index == 2) {
isds.getAccountInfo(gUserName, false)
} else if (index == 3) {
files.deleteFileDb(gUserName)
} else if (index == 4) {
isds.changePassword(gUserName, gAcntName)
} else if (index == 5) {
if (accounts.removeAccount(gUserName, true)) {
pageView.pop(StackView.Immediate)
}
} else {
pageView.pop(StackView.Immediate)
}
}
}
}
}
ListView {
id: accountMenuList
anchors.fill: parent
clip: true
spacing: 1
opacity: 1
visible: true
width: parent.width
interactive: true
model: accountMenuListModel
delegate: accountMenuComponent
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment