From b8cd9aeea451a400a354ac5efdbb576295eacdd7 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 29 Dec 2021 08:07:53 +0300 Subject: [PATCH] Add qr code button & always build with libqrencode --- CMakeLists.txt | 2 +- src/qt/addressbookpage.cpp | 15 ++------------- src/qt/addressbookpage.ui | 11 +++++++++++ src/qt/bitcoin.qrc | 1 + 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd7410c..7d0e790 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,7 @@ if (NOT BDB_FOUND) message(FATAL_ERROR "Unable to find ${BerkeleyDB_LIB_name} library in ${BerkeleyDB_LIBS} directory. Try to specify either library path via BerkeleyDB_LIBS or berkeley db root path via BerkeleyDB_ROOT variable. You can also use BerkeleyDB_LIB_name variable to provide alternative file name search for.") endif() -list(APPEND ALL_DEFINITIONS QT_GUI USE_QRCODE USE_IPV6 BOOST_SPIRIT_THREADSAFE) +list(APPEND ALL_DEFINITIONS QT_GUI USE_IPV6 BOOST_SPIRIT_THREADSAFE) # Disable useless targets option(LEVELDB_BUILD_TESTS "Build LevelDB's unit tests" OFF) diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 9460657..3f07439 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -7,10 +7,7 @@ #include "editaddressdialog.h" #include "csvmodelwriter.h" #include "guiutil.h" - -#ifdef USE_QRCODE #include "qrcodedialog.h" -#endif #include #include @@ -64,9 +61,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QAction *copyLabelAction = new QAction(tr("Copy &Label"), this); QAction *copyAddressAction = new QAction(ui->copyToClipboard->text(), this); QAction *editAction = new QAction(tr("&Edit"), this); -#ifdef USE_QRCODE QAction *showQRCodeAction = new QAction(tr("Show &QR Code"), this); -#endif QAction *signMessageAction = new QAction(ui->signMessage->text(), this); QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this); deleteAction = new QAction(ui->deleteButton->text(), this); @@ -79,9 +74,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : if(tab == SendingTab) contextMenu->addAction(deleteAction); contextMenu->addSeparator(); - #ifdef USE_QRCODE - contextMenu->addAction(showQRCodeAction); - #endif + contextMenu->addAction(showQRCodeAction); if(tab == ReceivingTab) contextMenu->addAction(signMessageAction); else if(tab == SendingTab) @@ -92,9 +85,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction())); connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction())); connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked())); - #ifdef USE_QRCODE - connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); - #endif + connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked())); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); @@ -341,7 +332,6 @@ void AddressBookPage::exportClicked() void AddressBookPage::on_showQRCode_clicked() { - #ifdef USE_QRCODE QTableView *table = ui->tableView; QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address); @@ -355,7 +345,6 @@ void AddressBookPage::on_showQRCode_clicked() dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); } -#endif } void AddressBookPage::contextualMenu(const QPoint &point) diff --git a/src/qt/addressbookpage.ui b/src/qt/addressbookpage.ui index d0fc71a..9e09086 100644 --- a/src/qt/addressbookpage.ui +++ b/src/qt/addressbookpage.ui @@ -86,6 +86,17 @@ + + + Show &QR Code + + + + :/icons/qr:/icons/qr + + + + Sign a message to prove you own a NovaCoin address diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 5b72777..829815d 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -40,6 +40,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/lock_open.png ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/key.png ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/filesave.png + ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/qr.png ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/qrcode.png ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/debugwindow.png ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/dump.png -- 1.7.1