build: fix -DWITH_SCANNER=Off

This commit is contained in:
tobtoht
2023-12-30 20:30:30 +01:00
parent 0ba22ea05b
commit dcbf24c5b0
12 changed files with 24 additions and 20 deletions
+9 -1
View File
@@ -11,9 +11,11 @@
#include "WalletWizard.h"
#include "constants.h"
#include "dialog/URDialog.h"
#include "libwalletqt/WalletManager.h"
#ifdef WITH_SCANNER
#include "scanner/QrCodeScanDialog.h"
#endif
PageWalletRestoreKeys::PageWalletRestoreKeys(WizardFields *fields, QWidget *parent)
: QWizardPage(parent)
@@ -43,6 +45,8 @@ PageWalletRestoreKeys::PageWalletRestoreKeys(WizardFields *fields, QWidget *pare
connect(ui->btnOptions, &QPushButton::clicked, this, &PageWalletRestoreKeys::onOptionsClicked);
connect(ui->combo_walletType, &QComboBox::currentTextChanged, this, &PageWalletRestoreKeys::showInputLines);
#ifdef WITH_SCANNER
connect(ui->btn_scanUR, &QPushButton::clicked, [this] {
QrCodeScanDialog dialog{this, false};
dialog.exec();
@@ -66,6 +70,10 @@ PageWalletRestoreKeys::PageWalletRestoreKeys(WizardFields *fields, QWidget *pare
m_fields->restoreHeight = doc["restoreHeight"].toInt();
m_fields->walletName = doc["walletName"].toString() + "_view_only";
});
#else
ui->btn_scanUR->setEnabled(false);
ui->btn_scanUR->setToolTip("Can't scan QR code: Feather was built without webcam scanner support.");
#endif
}
void PageWalletRestoreKeys::initializePage() {
@@ -37,11 +37,6 @@ public:
Page_ImportOffline
};
enum Method {
UR = 0,
FILES,
};
explicit OfflineTxSigningWizard(QWidget *parent, Wallet *wallet, PendingTransaction *tx = nullptr);
~OfflineTxSigningWizard() override;
@@ -114,7 +114,7 @@
<customwidget>
<class>URWidget</class>
<extends>QWidget</extends>
<header>widgets/URWidget.h</header>
<header>qrcode/scanner/URWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>