Skip to content

Commit

Permalink
Merge pull request #835 from zcoinofficial/qt-signals-fix
Browse files Browse the repository at this point in the history
Fix runtime Qt signal errors
  • Loading branch information
riordant authored Apr 29, 2020
2 parents 862c884 + 8626975 commit 1ce128e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 42 deletions.
6 changes: 3 additions & 3 deletions src/qt/elyassetsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ ElyAssetsDialog::~ElyAssetsDialog()
delete ui;
}

void ElyAssetsDialog::reinitOmni()
void ElyAssetsDialog::reinitEly()
{
ui->propSelectorWidget->clear();
ui->balancesTable->setRowCount(0);
Expand All @@ -130,8 +130,8 @@ void ElyAssetsDialog::setClientModel(ClientModel *model)
{
this->clientModel = model;
if (model != NULL) {
connect(model, SIGNAL(refreshOmniBalance()), this, SLOT(balancesUpdated()));
connect(model, SIGNAL(reinitOmniState()), this, SLOT(reinitOmni()));
connect(model, SIGNAL(refreshElysiumBalance()), this, SLOT(balancesUpdated()));
connect(model, SIGNAL(reinitElysiumState()), this, SLOT(reinitEly()));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/elyassetsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ElyAssetsDialog : public QDialog
public Q_SLOTS:
void propSelectorChanged();
void balancesUpdated();
void reinitOmni();
void reinitEly();

private Q_SLOTS:
void contextualMenu(const QPoint &point);
Expand Down
2 changes: 2 additions & 0 deletions src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public Q_SLOTS:
Q_SIGNALS:
void transactionClicked(const QModelIndex &index);
void enabledTorChanged();
#ifdef ENABLE_ELYSIUM
void elysiumTransactionClicked(const uint256& txid);
#endif

private:
Ui::OverviewPage *ui;
Expand Down
1 change: 0 additions & 1 deletion src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ void RPCConsole::startExecutor()
connect(this, SIGNAL(stopExecutor()), &thread, SLOT(quit()));
// - queue executor for deletion (in execution thread)
connect(&thread, SIGNAL(finished()), executor, SLOT(deleteLater()), Qt::DirectConnection);
connect(&thread, SIGNAL(finished()), this, SLOT(test()), Qt::DirectConnection);

// Default implementation of QThread::run() simply spins up an event loop in the thread,
// which is what we want.
Expand Down
30 changes: 0 additions & 30 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *pa
void SendCoinsDialog::setClientModel(ClientModel *clientModel)
{
this->clientModel = clientModel;

if (clientModel) {
connect(clientModel, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(updateSmartFeeLabel()));
}
}

void SendCoinsDialog::setModel(WalletModel *model)
Expand Down Expand Up @@ -604,32 +600,6 @@ void SendCoinsDialog::updateMinFeeLabel()
);
}

//void SendCoinsDialog::updateSmartFeeLabel()
//{
// if(!model || !model->getOptionsModel())
// return;

// int nBlocksToConfirm = defaultConfirmTarget - ui->sliderSmartFee->value();
// int estimateFoundAtBlocks = nBlocksToConfirm;
// CFeeRate feeRate = mempool.estimateSmartFee(nBlocksToConfirm, &estimateFoundAtBlocks);
// if (feeRate <= CFeeRate(0)) // not enough data => minfee
// {
// ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(),
// std::max(CWallet::fallbackFee.GetFeePerK(), CWallet::GetRequiredFee(1000))) + "/kB");
// ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...)
// ui->labelFeeEstimation->setText("");
// }
// else
// {
// ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(),
// std::max(feeRate.GetFeePerK(), CWallet::GetRequiredFee(1000))) + "/kB");
// ui->labelSmartFee2->hide();
// ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %n block(s).", "", estimateFoundAtBlocks));
// }

// updateFeeMinimizedLabel();
//}

// Coin Control: copy label "Quantity" to clipboard
void SendCoinsDialog::coinControlClipboardQuantity()
{
Expand Down
4 changes: 2 additions & 2 deletions src/qt/sendmpdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void SendMPDialog::setClientModel(ClientModel *model)
{
this->clientModel = model;
if (model != NULL) {
connect(model, SIGNAL(refreshOmniBalance()), this, SLOT(balancesUpdated()));
connect(model, SIGNAL(reinitOmniState()), this, SLOT(balancesUpdated()));
connect(model, SIGNAL(refreshElysiumBalance()), this, SLOT(balancesUpdated()));
connect(model, SIGNAL(reinitElysiumState()), this, SLOT(balancesUpdated()));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/qt/txhistorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void TXHistoryDialog::setClientModel(ClientModel *model)
this->clientModel = model;
if (model != NULL) {
connect(model, SIGNAL(refreshElysiumBalance()), this, SLOT(UpdateHistory()));
connect(model, SIGNAL(numBlocksChanged(int)), this, SLOT(UpdateConfirmations()));
connect(model, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(UpdateConfirmations()));
connect(model, SIGNAL(reinitElysiumState()), this, SLOT(ReinitTXHistoryTable()));
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ WalletView::WalletView(const PlatformStyle *platformStyle, QWidget *parent):

// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(focusBitcoinHistoryTab(QModelIndex)));
#ifdef ENABLE_ELYSIUM
connect(overviewPage, SIGNAL(elysiumTransactionClicked(uint256)), this, SLOT(focusElysiumTransaction(uint256)));
#endif
}

WalletView::~WalletView()
Expand Down Expand Up @@ -244,7 +246,9 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
{
// Clicking on a transaction on the overview page simply sends you to transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoBitcoinHistoryTab()));
#ifdef ENABLE_ELYSIUM
connect(overviewPage, SIGNAL(elysiumTransactionClicked(uint256)), gui, SLOT(gotoElysiumHistoryTab()));
#endif

// Receive and report messages
connect(this, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));
Expand Down
4 changes: 0 additions & 4 deletions src/qt/znodelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ ZnodeList::~ZnodeList()
void ZnodeList::setClientModel(ClientModel *model)
{
this->clientModel = model;
if(model) {
// try to update list when znode count changes
connect(clientModel, SIGNAL(strZnodesChanged(QString)), this, SLOT(updateNodeList()));
}
}

void ZnodeList::setWalletModel(WalletModel *model)
Expand Down

0 comments on commit 1ce128e

Please sign in to comment.