aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletframe.cpp
diff options
context:
space:
mode:
authorEric Lombrozo <elombrozo@gmail.com>2013-03-22 10:32:49 -0700
committerEric Lombrozo <elombrozo@gmail.com>2013-03-22 11:09:08 -0700
commit67155d9299ef75cc73272a259dbfbf72632c3020 (patch)
treee351256ef8c01d40654ef06b40551c9602f31158 /src/qt/walletframe.cpp
parentdfd71bb4509d12c26e630bc671a542ad5bab4945 (diff)
Minimal architectural changes necessary to support multiple wallets in bitcoin-qt
- This commit is a minimal restructuring necessary to support multiple wallets in the UI. Please see multiwallet-qt.txt for details.
Diffstat (limited to 'src/qt/walletframe.cpp')
-rw-r--r--src/qt/walletframe.cpp129
1 files changed, 129 insertions, 0 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
new file mode 100644
index 0000000000..a53aa65466
--- /dev/null
+++ b/src/qt/walletframe.cpp
@@ -0,0 +1,129 @@
+/*
+ * Qt4 bitcoin GUI.
+ *
+ * W.J. van der Laan 2011-2012
+ * The Bitcoin Developers 2011-2013
+ */
+#include "walletframe.h"
+#include "bitcoingui.h"
+#include "walletstack.h"
+
+#include <QVBoxLayout>
+#include <QMessageBox>
+
+#include <stdio.h>
+
+WalletFrame::WalletFrame(BitcoinGUI *_gui) :
+ QFrame(_gui),
+ gui(_gui),
+ clientModel(0)
+{
+ // Leave HBox hook for adding a list view later
+ QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);
+ walletStack = new WalletStack(this);
+ walletStack->setBitcoinGUI(gui);
+ walletFrameLayout->addWidget(walletStack);
+}
+
+WalletFrame::~WalletFrame()
+{
+}
+
+void WalletFrame::setClientModel(ClientModel *clientModel)
+{
+ this->clientModel = clientModel;
+ walletStack->setClientModel(clientModel);
+}
+
+bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)
+{
+ return walletStack->addWallet(name, walletModel);
+}
+
+bool WalletFrame::setCurrentWallet(const QString& name)
+{
+ // TODO: Check if valid name
+ walletStack->setCurrentWallet(name);
+ return true;
+}
+
+void WalletFrame::removeAllWallets()
+{
+ walletStack->removeAllWallets();
+}
+
+bool WalletFrame::handleURI(const QString &uri)
+{
+ return walletStack->handleURI(uri);
+}
+
+void WalletFrame::showOutOfSyncWarning(bool fShow)
+{
+ if (!walletStack) {
+ QMessageBox box;
+ box.setText("walletStack is null");
+ box.exec();
+ return;
+ }
+ walletStack->showOutOfSyncWarning(fShow);
+}
+
+void WalletFrame::gotoOverviewPage()
+{
+ walletStack->gotoOverviewPage();
+}
+
+void WalletFrame::gotoHistoryPage()
+{
+ walletStack->gotoHistoryPage();
+}
+
+void WalletFrame::gotoAddressBookPage()
+{
+ walletStack->gotoAddressBookPage();
+}
+
+void WalletFrame::gotoReceiveCoinsPage()
+{
+ walletStack->gotoReceiveCoinsPage();
+}
+
+void WalletFrame::gotoSendCoinsPage()
+{
+ walletStack->gotoSendCoinsPage();
+}
+
+void WalletFrame::gotoSignMessageTab(QString addr)
+{
+ walletStack->gotoSignMessageTab(addr);
+}
+
+void WalletFrame::gotoVerifyMessageTab(QString addr)
+{
+ walletStack->gotoSignMessageTab(addr);
+}
+
+void WalletFrame::encryptWallet(bool status)
+{
+ walletStack->encryptWallet(status);
+}
+
+void WalletFrame::backupWallet()
+{
+ walletStack->backupWallet();
+}
+
+void WalletFrame::changePassphrase()
+{
+ walletStack->changePassphrase();
+}
+
+void WalletFrame::unlockWallet()
+{
+ walletStack->unlockWallet();
+}
+
+void WalletFrame::setEncryptionStatus()
+{
+ walletStack->setEncryptionStatus();
+}