plugins: localmonero: fix ws notifier

This commit is contained in:
tobtoht 2023-12-12 17:18:13 +01:00
parent 650bdd2370
commit de5642011e
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
3 changed files with 11 additions and 12 deletions

View file

@ -42,9 +42,17 @@ LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, Wallet *wallet)
connect(m_api, &LocalMoneroApi::ApiResponse, this, &LocalMoneroWidget::onApiResponse);
connect(ui->btn_loadMore, &QPushButton::clicked, this, &LocalMoneroWidget::onLoadMore);
connect(websocketNotifier(), &WebsocketNotifier::LocalMoneroCountriesReceived, this, &LocalMoneroWidget::onWsCountriesReceived);
connect(websocketNotifier(), &WebsocketNotifier::LocalMoneroCurrenciesReceived, this, &LocalMoneroWidget::onWsCurrenciesReceived);
connect(websocketNotifier(), &WebsocketNotifier::LocalMoneroPaymentMethodsReceived, this, &LocalMoneroWidget::onWsPaymentMethodsReceived);
connect(websocketNotifier(), &WebsocketNotifier::dataReceived, this, [this](const QString& type, const QJsonValue& json) {
if (type == "localmonero_countries") {
this->onWsCountriesReceived(json.toArray());
}
else if (type == "localmonero_currencies") {
this->onWsCurrenciesReceived(json.toArray());
}
else if (type == "localmonero_payment_methods") {
this->onWsPaymentMethodsReceived(json.toObject());
}
});
connect(ui->combo_currency, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LocalMoneroWidget::updatePaymentMethods);

View file

@ -109,10 +109,6 @@ void WebsocketNotifier::onWSUpdates(const QJsonObject &updates) {
emit UpdatesReceived(updates);
}
void WebsocketNotifier::onWSXMRigDownloads(const QJsonObject &downloads) {
emit XMRigDownloadsReceived(downloads);
}
WebsocketNotifier* WebsocketNotifier::instance()
{
if (!m_instance) {

View file

@ -34,10 +34,6 @@ signals:
void FiatRatesReceived(const QJsonObject &fiat_rates);
void TxFiatHistoryReceived(const QJsonObject &data);
void UpdatesReceived(const QJsonObject &updates);
void XMRigDownloadsReceived(const QJsonObject &downloads);
void LocalMoneroCountriesReceived(const QJsonArray &countries);
void LocalMoneroCurrenciesReceived(const QJsonArray &currencies);
void LocalMoneroPaymentMethodsReceived(const QJsonObject &payment_methods);
void dataReceived(const QString &type, const QJsonValue &json);
private slots:
@ -45,7 +41,6 @@ private slots:
void onWSNodes(const QJsonArray &nodes);
void onWSUpdates(const QJsonObject &updates);
void onWSXMRigDownloads(const QJsonObject &downloads);
private:
static QPointer<WebsocketNotifier> m_instance;