Commit 976ce35f authored by Martin Straka's avatar Martin Straka

Minor QML dialogue refactoring

parent fa352746
......@@ -46,9 +46,10 @@ Dialog {
property int selectedFileIndex: -1
function raise(title, filters) {
function raise(title, filters, showFiles) {
root.title = title
folderModel.folder = standardLocationUrl(InteractionFilesystem.DESKTOP_LOCATION)
folderModel.showFiles = showFiles
if (filters != "") {
folderModel.nameFilters = [filters]
}
......@@ -68,14 +69,13 @@ Dialog {
}
contentItem: ColumnLayout {
spacing: 6
spacing: formItemVerticalSpacing
ComboBox {
anchors {
left: parent.left;
right: parent.right;
}
textRole: "label"
model: ListModel {
ListElement { label: qsTr("Desktop"); value: "desktop" }
......@@ -85,9 +85,9 @@ Dialog {
var location = InteractionFilesystem.DESKTOP_LOCATION
if (model.get(currentIndex).value == "desktop") {
location = InteractionFilesystem.DESKTOP_LOCATION
} else if (model.get(currentIndex).value == "documents") {
} else if (model.get(currentIndex).value == "documents") {
location = InteractionFilesystem.DOCUMENTS_LOCATION
} else {
} else {
location = InteractionFilesystem.DESKTOP_LOCATION
}
folderModel.folder = standardLocationUrl(location)
......@@ -105,7 +105,6 @@ Dialog {
Button {
id: upButton
text: "<"
MouseArea {
anchors.fill: parent
onClicked: {
......
......@@ -220,7 +220,7 @@ Item {
height: inputItemHeight
font.pointSize: defaultTextFont.font.pointSize
onClicked: {
fileDialogue.raise("Select certificate file", "*.pem")
fileDialogue.raise("Select certificate file", "*.pem", true)
}
}
Text {
......
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