aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletframe.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-08-02 13:53:03 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-08-23 09:10:31 +0200
commitdbc0a6aba2cf94aa1b167145a18e0b9c671aef5b (patch)
tree88a2ba112bc8c6fb3353327c5579c830f7868ff4 /src/qt/walletframe.cpp
parente62f8d72f349aec0865268c089ae99fedd314af1 (diff)
Bitcoin-Qt: tweak Qt walletXXX.cpp/h code
WalletView: - add new signal showNormalIfMinimized() - emit the new signal in handleURI() to fix a bug, preventing the main window to show up when using bitcoin: URIs WalletStack: - connect the showNormalIfMinimized() signal from WalletView with the showNormalIfMinimized() slot in BitcoinGUI - rework setCurrentWallet() to return a bool - add check for valid walletModel in addWallet() - add missing gui attribute initialisation in constructor WalletFrame: - remove unused or unneded class attributes gui and clientModel - add a check for valid clientModel in setClientModel() General: - small code formatting changes
Diffstat (limited to 'src/qt/walletframe.cpp')
-rw-r--r--src/qt/walletframe.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index ed2723a0f7..99a6647a65 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -12,15 +12,13 @@
#include <QMessageBox>
WalletFrame::WalletFrame(BitcoinGUI *_gui) :
- QFrame(_gui),
- gui(_gui),
- clientModel(0)
+ QFrame(_gui)
{
// Leave HBox hook for adding a list view later
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);
setContentsMargins(0,0,0,0);
walletStack = new WalletStack(this);
- walletStack->setBitcoinGUI(gui);
+ walletStack->setBitcoinGUI(_gui);
walletFrameLayout->setContentsMargins(0,0,0,0);
walletFrameLayout->addWidget(walletStack);
}
@@ -31,8 +29,8 @@ WalletFrame::~WalletFrame()
void WalletFrame::setClientModel(ClientModel *clientModel)
{
- this->clientModel = clientModel;
- walletStack->setClientModel(clientModel);
+ if (clientModel)
+ walletStack->setClientModel(clientModel);
}
bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)
@@ -43,8 +41,7 @@ bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)
bool WalletFrame::setCurrentWallet(const QString& name)
{
// TODO: Check if valid name
- walletStack->setCurrentWallet(name);
- return true;
+ return walletStack->setCurrentWallet(name);
}
void WalletFrame::removeAllWallets()