 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
21 #include <QApplication>
24 #include <QHBoxLayout>
26 #include <QPushButton>
27 #include <QVBoxLayout>
31 platformStyle(_platformStyle),
35 QHBoxLayout *walletFrameLayout =
new QHBoxLayout(
this);
36 setContentsMargins(0,0,0,0);
37 walletStack =
new QStackedWidget(
this);
38 walletFrameLayout->setContentsMargins(0,0,0,0);
39 walletFrameLayout->addWidget(walletStack);
42 QGroupBox* no_wallet_group =
new QGroupBox(walletStack);
43 QVBoxLayout* no_wallet_layout =
new QVBoxLayout(no_wallet_group);
45 QLabel *noWallet =
new QLabel(tr(
"No wallet has been loaded.\nGo to File > Open Wallet to load a wallet.\n- OR -"));
46 noWallet->setAlignment(Qt::AlignCenter);
47 no_wallet_layout->addWidget(noWallet, 0, Qt::AlignHCenter | Qt::AlignBottom);
50 QPushButton* create_wallet_button =
new QPushButton(tr(
"Create a new wallet"), walletStack);
52 no_wallet_layout->addWidget(create_wallet_button, 0, Qt::AlignHCenter | Qt::AlignTop);
53 no_wallet_group->setLayout(no_wallet_layout);
55 walletStack->addWidget(no_wallet_group);
67 i.value()->setClientModel(_clientModel);
81 if (current_wallet_view) {
82 walletView->setCurrentIndex(current_wallet_view->currentIndex());
99 if (view_about_to_hide) {
100 QSizePolicy sp = view_about_to_hide->sizePolicy();
101 sp.setHorizontalPolicy(QSizePolicy::Ignored);
102 view_about_to_hide->setSizePolicy(sp);
109 QSizePolicy sp = walletView->sizePolicy();
110 sp.setHorizontalPolicy(QSizePolicy::Preferred);
111 walletView->setSizePolicy(sp);
112 walletView->updateGeometry();
130 QMap<WalletModel*, WalletView*>::const_iterator i;
148 QMap<WalletModel*, WalletView*>::const_iterator i;
150 i.value()->showOutOfSyncWarning(fShow);
155 QMap<WalletModel*, WalletView*>::const_iterator i;
157 i.value()->gotoOverviewPage();
162 QMap<WalletModel*, WalletView*>::const_iterator i;
164 i.value()->gotoHistoryPage();
169 QMap<WalletModel*, WalletView*>::const_iterator i;
171 i.value()->gotoReceiveCoinsPage();
176 QMap<WalletModel*, WalletView*>::const_iterator i;
178 i.value()->gotoSendCoinsPage(addr);
199 if (from_clipboard) {
200 std::string raw = QApplication::clipboard()->text().toStdString();
209 tr(
"Load Transaction Data"), QString(),
210 tr(
"Partially Signed Transaction (*.psbt)"),
nullptr);
211 if (filename.isEmpty())
return;
216 std::ifstream in{filename.toLocal8Bit().data(), std::ios::binary};
217 data = std::string(std::istreambuf_iterator<char>{in}, {});
228 dlg->openWithPSBT(psbtx);
276 return qobject_cast<WalletView*>(
walletStack->currentWidget());
WalletView * currentWalletView() const
void createWalletButtonClicked()
void gotoReceiveCoinsPage()
Switch to receive coins page.
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
Interface to Bitcoin wallet from Qt view code.
void showOutOfSyncWarning(bool fShow)
WalletModel * getWalletModel() const noexcept
Overview ("home") page widget.
void encryptWallet()
Encrypt the wallet.
const PlatformStyle * platformStyle
void changePassphrase()
Change encrypted wallet passphrase.
WalletFrame(const PlatformStyle *platformStyle, QWidget *parent)
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
void encryptWallet()
Encrypt the wallet.
void message(const QString &title, const QString &message, unsigned int style)
void backupWallet()
Backup the wallet.
bool addView(WalletView *walletView)
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
void setClientModel(ClientModel *clientModel)
Set the client model.
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
void setCurrentWallet(WalletModel *wallet_model)
void usedReceivingAddresses()
Show used receiving addresses.
std::vector< unsigned char > DecodeBase64(const char *p, bool *pf_invalid)
WalletModel * currentWalletModel() const
std::streampos GetFileSize(const char *path, std::streamsize max)
Get the size of a file by scanning it.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
ClientModel * clientModel
void usedSendingAddresses()
Show used sending addresses.
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
bool DecodeRawPSBT(PartiallySignedTransaction &psbt, const std::string &tx_data, std::string &error)
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
Model for Bitcoin network client.
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void setClientModel(ClientModel *clientModel)
void gotoOverviewPage()
Switch to overview (home) page.
A version of CTransaction with the PSBT format.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
void changePassphrase()
Change encrypted wallet passphrase.
void gotoOverviewPage()
Switch to overview (home) page.
QStackedWidget * walletStack
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
void backupWallet()
Backup the wallet.
const std::streamsize MAX_FILE_SIZE_PSBT
void usedSendingAddresses()
Show used sending addresses.
bool error(const char *fmt, const Args &... args)
void usedReceivingAddresses()
Show used receiving addresses.
void showOutOfSyncWarning(bool fShow)
void gotoHistoryPage()
Switch to history (transactions) page.
QMap< WalletModel *, WalletView * > mapWalletViews
void removeWallet(WalletModel *wallet_model)
Dialog showing transaction details.