1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-06-24 22:42:28 +00:00

Some ui improvements

This commit is contained in:
2025-01-28 10:17:57 +01:00
parent 7a2b12419d
commit 630d707190
13 changed files with 133 additions and 67 deletions

View File

@ -38,29 +38,34 @@ Page {
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
Text {
text: i18n.tr("No password found")
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: theme.palette.normal.backgroundText
}
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
Text {
text: i18n.tr("You can import a password store by cloning or")
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: theme.palette.normal.backgroundText
}
Text {
text: i18n.tr("importing a password store zip in the settings")
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: theme.palette.normal.backgroundText
}
}

View File

@ -29,9 +29,11 @@ Page {
anchors.rightMargin: units.gu(2)
spacing: units.gu(1)
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
Button {

View File

@ -29,12 +29,14 @@ Page {
console.log("Charged");
console.log(importKeyFilePage.activeTransfer.items[0].url);
var status = Pass.importGPGKey(importKeyFilePage.activeTransfer.items[0].url);
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
if (status)
Pass.importGPGKeySucceed.connect(function() {
importKeyFilePage.activeTransfer = null;
PopupUtils.open(dialogImportKeyPageSucess);
else
});
Pass.importGPGKeyFailed.connect(function(message) {
importKeyFilePage.activeTransfer = null;
PopupUtils.open(dialogImportKeyPageError);
importKeyFilePage.activeTransfer = null;
});
}
});
}

View File

@ -13,16 +13,6 @@ Page {
property var activeTransfer
Component.onCompleted: {
Utils.unzipSucceed.connect(function() {
PopupUtils.open(dialogImportZipPageSuccess);
// Utils.rmFile(importZipPage.activeTransfer.items[0].url);
importZipPage.activeTransfer = null;
});
Utils.unzipFailed.connect(function(message) {
PopupUtils.open(dialogImportZipPageError);
// Utils.rmFile(importZipPage.activeTransfer.items[0].url);
importZipPage.activeTransfer = null;
});
PopupUtils.open(importZipPageImportValidation, importZipPage);
}
@ -43,6 +33,14 @@ Page {
console.log("Charged");
console.log(importZipPage.activeTransfer.items[0].url);
var status = Utils.unzip(importZipPage.activeTransfer.items[0].url, Pass.getPasswordStore());
Utils.unzipSucceed.connect(function() {
importZipPage.activeTransfer = null;
PopupUtils.open(dialogImportZipPageSuccess);
});
Utils.unzipFailed.connect(function(message) {
importZipPage.activeTransfer = null;
PopupUtils.open(dialogImportZipPageError);
});
}
});
}

View File

@ -8,12 +8,15 @@ import QtQuick 2.4
Page {
id: infoKeysPage
property QtObject currentKey
property list<QtObject> __keys
property QtObject __currentKey
Component.onCompleted: {
Pass.getAllGPGKeysSucceed.connect(function(keys_info) {
infoKeysListView.model = keys_info;
infoKeysPage.__keys = keys_info;
for (var i = 0; i < keys_info.length; ++i) {
console.debug("is secret " + keys_info[i].isSecret)
}
});
Pass.getAllGPGKeysFailed.connect(function(message) {
PopupUtils.open(infoKeysPageGetAllError);
@ -27,6 +30,30 @@ Page {
Pass.getAllGPGKeys();
}
Column {
anchors.top: infoKeysHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.rightMargin: units.gu(2)
visible: infoKeysPage.__keys.length === 0
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
Text {
text: i18n.tr("No key found")
width: parent.width
horizontalAlignment: Text.AlignHCenter
color: theme.palette.normal.backgroundText
}
}
ListView {
id: infoKeysListView
@ -36,6 +63,8 @@ Page {
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.rightMargin: units.gu(2)
visible: infoKeysPage.__keys.length !== 0
model: infoKeysPage.__keys
delegate: Grid {
columns: 1
@ -79,6 +108,7 @@ Page {
userIdsModel.append({
"model": model.modelData.userIds[i]
});
}
}
}
@ -117,7 +147,7 @@ Page {
text: i18n.tr("Delete this key")
color: theme.palette.normal.negative
onClicked: {
infoKeysPage.currentKey = model.modelData;
infoKeysPage.__currentKey = model.modelData;
PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage);
}
}
@ -136,11 +166,11 @@ Page {
id: infoKeysPageDeleteValidation
SimpleValidationDialog {
text: i18n.tr("You're are about to delete<br>%1.<br>Continue ?").arg(infoKeysPage.currentKey.uid)
text: i18n.tr("You're are about to delete<br>%1.<br>Continue ?").arg(infoKeysPage.__currentKey.uid)
continueText: i18n.tr("Yes")
continueColor: theme.palette.normal.negative
onValidated: {
var status = Pass.deleteGPGKey(infoKeysPage.currentKey);
var status = Pass.deleteGPGKey(infoKeysPage.__currentKey);
}
}

View File

@ -63,7 +63,7 @@ Page {
verticalAlignment: Text.AlignVCenter
width: parent.width
height: units.gu(4)
color: LomiriColors.red
color: theme.palette.normal.negative
text: i18n.tr('Warning: importing delete any exiting Password Store')
}

View File

@ -14,6 +14,7 @@ Column {
verticalAlignment: Text.AlignVCenter
width: parent.width
text: i18n.tr('Repo Url')
color: theme.palette.normal.backgroundText
}
TextField {
@ -22,6 +23,13 @@ Column {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
placeholderText: "http(s)://<hostname>"
}
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
Button {

View File

@ -14,6 +14,7 @@ Column {
verticalAlignment: Text.AlignVCenter
width: parent.width
text: i18n.tr('Repo Url')
color: theme.palette.normal.backgroundText
}
TextField {
@ -22,6 +23,7 @@ Column {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
placeholderText: "http(s)://<username>@<hostname>"
}
Text {
@ -31,6 +33,7 @@ Column {
verticalAlignment: Text.AlignVCenter
width: parent.width
text: i18n.tr('Password')
color: theme.palette.normal.backgroundText
}
TextField {
@ -40,6 +43,13 @@ Column {
verticalAlignment: Text.AlignVCenter
width: parent.width
echoMode: TextInput.Password
placeholderText: i18n.tr('Password')
}
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
Button {

View File

@ -33,6 +33,7 @@ Page {
Rectangle {
width: parent.width
height: units.gu(1)
color: theme.palette.normal.background
}
GitModeOptionSelector {