Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115684
D6168.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6168.diff
View Options
diff --git a/src/qt/walletcontroller.h b/src/qt/walletcontroller.h
--- a/src/qt/walletcontroller.h
+++ b/src/qt/walletcontroller.h
@@ -48,6 +48,7 @@
OpenWalletActivity *openWallet(const CChainParams ¶ms,
const std::string &name,
QWidget *parent = nullptr);
+ void closeWallet(WalletModel *wallet_model, QWidget *parent = nullptr);
private Q_SLOTS:
void addWallet(WalletModel *wallet_model);
diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp
--- a/src/qt/walletcontroller.cpp
+++ b/src/qt/walletcontroller.cpp
@@ -65,6 +65,26 @@
QMetaObject::invokeMethod(activity, "open", Qt::QueuedConnection);
return activity;
}
+void WalletController::closeWallet(WalletModel *wallet_model, QWidget *parent) {
+ QMessageBox box(parent);
+ box.setWindowTitle(tr("Close wallet"));
+ box.setText(tr("Are you sure you wish to close wallet <i>%1</i>?")
+ .arg(wallet_model->getDisplayName()));
+ box.setInformativeText(
+ tr("Closing the wallet for too long can result in having to resync the "
+ "entire chain if pruning is enabled."));
+ box.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
+ box.setDefaultButton(QMessageBox::Yes);
+ if (box.exec() != QMessageBox::Yes) {
+ return;
+ }
+
+ // First remove wallet from node.
+ wallet_model->wallet().remove();
+ // Now release the model.
+ removeAndDeleteWallet(wallet_model);
+}
+
WalletModel *WalletController::getOrCreateWallet(
std::unique_ptr<interfaces::Wallet> wallet) {
QMutexLocker locker(&m_mutex);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:43 (6 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187680
Default Alt Text
D6168.diff (1 KB)
Attached To
D6168: [backport#15195] gui: Add closeWallet to WalletController
Event Timeline
Log In to Comment