mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 03:59:38 +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
47
main.qml
47
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
|
||||||
|
@ -1604,6 +1605,24 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
if (persistentSettings.keepLocalNodeRunning == 2) {
|
||||||
|
// 2 = always ask
|
||||||
// Show confirmation dialog
|
// Show confirmation dialog
|
||||||
confirmationDialog.title = qsTr("Local node is running") + translationManager.emptyString;
|
localNodeRunningConfirmationDialog.title = qsTr("Local node is running") + translationManager.emptyString;
|
||||||
confirmationDialog.text = qsTr("Do you want to stop local node or keep it running in the background?") + translationManager.emptyString;
|
localNodeRunningConfirmationDialog.closeVisible = false;
|
||||||
confirmationDialog.icon = StandardIcon.Question;
|
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.cancelText = qsTr("Force stop") + translationManager.emptyString;
|
localNodeRunningConfirmationDialog.icon = StandardIcon.Question;
|
||||||
confirmationDialog.okText = qsTr("Keep it running") + translationManager.emptyString;
|
localNodeRunningConfirmationDialog.cancelText = qsTr("Stop local node") + translationManager.emptyString;
|
||||||
confirmationDialog.onAcceptedCallback = function() {
|
localNodeRunningConfirmationDialog.okText = qsTr("Keep it running") + translationManager.emptyString;
|
||||||
|
localNodeRunningConfirmationDialog.onAcceptedCallback = function() {
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
confirmationDialog.onRejectedCallback = function() {
|
localNodeRunningConfirmationDialog.onRejectedCallback = function() {
|
||||||
stopDaemon(onClose);
|
stopDaemon(onClose);
|
||||||
};
|
};
|
||||||
confirmationDialog.open();
|
localNodeRunningConfirmationDialog.open();
|
||||||
|
} else if (persistentSettings.keepLocalNodeRunning == 1) {
|
||||||
|
//1 = keep local node running
|
||||||
|
onClose();
|
||||||
|
} else if (persistentSettings.keepLocalNodeRunning == 0) {
|
||||||
|
//0 = stop local node
|
||||||
|
stopDaemon(onClose);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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