daemon startup flags

This commit is contained in:
Jaquee 2016-12-21 14:30:15 +01:00
parent 7555502d64
commit f94782fecf
No known key found for this signature in database
GPG Key ID: 384E52B09F45DC39
6 changed files with 54 additions and 8 deletions

View File

@ -91,7 +91,7 @@ Window {
KeyNavigation.tab: cancelButton
onClicked: {
root.close()
appWindow.startDaemon();
appWindow.startDaemon(daemonFlags.text);
root.started()
}
}
@ -112,6 +112,24 @@ Window {
}
}
}
RowLayout {
id: advancedRow
MoneroComponents.Label {
id: daemonFlagsLabel
color: "#4A4949"
text: qsTr("Daemon startup flags") + translationManager.emptyString
fontSize: 16
}
MoneroComponents.LineEdit {
id: daemonFlags
Layout.preferredWidth: 200
Layout.fillWidth: true
text: appWindow.persistentSettings.daemonFlags;
placeholderText: qsTr("(optional)")
}
}
}
}

View File

@ -341,9 +341,10 @@ ApplicationWindow {
onWalletUpdate();
}
function startDaemon(){
function startDaemon(flags){
appWindow.showProcessingSplash(qsTr("Waiting for daemon to start..."))
daemonManager.start();
daemonManager.start(flags);
persistentSettings.daemonFlags = flags
}
function stopDaemon(){
@ -714,6 +715,7 @@ ApplicationWindow {
property int restore_height : 0
property bool is_recovering : false
property bool customDecorations : true
property string daemonFlags
}
// Information dialog

View File

@ -299,7 +299,7 @@ Rectangle {
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
onClicked: {
appWindow.startDaemon()
appWindow.startDaemon(daemonFlags.text)
}
}
@ -335,6 +335,23 @@ Rectangle {
}
RowLayout {
id: daemonFlagsRow
Label {
id: daemonFlagsLabel
color: "#4A4949"
text: qsTr("Daemon startup flags") + translationManager.emptyString
fontSize: 16
}
LineEdit {
id: daemonFlags
Layout.preferredWidth: 200
Layout.fillWidth: true
text: appWindow.persistentSettings.daemonFlags;
placeholderText: qsTr("(optional)") + translationManager.emptyString
}
}
RowLayout {
CheckBox {
id: customDecorationsCheckBox

View File

@ -433,7 +433,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
textFormat: Text.RichText
onLinkActivated: { appWindow.startDaemon(); }
onLinkActivated: { appWindow.startDaemon(appWindow.persistentSettings.daemonFlags); }
}
}

View File

@ -23,7 +23,7 @@ DaemonManager *DaemonManager::instance(const QStringList *args)
return m_instance;
}
bool DaemonManager::start()
bool DaemonManager::start(const QString &flags)
{
//
QString process;
@ -43,9 +43,18 @@ bool DaemonManager::start()
QStringList arguments;
foreach (const QString &str, m_clArgs) {
qDebug() << QString(" [%1] ").arg(str);
arguments << str;
if (!str.isEmpty())
arguments << str;
}
// Custom startup flags for daemon
foreach (const QString &str, flags.split(" ")) {
qDebug() << QString(" [%1] ").arg(str);
if (!str.isEmpty())
arguments << str;
}
qDebug() << "starting monerod " + process;
qDebug() << "With command line arguments " << arguments;

View File

@ -13,7 +13,7 @@ public:
static DaemonManager * instance(const QStringList *args);
Q_INVOKABLE bool start();
Q_INVOKABLE bool start(const QString &flags);
Q_INVOKABLE bool stop();
// return true if daemon process is started