|
|
@ -10,10 +10,9 @@ |
|
|
|
#include "peertablemodel.h" |
|
|
|
#include "peertablemodel.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "main.h" |
|
|
|
#include "main.h" |
|
|
|
#include "util.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "rpcserver.h" |
|
|
|
#include "rpcserver.h" |
|
|
|
#include "rpcclient.h" |
|
|
|
#include "rpcclient.h" |
|
|
|
|
|
|
|
#include "util.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "json/json_spirit_value.h" |
|
|
|
#include "json/json_spirit_value.h" |
|
|
|
#include <openssl/crypto.h> |
|
|
|
#include <openssl/crypto.h> |
|
|
@ -297,10 +296,8 @@ void RPCConsole::setClientModel(ClientModel *model) |
|
|
|
|
|
|
|
|
|
|
|
// connect the peerWidget's selection model to our peerSelected() handler
|
|
|
|
// connect the peerWidget's selection model to our peerSelected() handler
|
|
|
|
QItemSelectionModel *peerSelectModel = ui->peerWidget->selectionModel(); |
|
|
|
QItemSelectionModel *peerSelectModel = ui->peerWidget->selectionModel(); |
|
|
|
connect(peerSelectModel, |
|
|
|
connect(peerSelectModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), |
|
|
|
SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), |
|
|
|
this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); |
|
|
|
this, |
|
|
|
|
|
|
|
SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); |
|
|
|
|
|
|
|
connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged())); |
|
|
|
connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged())); |
|
|
|
|
|
|
|
|
|
|
|
// Provide initial values
|
|
|
|
// Provide initial values
|
|
|
@ -511,6 +508,8 @@ void RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut) |
|
|
|
|
|
|
|
|
|
|
|
void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected) |
|
|
|
void RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
Q_UNUSED(deselected); |
|
|
|
|
|
|
|
|
|
|
|
if (selected.indexes().isEmpty()) |
|
|
|
if (selected.indexes().isEmpty()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
@ -638,6 +637,8 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats) |
|
|
|
ui->peerBanScore->setText(tr("Fetching...")); |
|
|
|
ui->peerBanScore->setText(tr("Fetching...")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We override the virtual resizeEvent of the QWidget to adjust tables column
|
|
|
|
|
|
|
|
// sizes as the tables width is proportional to the dialogs width.
|
|
|
|
void RPCConsole::resizeEvent(QResizeEvent *event) |
|
|
|
void RPCConsole::resizeEvent(QResizeEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QWidget::resizeEvent(event); |
|
|
|
QWidget::resizeEvent(event); |
|
|
@ -651,7 +652,7 @@ void RPCConsole::showEvent(QShowEvent *event) |
|
|
|
// peerWidget needs a resize in case the dialog has non-default geometry
|
|
|
|
// peerWidget needs a resize in case the dialog has non-default geometry
|
|
|
|
columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); |
|
|
|
columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); |
|
|
|
|
|
|
|
|
|
|
|
// start the PeerTableModel refresh timer
|
|
|
|
// start PeerTableModel auto refresh
|
|
|
|
clientModel->getPeerTableModel()->startAutoRefresh(1000); |
|
|
|
clientModel->getPeerTableModel()->startAutoRefresh(1000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|