#include "editaddressdialog.h"
#include "csvmodelwriter.h"
#include "guiutil.h"
+#include "qrcodedialog.h"
#include <QSortFilterProxyModel>
#include <QClipboard>
#include <QMessageBox>
#include <QMenu>
-#ifdef USE_QRCODE
-#include "qrcodedialog.h"
-#endif
AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
QDialog(parent),
ui->deleteButton->setIcon(QIcon());
#endif
-#ifndef USE_QRCODE
ui->showQRCode->setVisible(false);
-#endif
switch(mode)
{
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(ui->showQRCode->text(), 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);
if(tab == SendingTab)
contextMenu->addAction(deleteAction);
contextMenu->addSeparator();
-#ifdef USE_QRCODE
contextMenu->addAction(showQRCodeAction);
-#endif
if(tab == ReceivingTab)
contextMenu->addAction(signMessageAction);
else if(tab == SendingTab)
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(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked()));
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessage_clicked()));
void AddressBookPage::on_showQRCode_clicked()
{
-#ifdef USE_QRCODE
QTableView *table = ui->tableView;
QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
-#endif
}
void AddressBookPage::contextualMenu(const QPoint &point)