mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-09 12:30:10 +00:00
Merge pull request #1091
89ec822
removed persistentSettings.startLocalNode as it's synonym for !persistentSettings.useRemoteNodeaf882e8
rectified visual switch between local node & remote nodefd1f4bf
Bootstrap daemon (requires #3165)
This commit is contained in:
commit
2deff0611d
5 changed files with 61 additions and 12 deletions
6
main.qml
6
main.qml
|
@ -436,7 +436,7 @@ ApplicationWindow {
|
|||
if(localNodeConnected) {
|
||||
leftPanel.progressBar.updateProgress(walletManager.blockchainHeight(),walletManager.blockchainTargetHeight(), 0, qsTr("Remaining blocks (local node):"));
|
||||
leftPanel.progressBar.visible = true
|
||||
} else if (persistentSettings.startLocalNode && !startLocalNodeCancelled) {
|
||||
} else if (!persistentSettings.useRemoteNode && !startLocalNodeCancelled) {
|
||||
daemonManagerDialog.open()
|
||||
}
|
||||
|
||||
|
@ -478,7 +478,7 @@ ApplicationWindow {
|
|||
currentWallet.pauseRefresh();
|
||||
|
||||
appWindow.showProcessingSplash(qsTr("Waiting for daemon to start..."))
|
||||
daemonManager.start(flags, persistentSettings.testnet, persistentSettings.blockchainDataDir);
|
||||
daemonManager.start(flags, persistentSettings.testnet, persistentSettings.blockchainDataDir, persistentSettings.bootstrapNodeAddress);
|
||||
persistentSettings.daemonFlags = flags
|
||||
}
|
||||
|
||||
|
@ -1004,9 +1004,9 @@ ApplicationWindow {
|
|||
property string daemonPassword: ""
|
||||
property bool transferShowAdvanced: false
|
||||
property string blockchainDataDir: ""
|
||||
property bool startLocalNode: true
|
||||
property bool useRemoteNode: false
|
||||
property string remoteNodeAddress: ""
|
||||
property string bootstrapNodeAddress: ""
|
||||
}
|
||||
|
||||
// Information dialog
|
||||
|
|
|
@ -248,7 +248,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
GridLayout {
|
||||
visible: !isMobile
|
||||
visible: !isMobile && !persistentSettings.useRemoteNode
|
||||
id: daemonStatusRow
|
||||
columns: (isMobile) ? 2 : 4
|
||||
StandardButton {
|
||||
|
@ -260,6 +260,9 @@ Rectangle {
|
|||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
onClicked: {
|
||||
// Update bootstrap daemon address
|
||||
persistentSettings.bootstrapNodeAddress = bootstrapNodeEdit.daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
|
||||
|
||||
// Set current daemon address to local
|
||||
appWindow.currentDaemonAddress = appWindow.localDaemonAddress
|
||||
appWindow.startDaemon(daemonFlags.text)
|
||||
|
@ -296,7 +299,7 @@ Rectangle {
|
|||
|
||||
ColumnLayout {
|
||||
id: blockchainFolderRow
|
||||
visible: !isMobile
|
||||
visible: !isMobile && !persistentSettings.useRemoteNode
|
||||
Label {
|
||||
id: blockchainFolderLabel
|
||||
color: "#4A4949"
|
||||
|
@ -325,7 +328,7 @@ Rectangle {
|
|||
|
||||
|
||||
RowLayout {
|
||||
visible: daemonAdvanced.checked && !isMobile
|
||||
visible: daemonAdvanced.checked && !isMobile && !persistentSettings.useRemoteNode
|
||||
id: daemonFlagsRow
|
||||
Label {
|
||||
id: daemonFlagsLabel
|
||||
|
@ -343,7 +346,7 @@ Rectangle {
|
|||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
visible: daemonAdvanced.checked || isMobile
|
||||
visible: (daemonAdvanced.checked || isMobile) && persistentSettings.useRemoteNode
|
||||
Label {
|
||||
id: daemonLoginLabel
|
||||
Layout.fillWidth: true
|
||||
|
@ -354,7 +357,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
ColumnLayout {
|
||||
visible: daemonAdvanced.checked || isMobile
|
||||
visible: (daemonAdvanced.checked || isMobile) && persistentSettings.useRemoteNode
|
||||
LineEdit {
|
||||
id: daemonUsername
|
||||
Layout.preferredWidth: 100 * scaleRatio
|
||||
|
@ -374,6 +377,26 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
visible: persistentSettings.startLocalNode
|
||||
ColumnLayout {
|
||||
Label {
|
||||
color: "#4A4949"
|
||||
text: qsTr("Bootstrap node (leave blank if not wanted)") + translationManager.emptyString
|
||||
}
|
||||
RemoteNodeEdit {
|
||||
id: bootstrapNodeEdit
|
||||
Layout.minimumWidth: 100 * scaleRatio
|
||||
daemonAddrText: persistentSettings.bootstrapNodeAddress.split(":")[0].trim()
|
||||
daemonPortText: (persistentSettings.bootstrapNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.bootstrapNodeAddress.split(":")[1]
|
||||
onEditingFinished: {
|
||||
persistentSettings.bootstrapNodeAddress = daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
|
||||
console.log("setting bootstrap node to " + persistentSettings.bootstrapNodeAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
visible: persistentSettings.useRemoteNode
|
||||
ColumnLayout {
|
||||
|
|
|
@ -32,7 +32,7 @@ DaemonManager *DaemonManager::instance(const QStringList *args)
|
|||
return m_instance;
|
||||
}
|
||||
|
||||
bool DaemonManager::start(const QString &flags, bool testnet, const QString &dataDir)
|
||||
bool DaemonManager::start(const QString &flags, bool testnet, const QString &dataDir, const QString &bootstrapNodeAddress)
|
||||
{
|
||||
// prepare command line arguments and pass to monerod
|
||||
QStringList arguments;
|
||||
|
@ -67,6 +67,11 @@ bool DaemonManager::start(const QString &flags, bool testnet, const QString &dat
|
|||
arguments << dataDir;
|
||||
}
|
||||
|
||||
// Bootstrap node address
|
||||
if(!bootstrapNodeAddress.isEmpty()) {
|
||||
arguments << "--bootstrap-daemon-address" << bootstrapNodeAddress;
|
||||
}
|
||||
|
||||
arguments << "--check-updates" << "disabled";
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public:
|
|||
|
||||
static DaemonManager * instance(const QStringList *args);
|
||||
|
||||
Q_INVOKABLE bool start(const QString &flags, bool testnet, const QString &dataDir = "");
|
||||
Q_INVOKABLE bool start(const QString &flags, bool testnet, const QString &dataDir = "", const QString &bootstrapNodeAddress = "");
|
||||
Q_INVOKABLE bool stop(bool testnet);
|
||||
|
||||
// return true if daemon process is started
|
||||
|
|
|
@ -54,8 +54,8 @@ ColumnLayout {
|
|||
|
||||
function onPageClosed(settingsObject) {
|
||||
appWindow.persistentSettings.useRemoteNode = remoteNode.checked
|
||||
appWindow.persistentSettings.startLocalNode = localNode.checked
|
||||
appWindow.persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
||||
appWindow.persistentSettings.bootstrapNodeAddress = bootstrapNodeEdit.daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -129,8 +129,12 @@ ColumnLayout {
|
|||
fontSize: 16 * scaleRatio
|
||||
checkedIcon: "../images/checkedVioletIcon.png"
|
||||
uncheckedIcon: "../images/uncheckedIcon.png"
|
||||
checked: appWindow.persistentSettings.startLocalNode && !isAndroid && !isIOS
|
||||
checked: !appWindow.persistentSettings.useRemoteNode && !isAndroid && !isIOS
|
||||
visible: !isAndroid && !isIOS
|
||||
onClicked: {
|
||||
checked = true;
|
||||
remoteNode.checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,6 +166,19 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20 * scaleRatio
|
||||
fontSize: 14 * scaleRatio
|
||||
text: qsTr("Bootstrap node (leave blank if not wanted)") + translationManager.emptyString
|
||||
}
|
||||
RemoteNodeEdit {
|
||||
Layout.minimumWidth: 300 * scaleRatio
|
||||
opacity: localNode.checked
|
||||
id: bootstrapNodeEdit
|
||||
daemonAddrText: persistentSettings.bootstrapNodeAddress.split(":")[0].trim()
|
||||
daemonPortText: (persistentSettings.bootstrapNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.bootstrapNodeAddress.split(":")[1]
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
@ -176,6 +193,10 @@ ColumnLayout {
|
|||
checkedIcon: "../images/checkedVioletIcon.png"
|
||||
uncheckedIcon: "../images/uncheckedIcon.png"
|
||||
checked: appWindow.persistentSettings.useRemoteNode
|
||||
onClicked: {
|
||||
checked = true
|
||||
localNode.checked = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue