mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
right-click to start alias in "My Masternodes" sub-tab
This commit is contained in:
parent
43cd805282
commit
16c20006ca
@ -48,6 +48,14 @@ MasternodeList::MasternodeList(const PlatformStyle *platformStyle, QWidget *pare
|
||||
ui->tableWidgetMasternodes->setColumnWidth(3, columnActiveWidth);
|
||||
ui->tableWidgetMasternodes->setColumnWidth(4, columnLastSeenWidth);
|
||||
|
||||
ui->tableWidgetMyMasternodes->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
QAction *startAliasAction = new QAction(tr("Start alias"), this);
|
||||
contextMenu = new QMenu();
|
||||
contextMenu->addAction(startAliasAction);
|
||||
connect(ui->tableWidgetMyMasternodes, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&)));
|
||||
connect(startAliasAction, SIGNAL(triggered()), this, SLOT(on_startButton_clicked()));
|
||||
|
||||
timer = new QTimer(this);
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(updateNodeList()));
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(updateMyNodeList()));
|
||||
@ -76,8 +84,14 @@ void MasternodeList::setWalletModel(WalletModel *model)
|
||||
this->walletModel = model;
|
||||
}
|
||||
|
||||
void MasternodeList::StartAlias(std::string strAlias) {
|
||||
void MasternodeList::showContextMenu(const QPoint &point)
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidgetMyMasternodes->itemAt(point);
|
||||
if(item) contextMenu->exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void MasternodeList::StartAlias(std::string strAlias)
|
||||
{
|
||||
std::string statusObj;
|
||||
statusObj += "<center>Alias: " + strAlias;
|
||||
|
||||
@ -106,8 +120,8 @@ void MasternodeList::StartAlias(std::string strAlias) {
|
||||
msg.exec();
|
||||
}
|
||||
|
||||
void MasternodeList::StartAll(std::string strCommand) {
|
||||
|
||||
void MasternodeList::StartAll(std::string strCommand)
|
||||
{
|
||||
int total = 0;
|
||||
int successful = 0;
|
||||
int fail = 0;
|
||||
|
@ -6,8 +6,9 @@
|
||||
#include "sync.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMenu>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
#define MASTERNODELIST_UPDATE_SECONDS 5
|
||||
#define MY_MASTERNODELIST_UPDATE_SECONDS 60
|
||||
@ -37,6 +38,9 @@ public:
|
||||
void StartAlias(std::string strAlias);
|
||||
void StartAll(std::string strCommand = "start-all");
|
||||
|
||||
private:
|
||||
QMenu *contextMenu;
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateMyMasternodeInfo(QString alias, QString addr, QString privkey, QString txHash, QString txIndex, CMasternode *pmn);
|
||||
void updateMyNodeList(bool reset = false);
|
||||
@ -53,6 +57,7 @@ private:
|
||||
QString strCurrentFilter;
|
||||
|
||||
private Q_SLOTS:
|
||||
void showContextMenu(const QPoint &);
|
||||
void on_filterLineEdit_textChanged(const QString &filterString);
|
||||
void on_startButton_clicked();
|
||||
void on_startAllButton_clicked();
|
||||
|
Loading…
Reference in New Issue
Block a user