| 1085 | } |
| 1086 | |
| 1087 | void RPCConsole::startExecutor() |
| 1088 | { |
| 1089 | m_executor = new RPCExecutor(m_node); |
| 1090 | m_executor->moveToThread(&thread); |
| 1091 | |
| 1092 | // Replies from executor object must go to this object |
| 1093 | connect(m_executor, &RPCExecutor::reply, this, [this](int category, const QString& command) { |
| 1094 | // Remove "Executing…" message. |
| 1095 | ui->messagesWidget->undo(); |
| 1096 | message(category, command); |
| 1097 | scrollToEnd(); |
| 1098 | m_is_executing = false; |
| 1099 | }); |
| 1100 | |
| 1101 | // Make sure executor object is deleted in its own thread |
| 1102 | connect(&thread, &QThread::finished, m_executor, &RPCExecutor::deleteLater); |
| 1103 | |
| 1104 | // Default implementation of QThread::run() simply spins up an event loop in the thread, |
| 1105 | // which is what we want. |
| 1106 | thread.start(); |
| 1107 | QTimer::singleShot(0, m_executor, []() { |
| 1108 | util::ThreadRename("qt-rpcconsole"); |
| 1109 | }); |
| 1110 | } |
| 1111 | |
| 1112 | void RPCConsole::on_tabWidget_currentChanged(int index) |
| 1113 | { |