From ce0265ee295c17cce86a67cf274982100502b1fe Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Sun, 27 Mar 2016 15:39:51 +0300 Subject: [PATCH] Partially revert acd906f9bbf55e42. --- novacoin-qt.pro | 21 ++++++++++++++++----- src/qt/addressbookpage.cpp | 24 ++++++++++++++++-------- src/qt/forms/addressbookpage.ui | 13 +------------ 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/novacoin-qt.pro b/novacoin-qt.pro index 46a3fc7..77f19b0 100644 --- a/novacoin-qt.pro +++ b/novacoin-qt.pro @@ -34,7 +34,7 @@ win32-g++-cross: QMAKE_TARGET.arch = $$TARGET_PLATFORM #BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib #BDB_INCLUDE_PATH=C:/deps/db-6.0.20/build_unix #BDB_LIB_PATH=C:/deps/db-6.0.20/build_unix -#OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.2g/include +#OPENSSL_INCLUDE_PATH=C:/d1eps/openssl-1.0.2g/include #OPENSSL_LIB_PATH=C:/deps/openssl-1.0.2g #QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.4 #QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.4/.libs @@ -75,6 +75,14 @@ QMAKE_LFLAGS *= -fstack-protector-all --param ssp-buffer-size=1 win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat win32:QMAKE_LFLAGS += -static-libgcc -static-libstdc++ +# use: qmake "USE_QRCODE=1" +# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support +contains(USE_QRCODE, 1) { + message(Building with QRCode support) + DEFINES += USE_QRCODE + LIBS += -lqrencode +} + # use: qmake "USE_DBUS=1" contains(USE_DBUS, 1) { message(Building with DBUS (Freedesktop notifications) support) @@ -271,7 +279,6 @@ HEADERS += src/qt/bitcoingui.h \ src/qt/multisiginputentry.h \ src/qt/multisigdialog.h \ src/qt/secondauthdialog.h \ - src/qt/qrcodedialog.h \ src/ies.h \ src/ipcollector.h @@ -352,7 +359,6 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \ src/qt/multisiginputentry.cpp \ src/qt/multisigdialog.cpp \ src/qt/secondauthdialog.cpp \ - src/qt/qrcodedialog.cpp \ src/base58.cpp \ src/cryptogram.cpp \ src/ecies.cpp \ @@ -378,8 +384,13 @@ FORMS += \ src/qt/forms/multisigaddressentry.ui \ src/qt/forms/multisiginputentry.ui \ src/qt/forms/multisigdialog.ui \ - src/qt/forms/secondauthdialog.ui \ - src/qt/forms/qrcodedialog.ui + src/qt/forms/secondauthdialog.ui + +contains(USE_QRCODE, 1) { + HEADERS += src/qt/qrcodedialog.h + SOURCES += src/qt/qrcodedialog.cpp + FORMS += src/qt/forms/qrcodedialog.ui +} CODECFORTR = UTF-8 diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index e5b55c7..9460657 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -7,7 +7,10 @@ #include "editaddressdialog.h" #include "csvmodelwriter.h" #include "guiutil.h" + +#ifdef USE_QRCODE #include "qrcodedialog.h" +#endif #include #include @@ -31,8 +34,6 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : ui->deleteButton->setIcon(QIcon()); #endif - ui->showQRCode->setVisible(false); - switch(mode) { case ForSending: @@ -50,10 +51,12 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : ui->labelExplanation->setVisible(false); ui->deleteButton->setVisible(true); ui->signMessage->setVisible(false); + ui->verifyMessage->setVisible(true); break; case ReceivingTab: ui->deleteButton->setVisible(false); ui->signMessage->setVisible(true); + ui->verifyMessage->setVisible(false); break; } @@ -61,7 +64,9 @@ 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); - QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), 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); @@ -74,7 +79,9 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : if(tab == SendingTab) contextMenu->addAction(deleteAction); contextMenu->addSeparator(); - contextMenu->addAction(showQRCodeAction); + #ifdef USE_QRCODE + contextMenu->addAction(showQRCodeAction); + #endif if(tab == ReceivingTab) contextMenu->addAction(signMessageAction); else if(tab == SendingTab) @@ -85,10 +92,11 @@ 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())); - connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); + #ifdef USE_QRCODE + connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCode_clicked())); + #endif 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))); // Pass through accept action from button box @@ -270,12 +278,10 @@ void AddressBookPage::selectionChanged() break; } ui->copyToClipboard->setEnabled(true); - ui->showQRCode->setEnabled(true); } else { ui->deleteButton->setEnabled(false); - ui->showQRCode->setEnabled(false); ui->copyToClipboard->setEnabled(false); ui->signMessage->setEnabled(false); ui->verifyMessage->setEnabled(false); @@ -335,6 +341,7 @@ void AddressBookPage::exportClicked() void AddressBookPage::on_showQRCode_clicked() { + #ifdef USE_QRCODE QTableView *table = ui->tableView; QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address); @@ -348,6 +355,7 @@ void AddressBookPage::on_showQRCode_clicked() dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); } +#endif } void AddressBookPage::contextualMenu(const QPoint &point) diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index 3d23543..d0fc71a 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -6,7 +6,7 @@ 0 0 - 760 + 799 380 @@ -86,17 +86,6 @@ - - - Show &QR Code - - - - :/icons/qrcode:/icons/qrcode - - - - Sign a message to prove you own a NovaCoin address -- 1.7.1