mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +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
604cdbc447
commit
c6b734f99c
@ -67,6 +67,9 @@ AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->showAddressQRCode->setIcon(QIcon());
|
ui->showAddressQRCode->setIcon(QIcon());
|
||||||
|
#ifndef USE_QRCODE
|
||||||
|
ui->showAddressQRCode->setEnabled(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(mode)
|
switch(mode)
|
||||||
{
|
{
|
||||||
@ -110,6 +113,9 @@ AddressBookPage::AddressBookPage(Mode _mode, Tabs _tab, QWidget* parent) :
|
|||||||
QAction *editAction = new QAction(tr("&Edit"), this);
|
QAction *editAction = new QAction(tr("&Edit"), this);
|
||||||
QAction *showAddressQRCodeAction = new QAction(tr("&Show address QR code"), this);
|
QAction *showAddressQRCodeAction = new QAction(tr("&Show address QR code"), this);
|
||||||
deleteAction = new QAction(ui->deleteAddress->text(), this);
|
deleteAction = new QAction(ui->deleteAddress->text(), this);
|
||||||
|
#ifndef USE_QRCODE
|
||||||
|
showAddressQRCodeAction->setEnabled(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Build context menu
|
// Build context menu
|
||||||
contextMenu = new QMenu(this);
|
contextMenu = new QMenu(this);
|
||||||
@ -269,13 +275,17 @@ void AddressBookPage::selectionChanged()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ui->copyAddress->setEnabled(true);
|
ui->copyAddress->setEnabled(true);
|
||||||
|
#ifdef USE_QRCODE
|
||||||
ui->showAddressQRCode->setEnabled(true);
|
ui->showAddressQRCode->setEnabled(true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->deleteAddress->setEnabled(false);
|
ui->deleteAddress->setEnabled(false);
|
||||||
ui->copyAddress->setEnabled(false);
|
ui->copyAddress->setEnabled(false);
|
||||||
|
#ifdef USE_QRCODE
|
||||||
ui->showAddressQRCode->setEnabled(false);
|
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 *editLabelAction = new QAction(tr("Edit address label"), this);
|
||||||
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
|
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
|
||||||
QAction *showAddressQRCodeAction = new QAction(tr("Show address QR code"), this);
|
QAction *showAddressQRCodeAction = new QAction(tr("Show address QR code"), this);
|
||||||
|
#ifndef USE_QRCODE
|
||||||
|
showAddressQRCodeAction->setEnabled(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
contextMenu = new QMenu(this);
|
contextMenu = new QMenu(this);
|
||||||
contextMenu->setObjectName("contextMenu");
|
contextMenu->setObjectName("contextMenu");
|
||||||
|
Loading…
Reference in New Issue
Block a user