mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 12:52:35 -03:00
Merge pull request #4518
76fd7b8
[Qt] Fix segfault when launched with -disablewallet (Cozz Lovan)
This commit is contained in:
commit
b5280c31db
3 changed files with 38 additions and 14 deletions
|
@ -159,10 +159,13 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
|
||||||
labelEncryptionIcon = new QLabel();
|
labelEncryptionIcon = new QLabel();
|
||||||
labelConnectionsIcon = new QLabel();
|
labelConnectionsIcon = new QLabel();
|
||||||
labelBlocksIcon = new QLabel();
|
labelBlocksIcon = new QLabel();
|
||||||
|
if(enableWallet)
|
||||||
|
{
|
||||||
frameBlocksLayout->addStretch();
|
frameBlocksLayout->addStretch();
|
||||||
frameBlocksLayout->addWidget(unitDisplayControl);
|
frameBlocksLayout->addWidget(unitDisplayControl);
|
||||||
frameBlocksLayout->addStretch();
|
frameBlocksLayout->addStretch();
|
||||||
frameBlocksLayout->addWidget(labelEncryptionIcon);
|
frameBlocksLayout->addWidget(labelEncryptionIcon);
|
||||||
|
}
|
||||||
frameBlocksLayout->addStretch();
|
frameBlocksLayout->addStretch();
|
||||||
frameBlocksLayout->addWidget(labelConnectionsIcon);
|
frameBlocksLayout->addWidget(labelConnectionsIcon);
|
||||||
frameBlocksLayout->addStretch();
|
frameBlocksLayout->addStretch();
|
||||||
|
|
|
@ -473,6 +473,10 @@ void RPCConsole::on_tabWidget_currentChanged(int index)
|
||||||
{
|
{
|
||||||
ui->lineEdit->setFocus();
|
ui->lineEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
else if(ui->tabWidget->widget(index) == ui->tab_peers)
|
||||||
|
{
|
||||||
|
initPeerTable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RPCConsole::on_openDebugLogfileButton_clicked()
|
void RPCConsole::on_openDebugLogfileButton_clicked()
|
||||||
|
@ -648,17 +652,10 @@ 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
|
void RPCConsole::initPeerTable()
|
||||||
// sizes as the tables width is proportional to the dialogs width.
|
|
||||||
void RPCConsole::resizeEvent(QResizeEvent *event)
|
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent(event);
|
if (!clientModel)
|
||||||
columnResizingFixer->stretchColumnWidth(PeerTableModel::Address);
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
void RPCConsole::showEvent(QShowEvent *event)
|
|
||||||
{
|
|
||||||
QWidget::showEvent(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);
|
||||||
|
@ -667,10 +664,32 @@ void RPCConsole::showEvent(QShowEvent *event)
|
||||||
clientModel->getPeerTableModel()->startAutoRefresh(1000);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RPCConsole::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
QWidget::showEvent(event);
|
||||||
|
|
||||||
|
initPeerTable();
|
||||||
|
}
|
||||||
|
|
||||||
void RPCConsole::hideEvent(QHideEvent *event)
|
void RPCConsole::hideEvent(QHideEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::hideEvent(event);
|
QWidget::hideEvent(event);
|
||||||
|
|
||||||
|
if (!clientModel)
|
||||||
|
return;
|
||||||
|
|
||||||
// stop PeerTableModel auto refresh
|
// stop PeerTableModel auto refresh
|
||||||
clientModel->getPeerTableModel()->stopAutoRefresh();
|
clientModel->getPeerTableModel()->stopAutoRefresh();
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,8 @@ protected:
|
||||||
private:
|
private:
|
||||||
/** show detailed information on ui about selected node */
|
/** show detailed information on ui about selected node */
|
||||||
void updateNodeDetail(const CNodeCombinedStats *combinedStats);
|
void updateNodeDetail(const CNodeCombinedStats *combinedStats);
|
||||||
|
/** initialize peer table */
|
||||||
|
void initPeerTable();
|
||||||
|
|
||||||
enum ColumnWidths
|
enum ColumnWidths
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue