Browse Source

fix "send coins" via context menu in address book

- the send coins context menu entry was not working anymore, because
  a non current version of #2220 was merged onto current master
- also removes some unneeded spaces and adds a comment to
  WalletModel::getNumTransactions()
0.8
Philip Kaufmann 12 years ago
parent
commit
abf11f79ae
  1. 4
      src/qt/bitcoingui.cpp
  2. 2
      src/qt/bitcoingui.h
  3. 4
      src/qt/walletframe.cpp
  4. 2
      src/qt/walletframe.h
  5. 2
      src/qt/walletmodel.cpp
  6. 4
      src/qt/walletstack.cpp
  7. 2
      src/qt/walletstack.h
  8. 11
      src/qt/walletview.cpp
  9. 2
      src/qt/walletview.h

4
src/qt/bitcoingui.cpp

@ -475,9 +475,9 @@ void BitcoinGUI::gotoReceiveCoinsPage()
if (walletFrame) walletFrame->gotoReceiveCoinsPage(); if (walletFrame) walletFrame->gotoReceiveCoinsPage();
} }
void BitcoinGUI::gotoSendCoinsPage() void BitcoinGUI::gotoSendCoinsPage(QString addr)
{ {
if (walletFrame) walletFrame->gotoSendCoinsPage(); if (walletFrame) walletFrame->gotoSendCoinsPage(addr);
} }
void BitcoinGUI::gotoSignMessageTab(QString addr) void BitcoinGUI::gotoSignMessageTab(QString addr)

2
src/qt/bitcoingui.h

@ -162,7 +162,7 @@ private slots:
/** Switch to receive coins page */ /** Switch to receive coins page */
void gotoReceiveCoinsPage(); void gotoReceiveCoinsPage();
/** Switch to send coins page */ /** Switch to send coins page */
void gotoSendCoinsPage(); void gotoSendCoinsPage(QString addr = "");
/** Show Sign/Verify Message dialog and switch to sign message tab */ /** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = ""); void gotoSignMessageTab(QString addr = "");

4
src/qt/walletframe.cpp

@ -88,9 +88,9 @@ void WalletFrame::gotoReceiveCoinsPage()
walletStack->gotoReceiveCoinsPage(); walletStack->gotoReceiveCoinsPage();
} }
void WalletFrame::gotoSendCoinsPage() void WalletFrame::gotoSendCoinsPage(QString addr)
{ {
walletStack->gotoSendCoinsPage(); walletStack->gotoSendCoinsPage(addr);
} }
void WalletFrame::gotoSignMessageTab(QString addr) void WalletFrame::gotoSignMessageTab(QString addr)

2
src/qt/walletframe.h

@ -47,7 +47,7 @@ public slots:
/** Switch to receive coins page */ /** Switch to receive coins page */
void gotoReceiveCoinsPage(); void gotoReceiveCoinsPage();
/** Switch to send coins page */ /** Switch to send coins page */
void gotoSendCoinsPage(); void gotoSendCoinsPage(QString addr = "");
/** Show Sign/Verify Message dialog and switch to sign message tab */ /** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = ""); void gotoSignMessageTab(QString addr = "");

2
src/qt/walletmodel.cpp

@ -56,6 +56,8 @@ int WalletModel::getNumTransactions() const
int numTransactions = 0; int numTransactions = 0;
{ {
LOCK(wallet->cs_wallet); LOCK(wallet->cs_wallet);
// the size of mapWallet contains the number of unique transaction IDs
// (e.g. payments to yourself generate 2 transactions, but both share the same transaction ID)
numTransactions = wallet->mapWallet.size(); numTransactions = wallet->mapWallet.size();
} }
return numTransactions; return numTransactions;

4
src/qt/walletstack.cpp

@ -97,11 +97,11 @@ void WalletStack::gotoReceiveCoinsPage()
i.value()->gotoReceiveCoinsPage(); i.value()->gotoReceiveCoinsPage();
} }
void WalletStack::gotoSendCoinsPage() void WalletStack::gotoSendCoinsPage(QString addr)
{ {
QMap<QString, WalletView*>::const_iterator i; QMap<QString, WalletView*>::const_iterator i;
for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)
i.value()->gotoSendCoinsPage(); i.value()->gotoSendCoinsPage(addr);
} }
void WalletStack::gotoSignMessageTab(QString addr) void WalletStack::gotoSignMessageTab(QString addr)

2
src/qt/walletstack.h

@ -76,7 +76,7 @@ public slots:
/** Switch to receive coins page */ /** Switch to receive coins page */
void gotoReceiveCoinsPage(); void gotoReceiveCoinsPage();
/** Switch to send coins page */ /** Switch to send coins page */
void gotoSendCoinsPage(); void gotoSendCoinsPage(QString addr = "");
/** Show Sign/Verify Message dialog and switch to sign message tab */ /** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = ""); void gotoSignMessageTab(QString addr = "");

11
src/qt/walletview.cpp

@ -74,9 +74,11 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
// Double-clicking on a transaction on the transaction history page shows details // Double-clicking on a transaction on the transaction history page shows details
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
// 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))); 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))); connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
gotoOverviewPage(); gotoOverviewPage();
@ -257,13 +259,16 @@ void WalletView::gotoReceiveCoinsPage()
connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
} }
void WalletView::gotoSendCoinsPage() void WalletView::gotoSendCoinsPage(QString addr)
{ {
sendCoinsAction->setChecked(true); sendCoinsAction->setChecked(true);
setCurrentWidget(sendCoinsPage); setCurrentWidget(sendCoinsPage);
exportAction->setEnabled(false); exportAction->setEnabled(false);
disconnect(exportAction, SIGNAL(triggered()), 0, 0); disconnect(exportAction, SIGNAL(triggered()), 0, 0);
if(!addr.isEmpty())
sendCoinsPage->setAddress(addr);
} }
void WalletView::gotoSignMessageTab(QString addr) void WalletView::gotoSignMessageTab(QString addr)

2
src/qt/walletview.h

@ -105,7 +105,7 @@ public slots:
/** Switch to receive coins page */ /** Switch to receive coins page */
void gotoReceiveCoinsPage(); void gotoReceiveCoinsPage();
/** Switch to send coins page */ /** Switch to send coins page */
void gotoSendCoinsPage(); void gotoSendCoinsPage(QString addr = "");
/** Show Sign/Verify Message dialog and switch to sign message tab */ /** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = ""); void gotoSignMessageTab(QString addr = "");

Loading…
Cancel
Save