From 163145938ca2ff52e633136ca49e89f880f8e89b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 18 Oct 2013 18:43:07 +0200 Subject: qt: remove awkward way of setting GUI pages Selecting the button for a pages was going through bitcoingui->walletframe->walletview->bitcoingui. Because of this, the actions for the pages had to be exposed on the BitcoinGUI object. --- src/qt/walletframe.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/qt/walletframe.cpp') diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index 56b081170..f754bd5e7 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -44,7 +44,8 @@ bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel) walletView->setWalletModel(walletModel); walletView->showOutOfSyncWarning(bOutOfSync); - walletView->gotoOverviewPage(); /* XXX we should go to the currently selected page */ + /* TODO we should goto the currently selected page once dynamically adding wallets is supported */ + walletView->gotoOverviewPage(); walletStack->addWidget(walletView); mapWalletViews[name] = walletView; @@ -65,6 +66,16 @@ bool WalletFrame::setCurrentWallet(const QString& name) return true; } +bool WalletFrame::removeWallet(const QString &name) +{ + if (mapWalletViews.count(name) == 0) + return false; + + WalletView *walletView = mapWalletViews.take(name); + walletStack->removeWidget(walletView); + return true; +} + void WalletFrame::removeAllWallets() { QMap::const_iterator i; -- cgit v1.2.3