Changeset View
Changeset View
Standalone View
Standalone View
src/qt/rpcconsole.cpp
Show First 20 Lines • Show All 710 Lines • ▼ Show 20 Lines | if (model && clientModel->getPeerTableModel() && | ||||
connect(ui->peerWidget, | connect(ui->peerWidget, | ||||
SIGNAL(customContextMenuRequested(const QPoint &)), this, | SIGNAL(customContextMenuRequested(const QPoint &)), this, | ||||
SLOT(showPeersTableContextMenu(const QPoint &))); | SLOT(showPeersTableContextMenu(const QPoint &))); | ||||
connect(disconnectAction, SIGNAL(triggered()), this, | connect(disconnectAction, SIGNAL(triggered()), this, | ||||
SLOT(disconnectSelectedNode())); | SLOT(disconnectSelectedNode())); | ||||
// peer table signal handling - update peer details when selecting new | // peer table signal handling - update peer details when selecting new | ||||
// node | // node | ||||
connect(ui->peerWidget->selectionModel(), | connect( | ||||
ui->peerWidget->selectionModel(), | |||||
SIGNAL(selectionChanged(const QItemSelection &, | SIGNAL(selectionChanged(const QItemSelection &, | ||||
const QItemSelection &)), | const QItemSelection &)), | ||||
this, SLOT(peerSelected(const QItemSelection &, | this, | ||||
const QItemSelection &))); | SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); | ||||
// peer table signal handling - update peer details when new nodes are | // peer table signal handling - update peer details when new nodes are | ||||
// added to the model | // added to the model | ||||
connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, | connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, | ||||
SLOT(peerLayoutChanged())); | SLOT(peerLayoutChanged())); | ||||
// peer table signal handling - cache selected node ids | // peer table signal handling - cache selected node ids | ||||
connect(model->getPeerTableModel(), SIGNAL(layoutAboutToBeChanged()), | connect(model->getPeerTableModel(), SIGNAL(layoutAboutToBeChanged()), | ||||
this, SLOT(peerLayoutAboutToChange())); | this, SLOT(peerLayoutAboutToChange())); | ||||
▲ Show 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | |||||
void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) { | void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) { | ||||
// update the detail ui with latest node information | // update the detail ui with latest node information | ||||
QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + | QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + | ||||
" "); | " "); | ||||
peerAddrDetails += | peerAddrDetails += | ||||
tr("(node id: %1)").arg(QString::number(stats->nodeStats.nodeid)); | tr("(node id: %1)").arg(QString::number(stats->nodeStats.nodeid)); | ||||
if (!stats->nodeStats.addrLocal.empty()) { | if (!stats->nodeStats.addrLocal.empty()) { | ||||
peerAddrDetails += "<br />" + | peerAddrDetails += "<br />" + tr("via %1").arg(QString::fromStdString( | ||||
tr("via %1").arg(QString::fromStdString( | |||||
stats->nodeStats.addrLocal)); | stats->nodeStats.addrLocal)); | ||||
} | } | ||||
ui->peerHeading->setText(peerAddrDetails); | ui->peerHeading->setText(peerAddrDetails); | ||||
ui->peerServices->setText( | ui->peerServices->setText( | ||||
GUIUtil::formatServicesStr(stats->nodeStats.nServices)); | GUIUtil::formatServicesStr(stats->nodeStats.nServices)); | ||||
ui->peerLastSend->setText( | ui->peerLastSend->setText( | ||||
stats->nodeStats.nLastSend | stats->nodeStats.nLastSend | ||||
? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - | ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - | ||||
stats->nodeStats.nLastSend) | stats->nodeStats.nLastSend) | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |