LocalMoneroWidget: disable search button during search

This commit is contained in:
tobtoht 2021-05-23 22:24:03 +02:00
parent e054db66ca
commit cebe92b61f
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C
2 changed files with 5 additions and 6 deletions

View file

@ -19,8 +19,6 @@ LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, QSharedPointer<AppContext>
{ {
ui->setupUi(this); ui->setupUi(this);
// this->adjustSize();
QPixmap logo(":/assets/images/localMonero_logo.png"); QPixmap logo(":/assets/images/localMonero_logo.png");
ui->logo->setPixmap(logo.scaled(100, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation)); ui->logo->setPixmap(logo.scaled(100, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation));
@ -68,6 +66,7 @@ void LocalMoneroWidget::skinChanged() {
void LocalMoneroWidget::onSearchClicked() { void LocalMoneroWidget::onSearchClicked() {
m_model->clearData(); m_model->clearData();
m_currentPage = 0; m_currentPage = 0;
ui->btn_search->setEnabled(false);
this->searchOffers(); this->searchOffers();
} }
@ -78,7 +77,7 @@ void LocalMoneroWidget::onSignUpClicked() {
} }
void LocalMoneroWidget::onApiResponse(const LocalMoneroApi::LocalMoneroResponse &resp) { void LocalMoneroWidget::onApiResponse(const LocalMoneroApi::LocalMoneroResponse &resp) {
qDebug() << "We got a response"; ui->btn_search->setEnabled(true);
if (!resp.ok) { if (!resp.ok) {
QMessageBox::warning(this, "LocalMonero error", QString("Request failed:\n\n%1").arg(resp.message)); QMessageBox::warning(this, "LocalMonero error", QString("Request failed:\n\n%1").arg(resp.message));

View file

@ -41,11 +41,11 @@ private:
void viewOfferDetails(); void viewOfferDetails();
void updatePaymentMethods(); void updatePaymentMethods();
Ui::LocalMoneroWidget *ui;
QSharedPointer<AppContext> m_ctx;
int m_currentPage = 0; int m_currentPage = 0;
Ui::LocalMoneroWidget *ui;
QSharedPointer<AppContext> m_ctx;
LocalMoneroApi *m_api; LocalMoneroApi *m_api;
LocalMoneroModel *m_model; LocalMoneroModel *m_model;
UtilsNetworking *m_network; UtilsNetworking *m_network;