@@ -371,6 +371,10 @@ void BitcoinGUI::createActions()
371
371
m_mask_values_action->setStatusTip (tr (" Mask the values in the Overview tab" ));
372
372
m_mask_values_action->setCheckable (true );
373
373
374
+ m_export_watchonly_action = new QAction (tr (" Export watch-only wallet" ), this );
375
+ m_export_watchonly_action->setEnabled (false );
376
+ m_export_watchonly_action->setStatusTip (tr (" Export a watch-only version of the current wallet that can be restored onto another node." ));
377
+
374
378
connect (quitAction, &QAction::triggered, this , &BitcoinGUI::quitRequested);
375
379
connect (aboutAction, &QAction::triggered, this , &BitcoinGUI::aboutClicked);
376
380
connect (aboutQtAction, &QAction::triggered, qApp, QApplication::aboutQt);
@@ -488,6 +492,11 @@ void BitcoinGUI::createActions()
488
492
});
489
493
connect (m_mask_values_action, &QAction::toggled, this , &BitcoinGUI::setPrivacy);
490
494
connect (m_mask_values_action, &QAction::toggled, this , &BitcoinGUI::enableHistoryAction);
495
+ connect (m_export_watchonly_action, &QAction::triggered, [this ] {
496
+ QString destination = GUIUtil::getSaveFileName (this , tr (" Save Watch-only Wallet Export" ), QString (), QString (), nullptr );
497
+ if (destination.isEmpty ()) return ;
498
+ walletFrame->currentWalletModel ()->wallet ().exportWatchOnlyWallet (GUIUtil::QStringToPath (destination));
499
+ });
491
500
}
492
501
#endif // ENABLE_WALLET
493
502
@@ -511,6 +520,7 @@ void BitcoinGUI::createMenuBar()
511
520
file->addSeparator ();
512
521
file->addAction (backupWalletAction);
513
522
file->addAction (m_restore_wallet_action);
523
+ file->addAction (m_export_watchonly_action);
514
524
file->addSeparator ();
515
525
file->addAction (openAction);
516
526
file->addAction (signMessageAction);
@@ -719,6 +729,7 @@ void BitcoinGUI::setWalletController(WalletController* wallet_controller, bool s
719
729
m_restore_wallet_action->setEnabled (true );
720
730
m_migrate_wallet_action->setEnabled (true );
721
731
m_migrate_wallet_action->setMenu (m_migrate_wallet_menu);
732
+ m_export_watchonly_action->setEnabled (true );
722
733
723
734
GUIUtil::ExceptionSafeConnect (wallet_controller, &WalletController::walletAdded, this , &BitcoinGUI::addWallet);
724
735
connect (wallet_controller, &WalletController::walletRemoved, this , &BitcoinGUI::removeWallet);
0 commit comments