neobytes/src/qt/masternodelist.h

99 lines
2.5 KiB
C
Raw Normal View History

2016-05-11 13:09:31 +02:00
#ifndef MASTERNODELIST_H
#define MASTERNODELIST_H
#include "platformstyle.h"
#include "primitives/transaction.h"
2016-05-11 13:09:31 +02:00
#include "sync.h"
#include "util.h"
#include <evo/deterministicmns.h>
#include <QMenu>
2016-05-11 13:09:31 +02:00
#include <QTimer>
#include <QWidget>
2016-05-11 13:09:31 +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;
2016-05-11 13:09:31 +02:00
}
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);
2016-05-11 13:09:31 +02:00
~MasternodeList();
void setClientModel(ClientModel* clientModel);
void setWalletModel(WalletModel* walletModel);
void ShowQRCode(std::string strAlias);
2016-05-11 13:09:31 +02:00
void StartAlias(std::string strAlias);
void StartAll(std::string strCommand = "start-all");
CDeterministicMNCPtr GetSelectedDIP3MN();
2016-05-11 13:09:31 +02:00
private:
QMenu* contextMenu;
QMenu* contextMenuDIP3;
int64_t nTimeFilterUpdated;
int64_t nTimeFilterUpdatedDIP3;
bool fFilterUpdated;
bool fFilterUpdatedDIP3;
2016-05-11 13:09:31 +02:00
public Q_SLOTS:
void updateMyMasternodeInfo(QString strAlias, QString strAddr, const COutPoint& outpoint);
void updateMyNodeList(bool fForce = false);
2016-05-11 13:09:31 +02:00
void updateNodeList();
void updateDIP3List();
2016-05-11 13:09:31 +02:00
Q_SIGNALS:
void doubleClicked(const QModelIndex&);
2016-05-11 13:09:31 +02:00
private:
QTimer* timer;
Ui::MasternodeList* ui;
ClientModel* clientModel;
WalletModel* walletModel;
// Protects tableWidgetMasternodes
CCriticalSection cs_mnlist;
// Protects tableWidgetMyMasternodes
CCriticalSection cs_mymnlist;
// Protects tableWidgetMasternodesDIP3
CCriticalSection cs_dip3list;
2016-05-11 13:09:31 +02:00
QString strCurrentFilter;
QString strCurrentFilterDIP3;
2016-05-11 13:09:31 +02:00
private Q_SLOTS:
void showContextMenu(const QPoint&);
void showContextMenuDIP3(const QPoint&);
void on_filterLineEdit_textChanged(const QString& strFilterIn);
void on_filterLineEditDIP3_textChanged(const QString& strFilterIn);
void on_QRButton_clicked();
2016-05-11 13:09:31 +02:00
void on_startButton_clicked();
void on_startAllButton_clicked();
void on_startMissingButton_clicked();
void on_tableWidgetMyMasternodes_itemSelectionChanged();
2016-05-11 13:09:31 +02:00
void on_UpdateButton_clicked();
void on_extraInfoDIP3_clicked();
void on_copyProTxHash_clicked();
void on_copyCollateralOutpoint_clicked();
2016-05-11 13:09:31 +02:00
};
#endif // MASTERNODELIST_H