diff options
-rw-r--r-- | bitcoin-qt.pro | 6 | ||||
-rw-r--r-- | src/init.cpp | 5 | ||||
-rw-r--r-- | src/qt/addressbookpage.cpp | 16 | ||||
-rw-r--r-- | src/qt/addressbookpage.h | 3 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 11 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 2 | ||||
-rw-r--r-- | src/qt/res/bitcoin-qt.rc | 2 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 20 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.h | 1 | ||||
-rw-r--r-- | src/qt/sendcoinsentry.cpp | 6 | ||||
-rw-r--r-- | src/qt/sendcoinsentry.h | 1 |
11 files changed, 62 insertions, 11 deletions
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 5042adfbdf..bf41314052 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -30,10 +30,8 @@ contains(RELEASE, 1) { macx:QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk !win32:!macx { - # Linux: static link + # Linux: static link and extra security (see: https://wiki.debian.org/Hardening) LIBS += -Wl,-Bstatic -Wl,-z,relro -Wl,-z,now - # for extra security (see: https://wiki.debian.org/Hardening) - QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 } } @@ -44,6 +42,8 @@ contains(RELEASE, 1) { # Exclude on Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable! # This can be enabled for Windows, when we switch to MinGW >= 4.4.x. } +# for extra security (see: https://wiki.debian.org/Hardening): this flag is GCC compiler-specific +QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2 # for extra security on Windows: enable ASLR and DEP via GCC linker flags win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat # on Windows: enable GCC large address aware linker flag diff --git a/src/init.cpp b/src/init.cpp index 5b8436651a..34443d81ac 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -608,7 +608,7 @@ bool AppInit2() // ********************************************************* Step 5: verify wallet database integrity - uiInterface.InitMessage(_("Verifying wallet integrity...")); + uiInterface.InitMessage(_("Verifying wallet...")); if (!bitdb.Open(GetDataDir())) { @@ -826,7 +826,7 @@ bool AppInit2() break; } - uiInterface.InitMessage(_("Verifying database...")); + uiInterface.InitMessage(_("Verifying blocks...")); if (!VerifyDB()) { strLoadError = _("Corrupted block database detected"); break; @@ -985,7 +985,6 @@ bool AppInit2() // ********************************************************* Step 9: import blocks // scan for better chains in the block chain database, that are not yet connected in the active best chain - uiInterface.InitMessage(_("Importing blocks from block database...")); CValidationState state; if (!ConnectBestBlock(state)) strErrors << "Failed to connect best block"; diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index b53a37fc22..9e35e51bbf 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -65,6 +65,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : QAction *copyAddressAction = new QAction(ui->copyToClipboard->text(), this); QAction *copyLabelAction = new QAction(tr("Copy &Label"), this); QAction *editAction = new QAction(tr("&Edit"), this); + QAction *sendCoinsAction = new QAction(tr("Send &Coins"), this); QAction *showQRCodeAction = new QAction(ui->showQRCode->text(), this); QAction *signMessageAction = new QAction(ui->signMessage->text(), this); QAction *verifyMessageAction = new QAction(ui->verifyMessage->text(), this); @@ -78,6 +79,8 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : if(tab == SendingTab) contextMenu->addAction(deleteAction); contextMenu->addSeparator(); + if(tab == SendingTab) + contextMenu->addAction(sendCoinsAction); #ifdef USE_QRCODE contextMenu->addAction(showQRCodeAction); #endif @@ -91,6 +94,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())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(onSendCoins_clicked())); 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())); @@ -206,6 +210,18 @@ void AddressBookPage::on_verifyMessage_clicked() } } +void AddressBookPage::onSendCoins_clicked() +{ + QTableView *table = ui->tableView; + QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address); + + foreach (QModelIndex index, indexes) + { + QString address = index.data().toString(); + emit sendCoins(address); + } +} + void AddressBookPage::on_newAddressButton_clicked() { if(!model) diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h index c676d1e941..c6653a5e8a 100644 --- a/src/qt/addressbookpage.h +++ b/src/qt/addressbookpage.h @@ -68,6 +68,8 @@ private slots: void on_signMessage_clicked(); /** Open the verify message tab in the Sign/Verify Message dialog with currently selected address */ void on_verifyMessage_clicked(); + /** Open send coins dialog for currently selected address (no button) */ + void onSendCoins_clicked(); /** Generate a QR Code from the currently selected address */ void on_showQRCode_clicked(); /** Copy label of currently selected address entry to clipboard (no button) */ @@ -85,6 +87,7 @@ private slots: signals: void signMessage(QString addr); void verifyMessage(QString addr); + void sendCoins(QString addr); }; #endif // ADDRESSBOOKPAGE_H diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 4f97a4815f..0d951718bb 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -172,9 +172,11 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); - // Clicking on "Verify Message" in the address book sends you to the verify message tab + // Clicking on "Send Coins" in the address book sends you to the send coins tab + connect(addressBookPage, SIGNAL(sendCoins(QString)), this, SLOT(gotoSendCoinsPage(QString))); + // Clicking on "Verify Message" in the address book opens the verify message tab in the Sign/Verify Message dialog connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); - // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab + // Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); // Install event filter to be able to catch status tip events (QEvent::StatusTip) @@ -758,13 +760,16 @@ void BitcoinGUI::gotoReceiveCoinsPage() connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } -void BitcoinGUI::gotoSendCoinsPage() +void BitcoinGUI::gotoSendCoinsPage(QString addr) { sendCoinsAction->setChecked(true); centralWidget->setCurrentWidget(sendCoinsPage); exportAction->setEnabled(false); disconnect(exportAction, SIGNAL(triggered()), 0, 0); + + if(!addr.isEmpty()) + sendCoinsPage->setAddress(addr); } void BitcoinGUI::gotoSignMessageTab(QString addr) diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index b992bfdc69..1b3e313fc2 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -149,7 +149,7 @@ private slots: /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ - void gotoSendCoinsPage(); + void gotoSendCoinsPage(QString addr = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); diff --git a/src/qt/res/bitcoin-qt.rc b/src/qt/res/bitcoin-qt.rc index 834001c0c6..5449ff8359 100644 --- a/src/qt/res/bitcoin-qt.rc +++ b/src/qt/res/bitcoin-qt.rc @@ -22,7 +22,7 @@ BEGIN VALUE "FileDescription", "Bitcoin-Qt (OSS GUI client for Bitcoin)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-qt" - VALUE "LegalCopyright", "2009-2012 The Bitcoin developers" + VALUE "LegalCopyright", "2009-2013 The Bitcoin developers" VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "bitcoin-qt.exe" VALUE "ProductName", "Bitcoin-Qt" diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 56392f96dd..2133a5e729 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -245,6 +245,26 @@ QWidget *SendCoinsDialog::setupTabChain(QWidget *prev) return ui->sendButton; } +void SendCoinsDialog::setAddress(const QString &address) +{ + SendCoinsEntry *entry = 0; + // Replace the first entry if it is still unused + if(ui->entries->count() == 1) + { + SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget()); + if(first->isClear()) + { + entry = first; + } + } + if(!entry) + { + entry = addEntry(); + } + + entry->setAddress(address); +} + void SendCoinsDialog::pasteEntry(const SendCoinsRecipient &rv) { if(!fNewRecipientAllowed) diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 8a6e050c11..043dfdcb40 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -29,6 +29,7 @@ public: */ QWidget *setupTabChain(QWidget *prev); + void setAddress(const QString &address); void pasteEntry(const SendCoinsRecipient &rv); bool handleURI(const QString &uri); diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 7dbca24084..876b7f808b 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -153,6 +153,12 @@ void SendCoinsEntry::setValue(const SendCoinsRecipient &value) ui->payAmount->setValue(value.amount); } +void SendCoinsEntry::setAddress(const QString &address) +{ + ui->payTo->setText(address); + ui->payAmount->setFocus(); +} + bool SendCoinsEntry::isClear() { return ui->payTo->text().isEmpty(); diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index 0ac14c1472..ec5f3410c1 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -26,6 +26,7 @@ public: bool isClear(); void setValue(const SendCoinsRecipient &value); + void setAddress(const QString &address); /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). */ |