This repository has been archived on 2024-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
UTPass/qml/Main.qml
2019-10-07 18:18:50 +02:00

69 lines
1.8 KiB
QML

import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import Pass 1.0
import "dialogs"
MainView {
id: root
objectName: "mainView"
applicationName: "utpass.qrouland"
automaticOrientation: false
width: units.gu(48)
height: units.gu(80)
signal responsePassphraseDialog(bool canceled, string passphrase)
function initPass(rootView) {
Pass.init(rootView)
}
function callPassphraseDialog(useridHint, description, previousWasBad) {
//TODO use parameters to impove passphrase dialog
var passphraseDialog = PopupUtils.open(
Qt.resolvedUrl("dialogs/PassphraseDialog.qml"))
passphraseDialog.activateFocus()
var validated = function (passphrase) {
responsePassphraseDialog(false, passphrase)
}
var canceled = function () {
responsePassphraseDialog(true, "")
}
passphraseDialog.validated.connect(validated)
passphraseDialog.canceled.connect(canceled)
}
function callCredDialog() {
//TODO add parameters to impove passphrase dialog
var credDialog = PopupUtils.open(
Qt.resolvedUrl("dialogs/CredDialog.qml"))
credDialog.activateFocus()
var validated = function (user, password) {
responseCredDialog(false, user, password)
}
var canceled = function () {
responseCredDialog(true, "", "")
}
credDialog.validated.connect(validated)
credDialog.canceled.connect(canceled)
}
PageStack {
id: pageStack
anchors.fill: parent
Component.onCompleted: {
pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml"))
}
}
}