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
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