Skip to content

Commit ed6d17c

Browse files
committed
qml: UI only. Added initial custom datadir functionality without wiring
1 parent f3d251f commit ed6d17c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/qml/components/StorageLocations.qml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import QtQuick 2.15
66
import QtQuick.Controls 2.15
77
import QtQuick.Layouts 1.15
8+
import QtQuick.Dialogs 1.3
9+
10+
import org.bitcoincore.qt 1.0
11+
812
import "../controls"
913

1014
ColumnLayout {
@@ -25,5 +29,21 @@ ColumnLayout {
2529
ButtonGroup.group: group
2630
text: qsTr("Custom")
2731
description: qsTr("Choose the directory and storage device.")
32+
onClicked: fileDialog.open()
33+
}
34+
FileDialog {
35+
id: fileDialog
36+
selectFolder: true
37+
folder: optionsModel.getDefaultDataDirectory
38+
onAccepted: {
39+
optionsModel.setCustomDataDirString(fileDialog.fileUrls[0].toString())
40+
var customDataDir = fileDialog.fileUrl.toString();
41+
if (customDataDir !== "") {
42+
optionsModel.setCustomDataDirArgs(customDataDir);
43+
}
44+
}
45+
onRejected: {
46+
console.log("Custom datadir selection canceled")
47+
}
2848
}
2949
}

0 commit comments

Comments
 (0)