Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bantablemodel.h
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_BANTABLEMODEL_H | #ifndef BITCOIN_QT_BANTABLEMODEL_H | ||||
#define BITCOIN_QT_BANTABLEMODEL_H | #define BITCOIN_QT_BANTABLEMODEL_H | ||||
#include <net.h> | #include <net.h> | ||||
#include <QAbstractTableModel> | #include <QAbstractTableModel> | ||||
#include <QStringList> | #include <QStringList> | ||||
#include <memory> | #include <memory> | ||||
class ClientModel; | |||||
class BanTablePriv; | class BanTablePriv; | ||||
namespace interfaces { | namespace interfaces { | ||||
class Node; | class Node; | ||||
} | } | ||||
struct CCombinedBan { | struct CCombinedBan { | ||||
CSubNet subnet; | CSubNet subnet; | ||||
Show All 14 Lines | |||||
/** | /** | ||||
Qt model providing information about connected peers, similar to the | Qt model providing information about connected peers, similar to the | ||||
"getpeerinfo" RPC call. Used by the rpc console UI. | "getpeerinfo" RPC call. Used by the rpc console UI. | ||||
*/ | */ | ||||
class BanTableModel : public QAbstractTableModel { | class BanTableModel : public QAbstractTableModel { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit BanTableModel(interfaces::Node &node, | explicit BanTableModel(interfaces::Node &node, QObject *parent); | ||||
ClientModel *parent = nullptr); | |||||
~BanTableModel(); | ~BanTableModel(); | ||||
void startAutoRefresh(); | void startAutoRefresh(); | ||||
void stopAutoRefresh(); | void stopAutoRefresh(); | ||||
enum ColumnIndex { Address = 0, Bantime = 1 }; | enum ColumnIndex { Address = 0, Bantime = 1 }; | ||||
/** @name Methods overridden from QAbstractTableModel | /** @name Methods overridden from QAbstractTableModel | ||||
@{*/ | @{*/ | ||||
Show All 9 Lines | public: | ||||
bool shouldShow(); | bool shouldShow(); | ||||
/*@}*/ | /*@}*/ | ||||
public Q_SLOTS: | public Q_SLOTS: | ||||
void refresh(); | void refresh(); | ||||
private: | private: | ||||
interfaces::Node &m_node; | interfaces::Node &m_node; | ||||
ClientModel *clientModel; | |||||
QStringList columns; | QStringList columns; | ||||
std::unique_ptr<BanTablePriv> priv; | std::unique_ptr<BanTablePriv> priv; | ||||
}; | }; | ||||
#endif // BITCOIN_QT_BANTABLEMODEL_H | #endif // BITCOIN_QT_BANTABLEMODEL_H |