Merge pull request #322

f94782f daemon startup flags (Jaquee)
This commit is contained in:
Riccardo Spagni 2016-12-21 21:54:47 +02:00
commit 7b049bbae9
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
6 changed files with 54 additions and 8 deletions

View file

@ -91,7 +91,7 @@ Window {
KeyNavigation.tab: cancelButton KeyNavigation.tab: cancelButton
onClicked: { onClicked: {
root.close() root.close()
appWindow.startDaemon(); appWindow.startDaemon(daemonFlags.text);
root.started() 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(); onWalletUpdate();
} }
function startDaemon(){ function startDaemon(flags){
appWindow.showProcessingSplash(qsTr("Waiting for daemon to start...")) appWindow.showProcessingSplash(qsTr("Waiting for daemon to start..."))
daemonManager.start(); daemonManager.start(flags);
persistentSettings.daemonFlags = flags
} }
function stopDaemon(){ function stopDaemon(){
@ -714,6 +715,7 @@ ApplicationWindow {
property int restore_height : 0 property int restore_height : 0
property bool is_recovering : false property bool is_recovering : false
property bool customDecorations : true property bool customDecorations : true
property string daemonFlags
} }
// Information dialog // Information dialog

View file

@ -299,7 +299,7 @@ Rectangle {
releasedColor: "#FF6C3C" releasedColor: "#FF6C3C"
pressedColor: "#FF4304" pressedColor: "#FF4304"
onClicked: { 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 { RowLayout {
CheckBox { CheckBox {
id: customDecorationsCheckBox id: customDecorationsCheckBox

View file

@ -433,7 +433,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
textFormat: Text.RichText 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; return m_instance;
} }
bool DaemonManager::start() bool DaemonManager::start(const QString &flags)
{ {
// //
QString process; QString process;
@ -43,9 +43,18 @@ bool DaemonManager::start()
QStringList arguments; QStringList arguments;
foreach (const QString &str, m_clArgs) { foreach (const QString &str, m_clArgs) {
qDebug() << QString(" [%1] ").arg(str); qDebug() << QString(" [%1] ").arg(str);
if (!str.isEmpty())
arguments << str; 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() << "starting monerod " + process;
qDebug() << "With command line arguments " << arguments; qDebug() << "With command line arguments " << arguments;

View file

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