mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
plugins: localmonero: fix ws notifier
This commit is contained in:
parent
650bdd2370
commit
de5642011e
3 changed files with 11 additions and 12 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 ¤cies);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue