Add qr code button & always build with libqrencode
authoruser <balthazar@yandex.ru>
Wed, 29 Dec 2021 05:07:53 +0000 (08:07 +0300)
committeruser <balthazar@yandex.ru>
Wed, 29 Dec 2021 05:07:53 +0000 (08:07 +0300)
CMakeLists.txt
src/qt/addressbookpage.cpp
src/qt/addressbookpage.ui
src/qt/bitcoin.qrc

index fd7410c..7d0e790 100644 (file)
@@ -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)
index 9460657..3f07439 100644 (file)
@@ -7,10 +7,7 @@
 #include "editaddressdialog.h"
 #include "csvmodelwriter.h"
 #include "guiutil.h"
-
-#ifdef USE_QRCODE
 #include "qrcodedialog.h"
-#endif
 
 #include <QSortFilterProxyModel>
 #include <QClipboard>
@@ -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)
index d0fc71a..9e09086 100644 (file)
       </widget>
      </item>
      <item>
+      <widget class="QPushButton" name="showQRCode">
+       <property name="text">
+        <string>Show &amp;QR Code</string>
+       </property>
+       <property name="icon">
+        <iconset resource="../bitcoin.qrc">
+         <normaloff>:/icons/qr</normaloff>:/icons/qr</iconset>
+       </property>
+      </widget>
+     </item>
+     <item>
       <widget class="QPushButton" name="signMessage">
        <property name="toolTip">
         <string>Sign a message to prove you own a NovaCoin address</string>
index 5b72777..829815d 100644 (file)
@@ -40,6 +40,7 @@
         <file alias="lock_open">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/lock_open.png</file>
         <file alias="key">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/key.png</file>
         <file alias="filesave">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/filesave.png</file>
+        <file alias="qr">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/qr.png</file>
         <file alias="qrcode">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/qrcode.png</file>
         <file alias="debugwindow">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/debugwindow.png</file>
         <file alias="dump">${CMAKE_CURRENT_SOURCE_DIR}/src/qt/res/icons/dump.png</file>