mirror of
https://github.com/QRouland/UTPass.git
synced 2025-07-19 17:02:29 +00:00
Initial Commit : 0.0.1
This commit is contained in:
.astylerc.gitignore.gitmodulesCMakeLists.txtLICENSEREADME.mdUTPass.apparmorUTPass.contenthubUTPass.desktop.in
assets
clickable.jsonlibs
main.cppmanifest.json.inplugins
po
qml
Main.qml
components
dialogs
DoubleValidationDialog.qmlErrorDialog.qmlPassphraseDialog.qmlSimpleValidationDialog.qmlSuccessDialog.qml
pages
styles
screens
52
qml/dialogs/DoubleValidationDialog.qml
Normal file
52
qml/dialogs/DoubleValidationDialog.qml
Normal file
@ -0,0 +1,52 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Ubuntu.Components.Popups 1.3
|
||||
|
||||
Dialog {
|
||||
id: doubleValidationDialog
|
||||
|
||||
property int nb_validation: 0
|
||||
property string text1
|
||||
property string text2
|
||||
|
||||
signal doubleValidated
|
||||
signal canceled
|
||||
|
||||
Text {
|
||||
visible: nb_validation == 0
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: text1
|
||||
}
|
||||
|
||||
Text {
|
||||
visible: nb_validation == 1
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: text2
|
||||
}
|
||||
|
||||
Button {
|
||||
text: i18n.tr("Ok")
|
||||
color: UbuntuColors.green
|
||||
|
||||
onClicked: {
|
||||
if (nb_validation == 1) {
|
||||
nb_validation = 0
|
||||
doubleValidated()
|
||||
PopupUtils.close(doubleValidationDialog)
|
||||
} else {
|
||||
nb_validation += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: cancelButton
|
||||
text: i18n.tr("Cancel")
|
||||
color: UbuntuColors.red
|
||||
onClicked: {
|
||||
nb_validation = 0
|
||||
canceled()
|
||||
PopupUtils.close(doubleValidationDialog)
|
||||
}
|
||||
}
|
||||
}
|
22
qml/dialogs/ErrorDialog.qml
Normal file
22
qml/dialogs/ErrorDialog.qml
Normal file
@ -0,0 +1,22 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Ubuntu.Components.Popups 1.3
|
||||
|
||||
Dialog {
|
||||
id: dialogSuccess
|
||||
|
||||
property string textError
|
||||
|
||||
signal dialogClosed
|
||||
|
||||
title: i18n.tr("Error !")
|
||||
text: textError
|
||||
Button {
|
||||
text: i18n.tr("OK")
|
||||
color: UbuntuColors.red
|
||||
onClicked: function () {
|
||||
dialogClosed()
|
||||
PopupUtils.close(dialogSuccess)
|
||||
}
|
||||
}
|
||||
}
|
50
qml/dialogs/PassphraseDialog.qml
Normal file
50
qml/dialogs/PassphraseDialog.qml
Normal file
@ -0,0 +1,50 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Ubuntu.Components.Popups 1.3
|
||||
|
||||
Dialog {
|
||||
id: passphraseProvider
|
||||
title: i18n.tr("Authentication required")
|
||||
text: i18n.tr("Enter passphrase:")
|
||||
|
||||
signal validated(string passphrase)
|
||||
signal canceled
|
||||
|
||||
function activateFocus() {
|
||||
passphraseField.forceActiveFocus()
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: passphraseField
|
||||
|
||||
placeholderText: i18n.tr("passphrase")
|
||||
echoMode: TextInput.Password
|
||||
|
||||
onAccepted: okButton.clicked(text)
|
||||
}
|
||||
|
||||
Button {
|
||||
id: okButton
|
||||
|
||||
text: i18n.tr("Ok")
|
||||
color: UbuntuColors.green
|
||||
|
||||
onClicked: {
|
||||
validated(passphraseField.text)
|
||||
passphraseField.text = ""
|
||||
PopupUtils.close(passphraseProvider)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: cancelButton
|
||||
text: i18n.tr("Cancel")
|
||||
|
||||
color: UbuntuColors.red
|
||||
|
||||
onClicked: {
|
||||
canceled()
|
||||
PopupUtils.close(passphraseProvider)
|
||||
}
|
||||
}
|
||||
}
|
37
qml/dialogs/SimpleValidationDialog.qml
Normal file
37
qml/dialogs/SimpleValidationDialog.qml
Normal file
@ -0,0 +1,37 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Ubuntu.Components.Popups 1.3
|
||||
|
||||
Dialog {
|
||||
id: doubleValidationDialog
|
||||
|
||||
property string text
|
||||
|
||||
signal validated
|
||||
signal canceled
|
||||
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: doubleValidationDialog.text
|
||||
}
|
||||
|
||||
Button {
|
||||
text: i18n.tr("Ok")
|
||||
color: UbuntuColors.green
|
||||
|
||||
onClicked: {
|
||||
validated()
|
||||
PopupUtils.close(doubleValidationDialog)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: cancelButton
|
||||
text: i18n.tr("Cancel")
|
||||
color: UbuntuColors.red
|
||||
onClicked: {
|
||||
canceled()
|
||||
PopupUtils.close(doubleValidationDialog)
|
||||
}
|
||||
}
|
||||
}
|
22
qml/dialogs/SuccessDialog.qml
Normal file
22
qml/dialogs/SuccessDialog.qml
Normal file
@ -0,0 +1,22 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Ubuntu.Components.Popups 1.3
|
||||
|
||||
Dialog {
|
||||
id: dialogSuccess
|
||||
|
||||
property string textSuccess
|
||||
|
||||
signal dialogClosed
|
||||
|
||||
title: i18n.tr("Success !")
|
||||
text: textSuccess
|
||||
Button {
|
||||
text: i18n.tr("OK")
|
||||
color: UbuntuColors.green
|
||||
onClicked: function () {
|
||||
dialogClosed()
|
||||
PopupUtils.close(dialogSuccess)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user