mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-25 06:52:28 +00:00
Initial Commit : 0.0.1
This commit is contained in:
64
qml/components/CopyText.qml
Normal file
64
qml/components/CopyText.qml
Normal file
@ -0,0 +1,64 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "../styles"
|
||||
|
||||
Item {
|
||||
id: copyText
|
||||
property string text
|
||||
|
||||
property bool commonBorder: true
|
||||
property int lBorderwidth: 0
|
||||
property int rBorderwidth: 0
|
||||
property int tBorderwidth: 0
|
||||
property int bBorderwidth: 0
|
||||
property int commonBorderWidth: 0
|
||||
property string borderColor: UbuntuColors.warmGrey
|
||||
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
Text {
|
||||
text: copyText.text
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: units.gu(2)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Icon {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.rightMargin: units.gu(2)
|
||||
height: units.gu(4)
|
||||
name: "edit-copy"
|
||||
color: UbuntuColors.orange
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: {
|
||||
parent.color = UbuntuColors.warmGrey
|
||||
}
|
||||
onClicked: {
|
||||
var mimeData = Clipboard.newData()
|
||||
mimeData.text = copyText.text
|
||||
Clipboard.push(mimeData)
|
||||
}
|
||||
onReleased: {
|
||||
parent.color = theme.palette.normal.background
|
||||
}
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
id: cb
|
||||
commonBorder: copyText.commonBorder
|
||||
lBorderwidth: copyText.lBorderwidth
|
||||
rBorderwidth: copyText.rBorderwidth
|
||||
tBorderwidth: copyText.tBorderwidth
|
||||
bBorderwidth: copyText.bBorderwidth
|
||||
borderColor: copyText.borderColor
|
||||
}
|
||||
}
|
||||
}
|
59
qml/components/ExternalLink.qml
Normal file
59
qml/components/ExternalLink.qml
Normal file
@ -0,0 +1,59 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "../styles"
|
||||
|
||||
Item {
|
||||
id: externalLink
|
||||
|
||||
property string url
|
||||
property string text
|
||||
|
||||
property bool commonBorder: true
|
||||
property int lBorderwidth: 0
|
||||
property int rBorderwidth: 0
|
||||
property int tBorderwidth: 0
|
||||
property int bBorderwidth: 0
|
||||
property int commonBorderWidth: 0
|
||||
property string borderColor: UbuntuColors.warmGrey
|
||||
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
Text {
|
||||
text: externalLink.text
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: units.gu(2)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Icon {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.rightMargin: units.gu(2)
|
||||
width: units.gu(4)
|
||||
height: units.gu(4)
|
||||
name: "go-next"
|
||||
color: UbuntuColors.orange
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
Qt.openUrlExternally(externalLink.url)
|
||||
}
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
id: cb
|
||||
commonBorder: externalLink.commonBorder
|
||||
lBorderwidth: externalLink.lBorderwidth
|
||||
rBorderwidth: externalLink.rBorderwidth
|
||||
tBorderwidth: externalLink.tBorderwidth
|
||||
bBorderwidth: externalLink.bBorderwidth
|
||||
borderColor: externalLink.borderColor
|
||||
}
|
||||
}
|
||||
}
|
78
qml/components/FileDir.qml
Normal file
78
qml/components/FileDir.qml
Normal file
@ -0,0 +1,78 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Ubuntu.Components.Popups 1.3
|
||||
import Pass 1.0
|
||||
import "../styles"
|
||||
import "../dialogs"
|
||||
|
||||
Component {
|
||||
Rectangle {
|
||||
id: fileDir
|
||||
property string activePasswordName
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: units.gu(5)
|
||||
|
||||
Text {
|
||||
text: fileBaseName
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: units.gu(2)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Icon {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.rightMargin: units.gu(2)
|
||||
height: units.gu(4)
|
||||
name: fileIsDir ? "go-next" : "lock"
|
||||
color: UbuntuColors.orange
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (fileIsDir) {
|
||||
folderModel.folder = folderModel.folder + "/" + fileName
|
||||
backAction.visible = true
|
||||
} else {
|
||||
fileDir.activePasswordName = fileBaseName
|
||||
|
||||
Pass.onDecrypted.connect(function (text) {
|
||||
pageStack.push(Qt.resolvedUrl("../pages/Password.qml"),
|
||||
{
|
||||
"plainText": text,
|
||||
"title": fileDir.activePasswordName
|
||||
})
|
||||
})
|
||||
|
||||
Pass.onDecryptFailed.connect(function () {
|
||||
PopupUtils.open(passwordPageDecryptError)
|
||||
})
|
||||
|
||||
Pass.decrypt(folderModel.folder + "/" + fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
commonBorder: false
|
||||
lBorderwidth: 0
|
||||
rBorderwidth: 0
|
||||
tBorderwidth: 0
|
||||
bBorderwidth: 1
|
||||
borderColor: UbuntuColors.warmGrey
|
||||
}
|
||||
|
||||
Component {
|
||||
id: passwordPageDecryptError
|
||||
ErrorDialog {
|
||||
textError: i18n.tr("Decryption failed !")
|
||||
onDialogClosed: {
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
62
qml/components/PageStackLink.qml
Normal file
62
qml/components/PageStackLink.qml
Normal file
@ -0,0 +1,62 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "../styles"
|
||||
|
||||
Item {
|
||||
id: pageStackLink
|
||||
|
||||
property string page
|
||||
property var params: {
|
||||
|
||||
}
|
||||
property string text
|
||||
|
||||
property bool commonBorder: true
|
||||
property int lBorderwidth: 0
|
||||
property int rBorderwidth: 0
|
||||
property int tBorderwidth: 0
|
||||
property int bBorderwidth: 0
|
||||
property int commonBorderWidth: 0
|
||||
property string borderColor: UbuntuColors.warmGrey
|
||||
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
Text {
|
||||
text: pageStackLink.text
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: units.gu(2)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Icon {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.rightMargin: units.gu(2)
|
||||
width: units.gu(4)
|
||||
height: units.gu(4)
|
||||
name: "go-next"
|
||||
color: UbuntuColors.orange
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
pageStack.push(page, params)
|
||||
}
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
id: cb
|
||||
commonBorder: pageStackLink.commonBorder
|
||||
lBorderwidth: pageStackLink.lBorderwidth
|
||||
rBorderwidth: pageStackLink.rBorderwidth
|
||||
tBorderwidth: pageStackLink.tBorderwidth
|
||||
bBorderwidth: pageStackLink.bBorderwidth
|
||||
borderColor: pageStackLink.borderColor
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user