diff --git a/src/httprpc.cpp b/src/httprpc.cpp --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -405,6 +405,9 @@ void StopHTTPRPC() { LogPrint(BCLog::RPC, "Stopping HTTP RPC server\n"); UnregisterHTTPHandler("/", true); +#ifdef ENABLE_WALLET + UnregisterHTTPHandler("/wallet/", false); +#endif if (httpRPCTimerInterface) { RPCUnsetTimerInterface(httpRPCTimerInterface.get()); httpRPCTimerInterface.reset(); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -258,7 +258,7 @@ QTimer *pollShutdownTimer; #ifdef ENABLE_WALLET PaymentServer *paymentServer; - WalletModel *walletModel; + std::vector m_wallet_models; #endif int returnValue; const PlatformStyle *platformStyle; @@ -326,7 +326,7 @@ : QApplication(argc, argv), coreThread(0), optionsModel(0), clientModel(0), window(0), pollShutdownTimer(0), #ifdef ENABLE_WALLET - paymentServer(0), walletModel(0), + paymentServer(0), m_wallet_models(), #endif returnValue(0) { setQuitOnLastWindowClosed(false); @@ -466,8 +466,10 @@ #ifdef ENABLE_WALLET window->removeAllWallets(); - delete walletModel; - walletModel = 0; + for (WalletModel *walletModel : m_wallet_models) { + delete walletModel; + } + m_wallet_models.clear(); #endif delete clientModel; clientModel = 0; @@ -500,19 +502,24 @@ window->setClientModel(clientModel); #ifdef ENABLE_WALLET - // TODO: Expose secondary wallets - if (!vpwallets.empty()) { - walletModel = - new WalletModel(platformStyle, vpwallets[0], optionsModel); - - window->addWallet(BitcoinGUI::DEFAULT_WALLET, walletModel); - window->setCurrentWallet(BitcoinGUI::DEFAULT_WALLET); + bool fFirstWallet = true; + for (CWalletRef pwallet : vpwallets) { + WalletModel *const walletModel = + new WalletModel(platformStyle, pwallet, optionsModel); + + window->addWallet(walletModel); + if (fFirstWallet) { + window->setCurrentWallet(walletModel->getWalletName()); + fFirstWallet = false; + } connect(walletModel, SIGNAL(coinsSent(CWallet *, SendCoinsRecipient, QByteArray)), paymentServer, SLOT(fetchPaymentACK(CWallet *, const SendCoinsRecipient &, QByteArray))); + + m_wallet_models.push_back(walletModel); } #endif diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -36,6 +36,7 @@ QT_BEGIN_NAMESPACE class QAction; +class QComboBox; class QProgressBar; class QProgressDialog; QT_END_NAMESPACE @@ -49,7 +50,6 @@ Q_OBJECT public: - static const QString DEFAULT_WALLET; static const std::string DEFAULT_UIPLATFORM; explicit BitcoinGUI(const Config *, const PlatformStyle *platformStyle, @@ -68,9 +68,8 @@ * Set the wallet model. * The wallet model represents a bitcoin wallet, and offers access to the * list of transactions, address book and sending functionality. - */ - bool addWallet(const QString &name, WalletModel *walletModel); - bool setCurrentWallet(const QString &name); + */ + bool addWallet(WalletModel *walletModel); void removeAllWallets(); #endif // ENABLE_WALLET bool enableWallet = false; @@ -97,6 +96,7 @@ QProgressDialog *progressDialog = nullptr; QMenuBar *appMenuBar = nullptr; + QToolBar *appToolBar = nullptr; QAction *overviewAction = nullptr; QAction *historyAction = nullptr; QAction *quitAction = nullptr; @@ -119,6 +119,9 @@ QAction *openAction = nullptr; QAction *showHelpMessageAction = nullptr; + QLabel *m_wallet_selector_label = nullptr; + QComboBox *m_wallet_selector = nullptr; + QSystemTrayIcon *trayIcon = nullptr; QMenu *trayIconMenu = nullptr; Notificator *notificator = nullptr; @@ -184,6 +187,12 @@ unsigned int style, bool *ret = nullptr); #ifdef ENABLE_WALLET + bool setCurrentWallet(const QString &name); + /** Set the UI status indicators based on the currently selected wallet. + */ + void updateWalletStatus(); + +private: /** Set the encryption status as shown in the UI. @param[in] status current encryption status @see WalletModel::EncryptionStatus @@ -196,12 +205,13 @@ */ void setHDStatus(int hdEnabled); +public Q_SLOTS: bool handlePaymentRequest(const SendCoinsRecipient &recipient); /** Show incoming transaction notification for new transactions. */ void incomingTransaction(const QString &date, int unit, const Amount amount, const QString &type, const QString &address, - const QString &label); + const QString &label, const QString &walletName); #endif // ENABLE_WALLET private Q_SLOTS: diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -25,6 +25,7 @@ #ifdef ENABLE_WALLET #include "walletframe.h" #include "walletmodel.h" +#include "walletview.h" #endif // ENABLE_WALLET #ifdef Q_OS_MAC @@ -40,6 +41,7 @@ #include #include +#include #include #include #include @@ -68,12 +70,6 @@ #endif ; -/** - * Display name for default wallet name. Uses tilde to avoid name collisions in - * the future with additional wallets - */ -const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; - BitcoinGUI::BitcoinGUI(const Config *configIn, const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) @@ -489,6 +485,7 @@ void BitcoinGUI::createToolBars() { if (walletFrame) { QToolBar *toolbar = addToolBar(tr("Tabs toolbar")); + appToolBar = toolbar; toolbar->setContextMenuPolicy(Qt::PreventContextMenu); toolbar->setMovable(false); toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -497,6 +494,16 @@ toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); overviewAction->setChecked(true); + +#ifdef ENABLE_WALLET + QWidget *spacer = new QWidget(); + spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + toolbar->addWidget(spacer); + + m_wallet_selector = new QComboBox(); + connect(m_wallet_selector, SIGNAL(currentIndexChanged(const QString &)), + this, SLOT(setCurrentWallet(const QString &))); +#endif } } @@ -571,10 +578,20 @@ } #ifdef ENABLE_WALLET -bool BitcoinGUI::addWallet(const QString &name, WalletModel *walletModel) { +bool BitcoinGUI::addWallet(WalletModel *walletModel) { if (!walletFrame) return false; + const QString name = walletModel->getWalletName(); setWalletActionsEnabled(true); - return walletFrame->addWallet(name, walletModel); + m_wallet_selector->addItem(name); + if (m_wallet_selector->count() == 2) { + m_wallet_selector_label = new QLabel(); + m_wallet_selector_label->setText(tr("Wallet:") + " "); + m_wallet_selector_label->setBuddy(m_wallet_selector); + appToolBar->addWidget(m_wallet_selector_label); + appToolBar->addWidget(m_wallet_selector); + } + rpcConsole->addWallet(walletModel); + return walletFrame->addWallet(walletModel); } bool BitcoinGUI::setCurrentWallet(const QString &name) { @@ -1019,12 +1036,16 @@ void BitcoinGUI::incomingTransaction(const QString &date, int unit, const Amount amount, const QString &type, const QString &address, - const QString &label) { + const QString &label, + const QString &walletName) { // On new transaction, make an info balloon QString msg = tr("Date: %1\n").arg(date) + tr("Amount: %1\n") - .arg(BitcoinUnits::formatWithUnit(unit, amount, true)) + - tr("Type: %1\n").arg(type); + .arg(BitcoinUnits::formatWithUnit(unit, amount, true)); + if (WalletModel::isMultiwallet() && !walletName.isEmpty()) { + msg += tr("Wallet: %1\n").arg(walletName); + } + msg += tr("Type: %1\n").arg(type); if (!label.isEmpty()) { msg += tr("Label: %1\n").arg(label); } else if (!address.isEmpty()) { @@ -1123,6 +1144,19 @@ break; } } + +void BitcoinGUI::updateWalletStatus() { + if (!walletFrame) { + return; + } + WalletView *const walletView = walletFrame->currentWalletView(); + if (!walletView) { + return; + } + WalletModel *const walletModel = walletView->getWalletModel(); + setEncryptionStatus(walletModel->getEncryptionStatus()); + setHDStatus(walletModel->hdEnabled()); +} #endif // ENABLE_WALLET void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -412,6 +412,22 @@ 4 + + + + Wallet: + + + + + + + + (none) + + + + diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -161,7 +161,7 @@ ui->reqMessage->text()); ReceiveRequestDialog *dialog = new ReceiveRequestDialog(config, this); dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->setModel(model->getOptionsModel()); + dialog->setModel(model); dialog->setInfo(info); dialog->show(); clear(); @@ -175,7 +175,7 @@ const RecentRequestsTableModel *submodel = model->getRecentRequestsTableModel(); ReceiveRequestDialog *dialog = new ReceiveRequestDialog(config, this); - dialog->setModel(model->getOptionsModel()); + dialog->setModel(model); dialog->setInfo(submodel->entry(index.row()).recipient); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -12,7 +12,6 @@ #include #include -class OptionsModel; class Config; namespace Ui { @@ -53,7 +52,7 @@ explicit ReceiveRequestDialog(const Config *configIn, QWidget *parent = 0); ~ReceiveRequestDialog(); - void setModel(OptionsModel *model); + void setModel(WalletModel *model); void setInfo(const SendCoinsRecipient &info); private Q_SLOTS: @@ -64,7 +63,7 @@ private: Ui::ReceiveRequestDialog *ui; - OptionsModel *model; + WalletModel *model; SendCoinsRecipient info; const Config *config; }; diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -94,11 +94,12 @@ delete ui; } -void ReceiveRequestDialog::setModel(OptionsModel *_model) { +void ReceiveRequestDialog::setModel(WalletModel *_model) { this->model = _model; if (_model) - connect(_model, SIGNAL(displayUnitChanged(int)), this, SLOT(update())); + connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), + this, SLOT(update())); // update the display unit if necessary update(); @@ -128,9 +129,9 @@ html += "" + tr("Address") + ": " + GUIUtil::HtmlEscape(info.address) + "
"; if (info.amount != Amount::zero()) - html += "" + tr("Amount") + - ": " + BitcoinUnits::formatHtmlWithUnit( - model->getDisplayUnit(), info.amount) + + html += "" + tr("Amount") + ": " + + BitcoinUnits::formatHtmlWithUnit( + model->getOptionsModel()->getDisplayUnit(), info.amount) + "
"; if (!info.label.isEmpty()) html += "" + tr("Label") + @@ -138,6 +139,10 @@ if (!info.message.isEmpty()) html += "" + tr("Message") + ": " + GUIUtil::HtmlEscape(info.message) + "
"; + if (model->isMultiwallet()) { + html += "" + tr("Wallet") + + ": " + GUIUtil::HtmlEscape(model->getWalletName()) + "
"; + } ui->outUri->setText(html); #ifdef USE_QRCODE diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -17,6 +17,7 @@ class ClientModel; class PlatformStyle; class RPCTimerInterface; +class WalletModel; namespace Ui { class RPCConsole; @@ -38,15 +39,18 @@ static bool RPCParseCommandLine(std::string &strResult, const std::string &strCommand, bool fExecute, - std::string *const pstrFilteredOut = nullptr); + std::string *const pstrFilteredOut = nullptr, + const std::string *walletID = nullptr); static bool RPCExecuteCommandLine(std::string &strResult, const std::string &strCommand, - std::string *const pstrFilteredOut = nullptr) { - return RPCParseCommandLine(strResult, strCommand, true, - pstrFilteredOut); + std::string *const pstrFilteredOut = nullptr, + const std::string *walletID = nullptr) { + return RPCParseCommandLine(strResult, strCommand, true, pstrFilteredOut, + walletID); } void setClientModel(ClientModel *model); + void addWallet(WalletModel *const walletModel); enum MessageClass { MC_ERROR, MC_DEBUG, CMD_REQUEST, CMD_REPLY, CMD_ERROR }; @@ -122,7 +126,7 @@ Q_SIGNALS: // For RPC command executor void stopExecutor(); - void cmdRequest(const QString &command); + void cmdRequest(const QString &command, const QString &walletID); private: static QString FormatBytes(quint64 bytes); @@ -153,6 +157,7 @@ int consoleFontSize; QCompleter *autoCompleter; QThread thread; + QString m_last_wallet_id; /** Update UI with latest network info from model. */ void updateNetworkState(); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -9,10 +9,11 @@ #include "rpcconsole.h" #include "ui_debugwindow.h" -#include "bantablemodel.h" -#include "clientmodel.h" -#include "guiutil.h" -#include "platformstyle.h" +#include "qt/bantablemodel.h" +#include "qt/clientmodel.h" +#include "qt/guiutil.h" +#include "qt/platformstyle.h" +#include "qt/walletmodel.h" #include "chainparams.h" #include "config.h" @@ -78,7 +79,7 @@ Q_OBJECT public Q_SLOTS: - void request(const QString &command); + void request(const QString &command, const QString &walletID); Q_SIGNALS: void reply(int category, const QString &command); @@ -145,7 +146,8 @@ bool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &strCommand, const bool fExecute, - std::string *const pstrFilteredOut) { + std::string *const pstrFilteredOut, + const std::string *walletID) { std::vector> stack; stack.push_back(std::vector()); @@ -328,14 +330,10 @@ req.strMethod = stack.back()[0]; #ifdef ENABLE_WALLET - // TODO: Move this logic to WalletModel - if (!vpwallets.empty()) { - // in Qt, use always the wallet with index 0 - // when running with multiple wallets + if (walletID && !walletID->empty()) { QByteArray encodedName = QUrl::toPercentEncoding( - QString::fromStdString( - vpwallets[0]->GetName())); + QString::fromStdString(*walletID)); req.URI = "/wallet/" + std::string(encodedName.constData(), @@ -438,7 +436,7 @@ } } -void RPCExecutor::request(const QString &command) { +void RPCExecutor::request(const QString &command, const QString &walletID) { try { std::string result; std::string executableCommand = command.toStdString() + "\n"; @@ -476,7 +474,9 @@ "getblock(getblockhash(0),true)[tx][0]\n\n"))); return; } - if (!RPCConsole::RPCExecuteCommandLine(result, executableCommand)) { + std::string wallet_id = walletID.toStdString(); + if (!RPCConsole::RPCExecuteCommandLine(result, executableCommand, + nullptr, &wallet_id)) { Q_EMIT reply(RPCConsole::CMD_ERROR, QString("Parse error: unbalanced ' or \"")); return; @@ -540,6 +540,10 @@ connect(ui->btnClearTrafficGraph, SIGNAL(clicked()), ui->trafficGraph, SLOT(clear())); + // disable the wallet selector by default + ui->WalletSelector->setVisible(false); + ui->WalletSelectorLabel->setVisible(false); + // set library version labels #ifdef ENABLE_WALLET ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0)); @@ -795,6 +799,24 @@ } } +#ifdef ENABLE_WALLET +void RPCConsole::addWallet(WalletModel *const walletModel) { + const QString name = walletModel->getWalletName(); + // use name for text and internal data object (to allow to move to a wallet + // id later) + ui->WalletSelector->addItem(name, name); + if (ui->WalletSelector->count() == 2 && !isVisible()) { + // First wallet added, set to default so long as the window isn't + // presently visible (and potentially in use) + ui->WalletSelector->setCurrentIndex(1); + } + if (ui->WalletSelector->count() > 2) { + ui->WalletSelector->setVisible(true); + ui->WalletSelectorLabel->setVisible(true); + } +} +#endif + static QString categoryClass(int category) { switch (category) { case RPCConsole::CMD_REQUEST: @@ -1004,8 +1026,29 @@ cmdBeforeBrowsing = QString(); + QString walletID; +#ifdef ENABLE_WALLET + const int wallet_index = ui->WalletSelector->currentIndex(); + if (wallet_index > 0) { + walletID = (QString)ui->WalletSelector->itemData(wallet_index) + .value(); + } + + if (m_last_wallet_id != walletID) { + if (walletID.isEmpty()) { + message(CMD_REQUEST, + tr("Executing command without any wallet")); + } else { + message( + CMD_REQUEST, + tr("Executing command using \"%1\" wallet").arg(walletID)); + } + m_last_wallet_id = walletID; + } +#endif + message(CMD_REQUEST, QString::fromStdString(strFilteredCmd)); - Q_EMIT cmdRequest(cmd); + Q_EMIT cmdRequest(cmd, walletID); cmd = QString::fromStdString(strFilteredCmd); @@ -1054,8 +1097,8 @@ connect(executor, SIGNAL(reply(int, QString)), this, SLOT(message(int, QString))); // Requests from this object must go to executor - connect(this, SIGNAL(cmdRequest(QString)), executor, - SLOT(request(QString))); + connect(this, SIGNAL(cmdRequest(QString, QString)), executor, + SLOT(request(QString, QString))); // On stopExecutor signal // - quit the Qt event loop in the execution thread diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -316,10 +316,17 @@ // Format confirmation message QStringList formatted; for (const SendCoinsRecipient &rcp : currentTransaction.getRecipients()) { - // generate bold amount string + // generate bold amount string with wallet name in case of multiwallet QString amount = "" + BitcoinUnits::formatHtmlWithUnit( model->getOptionsModel()->getDisplayUnit(), rcp.amount); + if (model->isMultiwallet()) { + amount.append( + " " + + tr("from wallet %1") + .arg(GUIUtil::HtmlEscape(model->getWalletName())) + + " "); + } amount.append(""); // generate monospace address string QString address = diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -37,7 +37,7 @@ void setClientModel(ClientModel *clientModel); - bool addWallet(const QString &name, WalletModel *walletModel); + bool addWallet(WalletModel *walletModel); bool setCurrentWallet(const QString &name); bool removeWallet(const QString &name); void removeAllWallets(); @@ -62,6 +62,7 @@ const PlatformStyle *platformStyle; const Config *config; +public: WalletView *currentWalletView(); public Q_SLOTS: diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "walletframe.h" +#include "walletmodel.h" #include "bitcoingui.h" #include "walletview.h" @@ -33,9 +34,15 @@ this->clientModel = _clientModel; } -bool WalletFrame::addWallet(const QString &name, WalletModel *walletModel) { - if (!gui || !clientModel || !walletModel || mapWalletViews.count(name) > 0) +bool WalletFrame::addWallet(WalletModel *walletModel) { + if (!gui || !clientModel || !walletModel) { return false; + } + + const QString name = walletModel->getWalletName(); + if (mapWalletViews.count(name) > 0) { + return false; + } WalletView *walletView = new WalletView(platformStyle, config, this); walletView->setBitcoinGUI(gui); diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -144,6 +144,8 @@ TransactionTableModel *getTransactionTableModel(); RecentRequestsTableModel *getRecentRequestsTableModel(); + CWallet *getWallet() const { return wallet; }; + Amount getBalance(const CCoinControl *coinControl = nullptr) const; Amount getUnconfirmedBalance() const; Amount getImmatureBalance() const; @@ -236,6 +238,10 @@ int getDefaultConfirmTarget() const; const CChainParams &getChainParams() const; + QString getWalletName() const; + + static bool isMultiwallet(); + private: CWallet *wallet; bool fHaveWatchOnly; @@ -274,7 +280,7 @@ const Amount watchImmatureBalance); // Encryption status of wallet changed - void encryptionStatusChanged(int status); + void encryptionStatusChanged(); // Signal emitted when wallet needs to be unlocked // It is valid behaviour for listeners to keep the wallet locked after this diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -101,7 +101,7 @@ EncryptionStatus newEncryptionStatus = getEncryptionStatus(); if (cachedEncryptionStatus != newEncryptionStatus) { - Q_EMIT encryptionStatusChanged(newEncryptionStatus); + Q_EMIT encryptionStatusChanged(); } } @@ -719,6 +719,15 @@ return nTxConfirmTarget; } +QString WalletModel::getWalletName() const { + LOCK(wallet->cs_wallet); + return QString::fromStdString(wallet->GetName()); +} + +bool WalletModel::isMultiwallet() { + return gArgs.GetArgs("-wallet").size() > 1; +} + const CChainParams &WalletModel::getChainParams() const { return wallet->chainParams; } diff --git a/src/qt/walletview.h b/src/qt/walletview.h --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -48,6 +48,7 @@ * the P2P network, and is wallet-agnostic. */ void setClientModel(ClientModel *clientModel); + WalletModel *getWalletModel() { return walletModel; } /** * Set the wallet model. * The wallet model represents a bitcoin wallet, and offers access to the @@ -127,13 +128,13 @@ void message(const QString &title, const QString &message, unsigned int style); /** Encryption status of wallet changed */ - void encryptionStatusChanged(int status); + void encryptionStatusChanged(); /** HD-Enabled status of wallet changed (only possible during startup) */ - void hdEnabledStatusChanged(int hdEnabled); + void hdEnabledStatusChanged(); /** Notify that a new transaction appeared */ void incomingTransaction(const QString &date, int unit, const Amount amount, const QString &type, const QString &address, - const QString &label); + const QString &label, const QString &walletName); /** Notify that the out of sync warning icon has been pressed */ void outOfSyncWarningClicked(); }; diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -113,18 +113,18 @@ SLOT(message(QString, QString, unsigned int))); // Pass through encryption status changed signals - connect(this, SIGNAL(encryptionStatusChanged(int)), gui, - SLOT(setEncryptionStatus(int))); + connect(this, SIGNAL(encryptionStatusChanged()), gui, + SLOT(updateWalletStatus())); // Pass through transaction notifications connect(this, SIGNAL(incomingTransaction(QString, int, Amount, QString, - QString, QString)), + QString, QString, QString)), gui, SLOT(incomingTransaction(QString, int, Amount, QString, - QString, QString))); + QString, QString, QString))); // Connect HD enabled state signal - connect(this, SIGNAL(hdEnabledStatusChanged(int)), gui, - SLOT(setHDStatus(int))); + connect(this, SIGNAL(hdEnabledStatusChanged()), gui, + SLOT(updateWalletStatus())); } } @@ -152,12 +152,12 @@ this, SIGNAL(message(QString, QString, unsigned int))); // Handle changes in encryption status - connect(_walletModel, SIGNAL(encryptionStatusChanged(int)), this, - SIGNAL(encryptionStatusChanged(int))); + connect(_walletModel, SIGNAL(encryptionStatusChanged()), this, + SIGNAL(encryptionStatusChanged())); updateEncryptionStatus(); // update HD status - Q_EMIT hdEnabledStatusChanged(_walletModel->hdEnabled()); + Q_EMIT hdEnabledStatusChanged(); // Balloon pop-up for new transaction connect(_walletModel->getTransactionTableModel(), @@ -203,7 +203,8 @@ Q_EMIT incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), - int64_t(amount) * SATOSHI, type, address, label); + int64_t(amount) * SATOSHI, type, address, label, + walletModel->getWalletName()); } void WalletView::gotoOverviewPage() { @@ -261,7 +262,7 @@ } void WalletView::updateEncryptionStatus() { - Q_EMIT encryptionStatusChanged(walletModel->getEncryptionStatus()); + Q_EMIT encryptionStatusChanged(); } void WalletView::encryptWallet(bool status) {