#include "csvmodelwriter.h"
#include "guiutil.h"
+#ifdef USE_QRCODE
+#include "qrcodedialog.h"
+#endif
+
#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)
{
case ForSending:
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;
}
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);
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)
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
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);
void AddressBookPage::on_showQRCode_clicked()
{
-#ifdef USE_QRCODE
+ #ifdef USE_QRCODE
QTableView *table = ui->tableView;
QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);