send: don't allow fiat conversion if websocket is disabled

This commit is contained in:
tobtoht
2023-02-13 10:41:07 +01:00
parent 7961b74cc6
commit 199e085709
3 changed files with 16 additions and 0 deletions
+14
View File
@@ -236,6 +236,10 @@ void SendWidget::updateConversionLabel() {
return;
}
if (config()->get(Config::disableWebsocket).toBool()) {
return;
}
QString conversionAmountStr = [this]{
QString currency = ui->comboCurrencySelection->currentText();
if (currency != "XMR") {
@@ -331,6 +335,16 @@ void SendWidget::disableSendButton() {
ui->btnSend->setEnabled(false);
}
void SendWidget::setWebsocketEnabled(bool enabled) {
this->updateConversionLabel();
if (enabled) {
this->setupComboBox();
} else {
ui->comboCurrencySelection->clear();
ui->comboCurrencySelection->insertItem(0, "XMR");
}
}
void SendWidget::onDataPasted(const QString &data) {
if (!data.isEmpty()) {
QVariantMap uriData = m_ctx->wallet->parse_uri_to_object(data);