18#include <QApplication>
28 platformStyle(_platformStyle),
29 m_size_hint(
OverviewPage{platformStyle, nullptr}.sizeHint())
32 QHBoxLayout *walletFrameLayout =
new QHBoxLayout(
this);
33 setContentsMargins(0,0,0,0);
35 walletFrameLayout->setContentsMargins(0,0,0,0);
39 QGroupBox* no_wallet_group =
new QGroupBox(
walletStack);
40 QVBoxLayout* no_wallet_layout =
new QVBoxLayout(no_wallet_group);
42 QLabel *noWallet =
new QLabel(tr(
"No wallet has been loaded.\nGo to File > Open Wallet to load a wallet.\n- OR -"));
43 noWallet->setAlignment(Qt::AlignCenter);
44 no_wallet_layout->addWidget(noWallet, 0, Qt::AlignHCenter | Qt::AlignBottom);
47 QPushButton* create_wallet_button =
new QPushButton(tr(
"Create a new wallet"),
walletStack);
49 no_wallet_layout->addWidget(create_wallet_button, 0, Qt::AlignHCenter | Qt::AlignTop);
50 no_wallet_group->setLayout(no_wallet_layout);
64 i.value()->setClientModel(_clientModel);
78 if (current_wallet_view) {
79 walletView->setCurrentIndex(current_wallet_view->currentIndex());
96 if (view_about_to_hide) {
97 QSizePolicy sp = view_about_to_hide->sizePolicy();
98 sp.setHorizontalPolicy(QSizePolicy::Ignored);
99 view_about_to_hide->setSizePolicy(sp);
106 QSizePolicy sp = walletView->sizePolicy();
107 sp.setHorizontalPolicy(QSizePolicy::Preferred);
108 walletView->setSizePolicy(sp);
109 walletView->updateGeometry();
127 QMap<WalletModel*, WalletView*>::const_iterator i;
145 QMap<WalletModel*, WalletView*>::const_iterator i;
147 i.value()->showOutOfSyncWarning(fShow);
152 QMap<WalletModel*, WalletView*>::const_iterator i;
154 i.value()->gotoOverviewPage();
159 QMap<WalletModel*, WalletView*>::const_iterator i;
161 i.value()->gotoHistoryPage();
166 QMap<WalletModel*, WalletView*>::const_iterator i;
168 i.value()->gotoReceiveCoinsPage();
173 QMap<WalletModel*, WalletView*>::const_iterator i;
175 i.value()->gotoSendCoinsPage(addr);
196 if (from_clipboard) {
197 std::string raw = QApplication::clipboard()->text().toStdString();
206 tr(
"Load Transaction Data"), QString(),
207 tr(
"Partially Signed Transaction (*.psbt)"),
nullptr);
208 if (filename.isEmpty())
return;
213 std::ifstream in(filename.toLocal8Bit().data(), std::ios::binary);
214 data = std::string(std::istreambuf_iterator<char>{in}, {});
225 dlg->openWithPSBT(psbtx);
273 return qobject_cast<WalletView*>(
walletStack->currentWidget());
Model for Bitcoin network client.
Overview ("home") page widget.
Dialog showing transaction details.
bool addView(WalletView *walletView)
void changePassphrase()
Change encrypted wallet passphrase.
WalletModel * currentWalletModel() const
void gotoHistoryPage()
Switch to history (transactions) page.
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
WalletView * currentWalletView() const
void gotoOverviewPage()
Switch to overview (home) page.
ClientModel * clientModel
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
void removeWallet(WalletModel *wallet_model)
void setClientModel(ClientModel *clientModel)
void backupWallet()
Backup the wallet.
QStackedWidget * walletStack
void usedSendingAddresses()
Show used sending addresses.
void createWalletButtonClicked()
void encryptWallet()
Encrypt the wallet.
void usedReceivingAddresses()
Show used receiving addresses.
void message(const QString &title, const QString &message, unsigned int style)
void setCurrentWallet(WalletModel *wallet_model)
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
QMap< WalletModel *, WalletView * > mapWalletViews
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
WalletFrame(const PlatformStyle *platformStyle, QWidget *parent)
void showOutOfSyncWarning(bool fShow)
void gotoReceiveCoinsPage()
Switch to receive coins page.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Interface to Bitcoin wallet from Qt view code.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void changePassphrase()
Change encrypted wallet passphrase.
void setClientModel(ClientModel *clientModel)
Set the client model.
WalletModel * getWalletModel() const noexcept
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
void usedSendingAddresses()
Show used sending addresses.
void encryptWallet()
Encrypt the wallet.
void backupWallet()
Backup the wallet.
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
void gotoOverviewPage()
Switch to overview (home) page.
void usedReceivingAddresses()
Show used receiving addresses.
void showOutOfSyncWarning(bool fShow)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
void ShowModalDialogAndDeleteOnClose(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
bool DecodeRawPSBT(PartiallySignedTransaction &psbt, const std::string &tx_data, std::string &error)
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
const std::streamsize MAX_FILE_SIZE_PSBT
std::vector< unsigned char > DecodeBase64(const char *p, bool *pf_invalid)
A version of CTransaction with the PSBT format.
bool error(const char *fmt, const Args &... args)
std::streampos GetFileSize(const char *path, std::streamsize max)
Get the size of a file by scanning it.