qt, refactor: Move InitExecutor class into its own module
This change makes InitExecutor class re-usable by an alternative GUI, e.g., QML-based one.
This commit is contained in:
7 files changed
+136
-95
No files matched your search
+1
-28
@@ -10,13 +10,13 @@
|
||||
#endif
|
||||
|
||||
#include <interfaces/node.h>
|
||||
#include <qt/initexecutor.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QThread>
|
||||
|
||||
class BitcoinGUI;
|
||||
class ClientModel;
|
||||
@@ -29,33 +29,6 @@ class WalletController;
|
||||
class WalletModel;
|
||||
|
||||
|
||||
/** Class encapsulating Bitcoin Core startup and shutdown.
|
||||
* Allows running startup and shutdown in a different thread from the UI thread.
|
||||
*/
|
||||
class InitExecutor: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InitExecutor(interfaces::Node& node);
|
||||
~InitExecutor();
|
||||
|
||||
public Q_SLOTS:
|
||||
void initialize();
|
||||
void shutdown();
|
||||
|
||||
Q_SIGNALS:
|
||||
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
|
||||
void shutdownResult();
|
||||
void runawayException(const QString &message);
|
||||
|
||||
private:
|
||||
/// Pass fatal exception message to UI thread
|
||||
void handleRunawayException(const std::exception *e);
|
||||
|
||||
interfaces::Node& m_node;
|
||||
QThread m_thread;
|
||||
};
|
||||
|
||||
/** Main Bitcoin application object */
|
||||
class BitcoinApplication: public QApplication
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user