@@ -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);
@@ -484,6 +488,11 @@ void BitcoinGUI::createActions()
484
488
});
485
489
connect (m_mask_values_action, &QAction::toggled, this , &BitcoinGUI::setPrivacy);
486
490
connect (m_mask_values_action, &QAction::toggled, this , &BitcoinGUI::enableHistoryAction);
491
+ connect (m_export_watchonly_action, &QAction::triggered, [this ] {
492
+ QString destination = GUIUtil::getSaveFileName (this , tr (" Save Watch-only Wallet Export" ), QString (), QString (), nullptr );
493
+ if (destination.isEmpty ()) return ;
494
+ walletFrame->currentWalletModel ()->wallet ().exportWatchOnlyWallet (GUIUtil::QStringToPath (destination));
495
+ });
487
496
}
488
497
#endif // ENABLE_WALLET
489
498
@@ -507,6 +516,7 @@ void BitcoinGUI::createMenuBar()
507
516
file->addSeparator ();
508
517
file->addAction (backupWalletAction);
509
518
file->addAction (m_restore_wallet_action);
519
+ file->addAction (m_export_watchonly_action);
510
520
file->addSeparator ();
511
521
file->addAction (openAction);
512
522
file->addAction (signMessageAction);
@@ -715,6 +725,7 @@ void BitcoinGUI::setWalletController(WalletController* wallet_controller, bool s
715
725
m_restore_wallet_action->setEnabled (true );
716
726
m_migrate_wallet_action->setEnabled (true );
717
727
m_migrate_wallet_action->setMenu (m_migrate_wallet_menu);
728
+ m_export_watchonly_action->setEnabled (true );
718
729
719
730
GUIUtil::ExceptionSafeConnect (wallet_controller, &WalletController::walletAdded, this , &BitcoinGUI::addWallet);
720
731
connect (wallet_controller, &WalletController::walletRemoved, this , &BitcoinGUI::removeWallet);
0 commit comments