forked from Public/monero-gui
Add blockchain folder FileDialog
This commit is contained in:
52
main.qml
52
main.qml
@@ -1022,6 +1022,58 @@ ApplicationWindow {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Choose blockchain folder
|
||||||
|
FileDialog {
|
||||||
|
id: blockchainFileDialog
|
||||||
|
title: "Please choose a folder"
|
||||||
|
selectFolder: true
|
||||||
|
folder: "file://" + persistentSettings.blockchainDataDir
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
var dataDir = walletManager.urlToLocalPath(blockchainFileDialog.fileUrl)
|
||||||
|
var validator = daemonManager.validateDataDir(dataDir);
|
||||||
|
if(!validator.valid) {
|
||||||
|
|
||||||
|
confirmationDialog.title = qsTr("Warning") + translationManager.emptyString;
|
||||||
|
confirmationDialog.text = "";
|
||||||
|
if(validator.readOnly)
|
||||||
|
confirmationDialog.text += qsTr("Error: Filesystem is read only") + "\n\n"
|
||||||
|
if(validator.storageAvailable < 20)
|
||||||
|
confirmationDialog.text += qsTr("Warning: There's only %1 GB available on the device. Blockchain requires ~%30 GB of data.").arg(validator.storageAvailable).arg(15) + "\n\n"
|
||||||
|
else
|
||||||
|
confirmationDialog.text += qsTr("Note: There's %1 GB available on the device. Blockchain requires ~%30 GB of data.").arg(validator.storageAvailable).arg(15) + "\n\n"
|
||||||
|
if(!validator.lmdbExists)
|
||||||
|
confirmationDialog.text += qsTr("Note: lmdb folder not found. A new folder will be created.") + "\n\n"
|
||||||
|
|
||||||
|
|
||||||
|
confirmationDialog.icon = StandardIcon.Question
|
||||||
|
confirmationDialog.cancelText = qsTr("Cancel")
|
||||||
|
|
||||||
|
// Continue
|
||||||
|
confirmationDialog.onAcceptedCallback = function() {
|
||||||
|
persistentSettings.blockchainDataDir = dataDir
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cancel
|
||||||
|
confirmationDialog.onRejectedCallback = function() {
|
||||||
|
};
|
||||||
|
|
||||||
|
confirmationDialog.open()
|
||||||
|
} else {
|
||||||
|
persistentSettings.blockchainDataDir = dataDir
|
||||||
|
}
|
||||||
|
|
||||||
|
delete validator;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
onRejected: {
|
||||||
|
console.log("data dir selection canceled")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PasswordDialog {
|
PasswordDialog {
|
||||||
id: passwordDialog
|
id: passwordDialog
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user