mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix(qt): Disable "Show address QR code" menu items/buttons when no qrencode support was compiled in (#4854)
This commit is contained in:
parent
145a974a22
commit
a8b9dedefb
@ -67,6 +67,9 @@ AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->showAddressQRCode->setIcon(QIcon());
|
||||
#ifndef USE_QRCODE
|
||||
ui->showAddressQRCode->setEnabled(false);
|
||||
#endif
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
@ -110,6 +113,9 @@ AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
|
||||
QAction *editAction = new QAction(tr("&Edit"), this);
|
||||
QAction *showAddressQRCodeAction = new QAction(tr("&Show address QR code"), this);
|
||||
deleteAction = new QAction(ui->deleteAddress->text(), this);
|
||||
#ifndef USE_QRCODE
|
||||
showAddressQRCodeAction->setEnabled(false);
|
||||
#endif
|
||||
|
||||
// Build context menu
|
||||
contextMenu = new QMenu(this);
|
||||
@ -269,13 +275,17 @@ void AddressBookPage::selectionChanged()
|
||||
break;
|
||||
}
|
||||
ui->copyAddress->setEnabled(true);
|
||||
#ifdef USE_QRCODE
|
||||
ui->showAddressQRCode->setEnabled(true);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->deleteAddress->setEnabled(false);
|
||||
ui->copyAddress->setEnabled(false);
|
||||
#ifdef USE_QRCODE
|
||||
ui->showAddressQRCode->setEnabled(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,9 @@ transactionView(nullptr), abandonAction(nullptr), columnResizingFixer(nullptr)
|
||||
QAction *editLabelAction = new QAction(tr("Edit address label"), this);
|
||||
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
|
||||
QAction *showAddressQRCodeAction = new QAction(tr("Show address QR code"), this);
|
||||
#ifndef USE_QRCODE
|
||||
showAddressQRCodeAction->setEnabled(false);
|
||||
#endif
|
||||
|
||||
contextMenu = new QMenu(this);
|
||||
contextMenu->setObjectName("contextMenu");
|
||||
|
Loading…
Reference in New Issue
Block a user