diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-07-13 06:27:29 +0200 |
---|---|---|
committer | Cozz Lovan <cozzlovan@yahoo.com> | 2014-07-13 07:43:01 +0200 |
commit | 76fd7b8c2677dc145a67e86153d629b43d2a92e5 (patch) | |
tree | f266d31f739c8e819e9c45b1bd4dd1693951a1fb /src/qt/rpcconsole.cpp | |
parent | 29ef38951431fcce4a8692a652e99325d2a3795c (diff) |
[Qt] Fix segfault when launched with -disablewallet
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index e1f40ddd09..9b67f8125f 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -473,6 +473,10 @@ void RPCConsole::on_tabWidget_currentChanged(int index) { ui->lineEdit->setFocus(); } + else if(ui->tabWidget->widget(index) == ui->tab_peers) + { + initPeerTable(); + } } void RPCConsole::on_openDebugLogfileButton_clicked() @@ -648,11 +652,27 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *combinedStats) ui->peerBanScore->setText(tr("Fetching...")); } +void RPCConsole::initPeerTable() +{ + if (!clientModel) + return; + + // peerWidget needs a resize in case the dialog has non-default geometry + columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); + + // start PeerTableModel auto refresh + clientModel->getPeerTableModel()->startAutoRefresh(1000); +} + // 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) { QWidget::resizeEvent(event); + + if (!clientModel) + return; + columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); } @@ -660,17 +680,16 @@ void RPCConsole::showEvent(QShowEvent *event) { QWidget::showEvent(event); - // peerWidget needs a resize in case the dialog has non-default geometry - columnResizingFixer->stretchColumnWidth(PeerTableModel::Address); - - // start PeerTableModel auto refresh - clientModel->getPeerTableModel()->startAutoRefresh(1000); + initPeerTable(); } void RPCConsole::hideEvent(QHideEvent *event) { QWidget::hideEvent(event); + if (!clientModel) + return; + // stop PeerTableModel auto refresh clientModel->getPeerTableModel()->stopAutoRefresh(); } |