diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-02 13:45:59 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-02 13:45:59 +0200 |
commit | ebff5c40a234f38429965c391da020bbf8312b1b (patch) | |
tree | c37239c253c74dc4c2f73838e2d6ae9edad31ed7 /src/qt/walletmodel.cpp | |
parent | 05da981f05d7b2e1551345a042d3379e9244f09b (diff) |
Send: dialog redesign (automatically look up label for entered address)
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r-- | src/qt/walletmodel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 0fb7d21087..f962b9a7c7 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -122,3 +122,19 @@ TransactionTableModel *WalletModel::getTransactionTableModel() { return transactionTableModel; } + +/* Look up label for address in address book, if not found return empty string. + */ +QString WalletModel::labelForAddress(const QString &address) const +{ + CRITICAL_BLOCK(wallet->cs_mapAddressBook) + { + std::map<std::string, std::string>::iterator mi = wallet->mapAddressBook.find(address.toStdString()); + if (mi != wallet->mapAddressBook.end()) + { + return QString::fromStdString(mi->second); + } + } + return QString(); +} + |