Skip to content

Commit

Permalink
qml: UI only. Added FileDialog and the initial custom datadir functio…
Browse files Browse the repository at this point in the history
…nality without wiring
  • Loading branch information
D33r-Gee committed Mar 27, 2024
1 parent f3d251f commit b06ce79
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/qml/components/StorageLocations.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Dialogs 1.3

import org.bitcoincore.qt 1.0

import "../controls"

ColumnLayout {
Expand All @@ -25,5 +29,21 @@ ColumnLayout {
ButtonGroup.group: group
text: qsTr("Custom")
description: qsTr("Choose the directory and storage device.")
onClicked: fileDialog.open()
}
FileDialog {
id: fileDialog
selectFolder: true
folder: optionsModel.getDefaultDataDirectory
onAccepted: {
optionsModel.setCustomDataDirString(fileDialog.fileUrls[0].toString())
var customDataDir = fileDialog.fileUrl.toString();
if (customDataDir !== "") {
optionsModel.setCustomDataDirArgs(customDataDir);
}
}
onRejected: {
console.log("Custom datadir selection canceled")
}
}
}
}

0 comments on commit b06ce79

Please sign in to comment.