mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-22 19:49:34 +00:00
SettingsNode: keep local node running redesign
This commit is contained in:
parent
ecf5c501d6
commit
fdee509695
2 changed files with 78 additions and 13 deletions
55
main.qml
55
main.qml
|
@ -1420,6 +1420,7 @@ ApplicationWindow {
|
||||||
property bool autosave: true
|
property bool autosave: true
|
||||||
property int autosaveMinutes: 10
|
property int autosaveMinutes: 10
|
||||||
property bool pruneBlockchain: false
|
property bool pruneBlockchain: false
|
||||||
|
property int keepLocalNodeRunning: 2 //0 = stop local node, 1 = keep it running, 2 = always ask
|
||||||
|
|
||||||
property bool fiatPriceEnabled: false
|
property bool fiatPriceEnabled: false
|
||||||
property bool fiatPriceToggle: false
|
property bool fiatPriceToggle: false
|
||||||
|
@ -1603,7 +1604,25 @@ ApplicationWindow {
|
||||||
onRejectedCallback();
|
onRejectedCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StandardDialog {
|
||||||
|
z: parent.z + 1
|
||||||
|
id: localNodeRunningConfirmationDialog
|
||||||
|
closeVisible: false
|
||||||
|
property var onAcceptedCallback
|
||||||
|
property var onRejectedCallback
|
||||||
|
onRejected: {
|
||||||
|
//Stop local node
|
||||||
|
if (onRejectedCallback)
|
||||||
|
onRejectedCallback();
|
||||||
|
}
|
||||||
|
onAccepted: {
|
||||||
|
//Keep local node running
|
||||||
|
if (onAcceptedCallback)
|
||||||
|
onAcceptedCallback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MoneroComponents.UpdateDialog {
|
MoneroComponents.UpdateDialog {
|
||||||
id: updateDialog
|
id: updateDialog
|
||||||
|
|
||||||
|
@ -1845,7 +1864,7 @@ ApplicationWindow {
|
||||||
radius: 64
|
radius: 64
|
||||||
visible: passwordDialog.visible || inputDialog.visible || splash.visible || updateDialog.visible ||
|
visible: passwordDialog.visible || inputDialog.visible || splash.visible || updateDialog.visible ||
|
||||||
devicePassphraseDialog.visible || txConfirmationPopup.visible || successfulTxPopup.visible ||
|
devicePassphraseDialog.visible || txConfirmationPopup.visible || successfulTxPopup.visible ||
|
||||||
remoteNodeDialog.visible
|
remoteNodeDialog.visible || localNodeRunningConfirmationDialog.visible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2080,19 +2099,29 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDaemonIsRunningDialog(onClose) {
|
function showDaemonIsRunningDialog(onClose) {
|
||||||
// Show confirmation dialog
|
if (persistentSettings.keepLocalNodeRunning == 2) {
|
||||||
confirmationDialog.title = qsTr("Local node is running") + translationManager.emptyString;
|
// 2 = always ask
|
||||||
confirmationDialog.text = qsTr("Do you want to stop local node or keep it running in the background?") + translationManager.emptyString;
|
// Show confirmation dialog
|
||||||
confirmationDialog.icon = StandardIcon.Question;
|
localNodeRunningConfirmationDialog.title = qsTr("Local node is running") + translationManager.emptyString;
|
||||||
confirmationDialog.cancelText = qsTr("Force stop") + translationManager.emptyString;
|
localNodeRunningConfirmationDialog.closeVisible = false;
|
||||||
confirmationDialog.okText = qsTr("Keep it running") + translationManager.emptyString;
|
localNodeRunningConfirmationDialog.text = qsTr("Your local node is now running in the background. It is recommended to keep it running in order to help the network and to maintain your blockchain synchronized.") + translationManager.emptyString;
|
||||||
confirmationDialog.onAcceptedCallback = function() {
|
localNodeRunningConfirmationDialog.icon = StandardIcon.Question;
|
||||||
|
localNodeRunningConfirmationDialog.cancelText = qsTr("Stop local node") + translationManager.emptyString;
|
||||||
|
localNodeRunningConfirmationDialog.okText = qsTr("Keep it running") + translationManager.emptyString;
|
||||||
|
localNodeRunningConfirmationDialog.onAcceptedCallback = function() {
|
||||||
|
onClose();
|
||||||
|
}
|
||||||
|
localNodeRunningConfirmationDialog.onRejectedCallback = function() {
|
||||||
|
stopDaemon(onClose);
|
||||||
|
};
|
||||||
|
localNodeRunningConfirmationDialog.open();
|
||||||
|
} else if (persistentSettings.keepLocalNodeRunning == 1) {
|
||||||
|
//1 = keep local node running
|
||||||
onClose();
|
onClose();
|
||||||
}
|
} else if (persistentSettings.keepLocalNodeRunning == 0) {
|
||||||
confirmationDialog.onRejectedCallback = function() {
|
//0 = stop local node
|
||||||
stopDaemon(onClose);
|
stopDaemon(onClose);
|
||||||
};
|
}
|
||||||
confirmationDialog.open();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onClosing: {
|
onClosing: {
|
||||||
|
|
|
@ -307,6 +307,42 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 10
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: keepLocalNodeRunningColumn
|
||||||
|
z: parent.z + 1
|
||||||
|
|
||||||
|
MoneroComponents.Label {
|
||||||
|
id: keepLocalNodeRunningLabel
|
||||||
|
Layout.topMargin: 0
|
||||||
|
text: qsTr("When closing GUI wallet or connecting to a remote node") + translationManager.emptyString
|
||||||
|
fontBold: false
|
||||||
|
fontSize: 14
|
||||||
|
}
|
||||||
|
|
||||||
|
ListModel {
|
||||||
|
id: keepLocalNodeRunningListModel
|
||||||
|
ListElement { column1: "Stop local node"; }
|
||||||
|
ListElement { column1: "Keep local node running (recommended)"; }
|
||||||
|
ListElement { column1: "Always ask whether the node should be stopped"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
MoneroComponents.StandardDropdown {
|
||||||
|
id: keepLocalNodeRunningDropDown
|
||||||
|
dataModel: keepLocalNodeRunningListModel
|
||||||
|
itemTopMargin: 2
|
||||||
|
currentIndex: appWindow.persistentSettings.keepLocalNodeRunning;
|
||||||
|
onChanged: {
|
||||||
|
console.log("keepLocalNodeRunning changed: ",currentIndex);
|
||||||
|
appWindow.persistentSettings.keepLocalNodeRunning = currentIndex;
|
||||||
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredWidth: keepLocalNodeRunningColumn.width
|
||||||
|
z: parent.z + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MoneroComponents.LineEditMulti {
|
MoneroComponents.LineEditMulti {
|
||||||
id: daemonFlags
|
id: daemonFlags
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
Loading…
Reference in a new issue