2016-05-11 13:09:31 +02:00
|
|
|
#ifndef MASTERNODELIST_H
|
|
|
|
#define MASTERNODELIST_H
|
|
|
|
|
2017-09-11 16:13:48 +02:00
|
|
|
#include "primitives/transaction.h"
|
2016-05-11 13:09:31 +02:00
|
|
|
#include "platformstyle.h"
|
|
|
|
#include "sync.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
2016-05-20 15:15:02 +02:00
|
|
|
#include <QMenu>
|
2016-05-11 13:09:31 +02:00
|
|
|
#include <QTimer>
|
2016-05-20 15:15:02 +02:00
|
|
|
#include <QWidget>
|
2016-05-11 13:09:31 +02:00
|
|
|
|
2016-08-05 18:47:59 +02:00
|
|
|
#define MY_MASTERNODELIST_UPDATE_SECONDS 60
|
|
|
|
#define MASTERNODELIST_UPDATE_SECONDS 15
|
|
|
|
#define MASTERNODELIST_FILTER_COOLDOWN_SECONDS 3
|
2016-05-11 13:09:31 +02:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MasternodeList;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ClientModel;
|
|
|
|
class WalletModel;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QModelIndex;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
/** Masternode Manager page widget */
|
|
|
|
class MasternodeList : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MasternodeList(const PlatformStyle *platformStyle, QWidget *parent = 0);
|
|
|
|
~MasternodeList();
|
|
|
|
|
|
|
|
void setClientModel(ClientModel *clientModel);
|
|
|
|
void setWalletModel(WalletModel *walletModel);
|
|
|
|
void StartAlias(std::string strAlias);
|
|
|
|
void StartAll(std::string strCommand = "start-all");
|
|
|
|
|
2016-05-20 15:15:02 +02:00
|
|
|
private:
|
|
|
|
QMenu *contextMenu;
|
2016-09-04 03:48:23 +02:00
|
|
|
int64_t nTimeFilterUpdated;
|
2016-08-05 18:47:59 +02:00
|
|
|
bool fFilterUpdated;
|
2016-05-20 15:15:02 +02:00
|
|
|
|
2016-05-11 13:09:31 +02:00
|
|
|
public Q_SLOTS:
|
2017-09-11 16:13:48 +02:00
|
|
|
void updateMyMasternodeInfo(QString strAlias, QString strAddr, const COutPoint& outpoint);
|
2016-09-04 03:48:23 +02:00
|
|
|
void updateMyNodeList(bool fForce = false);
|
2016-05-11 13:09:31 +02:00
|
|
|
void updateNodeList();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTimer *timer;
|
|
|
|
Ui::MasternodeList *ui;
|
|
|
|
ClientModel *clientModel;
|
|
|
|
WalletModel *walletModel;
|
2017-02-10 01:56:52 +01:00
|
|
|
|
|
|
|
// Protects tableWidgetMasternodes
|
|
|
|
CCriticalSection cs_mnlist;
|
|
|
|
|
|
|
|
// Protects tableWidgetMyMasternodes
|
|
|
|
CCriticalSection cs_mymnlist;
|
|
|
|
|
2016-05-11 13:09:31 +02:00
|
|
|
QString strCurrentFilter;
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
2016-05-20 15:15:02 +02:00
|
|
|
void showContextMenu(const QPoint &);
|
2016-09-04 03:48:23 +02:00
|
|
|
void on_filterLineEdit_textChanged(const QString &strFilterIn);
|
2016-05-11 13:09:31 +02:00
|
|
|
void on_startButton_clicked();
|
|
|
|
void on_startAllButton_clicked();
|
|
|
|
void on_startMissingButton_clicked();
|
2016-05-15 18:39:42 +02:00
|
|
|
void on_tableWidgetMyMasternodes_itemSelectionChanged();
|
2016-05-11 13:09:31 +02:00
|
|
|
void on_UpdateButton_clicked();
|
|
|
|
};
|
|
|
|
#endif // MASTERNODELIST_H
|