Commit b9c91fe8 authored by Martin Straka's avatar Martin Straka

Fixed conflicts and updated file dialog properties

parent 80fc03a4
......@@ -32,21 +32,22 @@ Dialog {
focus: true
modal: true
title: ""
title: "Select path"
standardButtons: (selectedFileIndex != -1) ? (Dialog.Ok | Dialog.Cancel) : Dialog.Cancel
/* Place the dialogue in the centre. */
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
x: 2*defaultMargin
y: 2*defaultMargin
height: parent.height / 2
width: parent.width / 2
height: parent.height - 4*defaultMargin
width: parent.width - 4*defaultMargin
signal finished(string path)
property int selectedFileIndex: -1
function raise() {
function raise(title) {
root.title = title
folderModel.folder = standardLocationUrl(InteractionFilesystem.DESKTOP_LOCATION)
root.open()
}
......
......@@ -114,7 +114,6 @@ ApplicationWindow {
/* Exposes nested stack to code outside the page component. */
property var nestedStack: null
/* Password/OTP input dialog, emitted from C++ */
InputDialogue {
id: inputDialog
......@@ -129,13 +128,6 @@ ApplicationWindow {
}
}
FileDialogue {
id: fileDialogue
onFinished: {
console.log("FileDialogue closed with '" + path + "'")
}
}
StackView { // Page area.
id: mainStack
anchors.fill: parent
......
......@@ -89,13 +89,10 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
fileDialogue.raise()
/*
pageView.push(pageAboutApp, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
*/
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
}
}
}
......
......@@ -44,6 +44,19 @@ Item {
accounts.getAccountData(userName)
}
}
FileDialogue {
id: fileDialogue
onFinished: {
if (path == "") {
certPathLabelId.visible = false
} else {
certPathLabelId.visible = true
certPathLabelId.text = path
}
}
}
PageHeader {
id: headerBar
title: qsTr("Add a new account")
......@@ -198,21 +211,6 @@ Item {
wrapMode: Text.WrapAnywhere
text: ""
}
FileDialog {
id: fileDialog
title: qsTr("Please choose a certificate file")
folder: shortcuts.home
nameFilters: [ qsTr("Cert file") + "(*.pem *.p12 *.pfx)"]
selectMultiple :false
onAccepted: {
certPathLabelId.text = fileDialog.fileUrl.toString()
fileDialog.close()
}
onRejected: {
fileDialog.close()
}
Component.onCompleted: visible = false
}
Button {
id: certPathButtonId
visible: false
......@@ -220,7 +218,7 @@ Item {
height: inputItemHeight
font.pointSize: defaultTextFont.font.pointSize
onClicked: {
fileDialog.open()
fileDialogue.raise("Select certificate file")
}
}
Text {
......
......@@ -242,9 +242,7 @@ bool Accounts::updateAccount(const QVariant &acntModelVariant,
}
acntData.setStoreToDisk(storeToDisk);
QUrl url(certPath, QUrl::TolerantMode);
url.toLocalFile();
acntData.setCertPath(url.toLocalFile());
acntData.setCertPath(certPath);
/* Model data have changed. */
emit AccountListModel::globAccounts.accountDataChanged(userName);
......@@ -286,9 +284,7 @@ bool Accounts::createAccount(const QVariant &acntModelVariant,
acntData.setTestAccount(isTestAccount);
acntData.setRememberPwd(rememberPwd);
acntData.setStoreToDisk(storeToDisk);
QUrl url(certPath, QUrl::TolerantMode);
url.toLocalFile();
acntData.setCertPath(url.toLocalFile());
acntData.setCertPath(certPath);
if (accountModel->addAccount(acntData) == -2) {
Dialogues::errorMessage(Dialogues::CRITICAL,
......
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