diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-08 23:34:10 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-08 23:34:10 -0700 |
commit | 9e11cb53dda23a3064e756c59ba0328230b5a0e5 (patch) | |
tree | 888c38b4701abb4a10bc0e2b53258952edf72bf8 /src/qt | |
parent | 6bdb06a7b1d07a0b8ce7f1977cb1511e37dfe0b6 (diff) | |
parent | 356c3cad1a1be4cf84ca79379d9e19e0117cfd64 (diff) |
Merge pull request #1215 from laanwj/2012_05_nogridtables
Make user actions more straightforward in address book
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/addressbookpage.cpp | 27 | ||||
-rw-r--r-- | src/qt/forms/addressbookpage.ui | 8 |
2 files changed, 25 insertions, 10 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 3e55c39e04..dfc85c66d6 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -58,25 +58,34 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : ui->signMessage->setVisible(true); break; } - ui->tableView->setTabKeyNavigation(false); - ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu); // Context menu actions - QAction *copyAddressAction = new QAction(tr("Copy address"), this); - QAction *copyLabelAction = new QAction(tr("Copy label"), this); - QAction *editAction = new QAction(tr("Edit"), this); - deleteAction = new QAction(tr("Delete"), this); - + 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); + QAction *signMessageAction = new QAction(ui->signMessage->text(), this); + deleteAction = new QAction(ui->deleteButton->text(), this); + + // Build context menu contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(editAction); - contextMenu->addAction(deleteAction); - + if(tab == SendingTab) + contextMenu->addAction(deleteAction); + contextMenu->addSeparator(); + contextMenu->addAction(showQRCodeAction); + if(tab == ReceivingTab) + contextMenu->addAction(signMessageAction); + + // Connect signals for context menu actions connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyToClipboard_clicked())); 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())); + connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessage_clicked())); connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index 3ccebd40d9..c9969358e9 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -29,9 +29,15 @@ </item> <item> <widget class="QTableView" name="tableView"> + <property name="contextMenuPolicy"> + <enum>Qt::CustomContextMenu</enum> + </property> <property name="toolTip"> <string>Double-click to edit address or label</string> </property> + <property name="tabKeyNavigation"> + <bool>false</bool> + </property> <property name="alternatingRowColors"> <bool>true</bool> </property> @@ -71,7 +77,7 @@ <string>Copy the currently selected address to the system clipboard</string> </property> <property name="text"> - <string>&Copy to Clipboard</string> + <string>&Copy Address</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> |