Dogecoin Core  1.14.2
P2P Digital Currency
utilitydialog.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #if defined(HAVE_CONFIG_H)
6 #include "config/bitcoin-config.h"
7 #endif
8 
9 #include "utilitydialog.h"
10 
11 #include "ui_helpmessagedialog.h"
12 #include "ui_paperwalletdialog.h"
13 
14 #include "bitcoinunits.h"
15 
16 #ifdef ENABLE_WALLET
17 #include "sendcoinsdialog.h"
18 #include "sendcoinsentry.h"
19 #include "coincontroldialog.h"
20 #endif
21 
22 #include "optionsmodel.h"
23 #include "bitcoingui.h"
24 #include "clientmodel.h"
25 #include "guiconstants.h"
26 #include "intro.h"
27 #include "paymentrequestplus.h"
28 #include "guiutil.h"
29 
30 #include "clientversion.h"
31 #include "init.h"
32 #include "util.h"
33 #include "net.h"
34 #include "utilstrencodings.h"
35 
36 #include <stdio.h>
37 
38 #include <QCloseEvent>
39 #include <QFont>
40 #include <QLabel>
41 #include <QRegExp>
42 #include <QTextTable>
43 #include <QTextCursor>
44 #include <QVBoxLayout>
45 #include <QInputDialog>
46 
47 #ifdef USE_QRCODE
48 #include <qrencode.h>
49 #endif
50 
51 #if QT_VERSION < 0x050000
52 #include <QPrinter>
53 #include <QPrintDialog>
54 #include <QPrintPreviewDialog>
55 #else
56 // Use QT5's new modular classes
57 #include <QtPrintSupport/QPrinter>
58 #include <QtPrintSupport/QPrintDialog>
59 #include <QtPrintSupport/QPrintPreviewDialog>
60 #endif
61 #include <QPainter>
62 #include "walletmodel.h"
63 
65 HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
66  QDialog(parent),
67  ui(new Ui::HelpMessageDialog)
68 {
69  ui->setupUi(this);
70 
71  QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion());
72  /* On x86 add a bit specifier to the version so that users can distinguish between
73  * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambiguous.
74  */
75 #if defined(__x86_64__)
76  version += " " + tr("(%1-bit)").arg(64);
77 #elif defined(__i386__ )
78  version += " " + tr("(%1-bit)").arg(32);
79 #endif
80 
81  if (about)
82  {
83  setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME)));
84 
86  QString licenseInfo = QString::fromStdString(LicenseInfo());
87  QString licenseInfoHTML = licenseInfo;
88  // Make URLs clickable
89  QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
90  uri.setMinimal(true); // use non-greedy matching
91  licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
92  // Replace newlines with HTML breaks
93  licenseInfoHTML.replace("\n", "<br>");
94 
95  ui->aboutMessage->setTextFormat(Qt::RichText);
96  ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
97  text = version + "\n" + licenseInfo;
98  ui->aboutMessage->setText(version + "<br><br>" + licenseInfoHTML);
99  ui->aboutMessage->setWordWrap(true);
100  ui->helpMessage->setVisible(false);
101  } else {
102  setWindowTitle(tr("Command-line options"));
103  QString header = tr("Usage:") + "\n" +
104  " dogecoin-qt [" + tr("command-line options") + "] " + "\n";
105  QTextCursor cursor(ui->helpMessage->document());
106  cursor.insertText(version);
107  cursor.insertBlock();
108  cursor.insertText(header);
109  cursor.insertBlock();
110 
111  std::string strUsage = HelpMessage(HMM_BITCOIN_QT);
112  const bool showDebug = GetBoolArg("-help-debug", false);
113  strUsage += HelpMessageGroup(tr("UI Options:").toStdString());
114  if (showDebug) {
115  strUsage += HelpMessageOpt("-allowselfsignedrootcertificates", strprintf("Allow self signed root certificates (default: %u)", DEFAULT_SELFSIGNED_ROOTCERTS));
116  }
117  strUsage += HelpMessageOpt("-choosedatadir", strprintf(tr("Choose data directory on startup (default: %u)").toStdString(), DEFAULT_CHOOSE_DATADIR));
118  strUsage += HelpMessageOpt("-lang=<lang>", tr("Set language, for example \"de_DE\" (default: system locale)").toStdString());
119  strUsage += HelpMessageOpt("-min", tr("Start minimized").toStdString());
120  strUsage += HelpMessageOpt("-rootcertificates=<file>", tr("Set SSL root certificates for payment request (default: -system-)").toStdString());
121  strUsage += HelpMessageOpt("-splash", strprintf(tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN));
122  strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changed in the GUI").toStdString());
123  if (showDebug) {
124  strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM));
125  }
126  QString coreOptions = QString::fromStdString(strUsage);
127  text = version + "\n" + header + "\n" + coreOptions;
128 
129  QTextTableFormat tf;
130  tf.setBorderStyle(QTextFrameFormat::BorderStyle_None);
131  tf.setCellPadding(2);
132  QVector<QTextLength> widths;
133  widths << QTextLength(QTextLength::PercentageLength, 35);
134  widths << QTextLength(QTextLength::PercentageLength, 65);
135  tf.setColumnWidthConstraints(widths);
136 
137  QTextCharFormat bold;
138  bold.setFontWeight(QFont::Bold);
139 
140  Q_FOREACH (const QString &line, coreOptions.split("\n")) {
141  if (line.startsWith(" -"))
142  {
143  cursor.currentTable()->appendRows(1);
144  cursor.movePosition(QTextCursor::PreviousCell);
145  cursor.movePosition(QTextCursor::NextRow);
146  cursor.insertText(line.trimmed());
147  cursor.movePosition(QTextCursor::NextCell);
148  } else if (line.startsWith(" ")) {
149  cursor.insertText(line.trimmed()+' ');
150  } else if (line.size() > 0) {
151  //Title of a group
152  if (cursor.currentTable())
153  cursor.currentTable()->appendRows(1);
154  cursor.movePosition(QTextCursor::Down);
155  cursor.insertText(line.trimmed(), bold);
156  cursor.insertTable(1, 2, tf);
157  }
158  }
159 
160  ui->helpMessage->moveCursor(QTextCursor::Start);
161  ui->scrollArea->setVisible(false);
162  ui->aboutLogo->setVisible(false);
163  }
164 }
165 
167 {
168  delete ui;
169 }
170 
172 {
173  // On other operating systems, the expected action is to print the message to the console.
174  fprintf(stdout, "%s\n", qPrintable(text));
175 }
176 
178 {
179 #if defined(WIN32)
180  // On Windows, show a message box, as there is no stderr/stdout in windowed applications
181  exec();
182 #else
183  // On other operating systems, print help text to console
184  printToConsole();
185 #endif
186 }
187 
189 {
190  close();
191 }
192 
195  QDialog(parent),
196  ui(new Ui::PaperWalletDialog)
197 {
198  ui->setupUi(this);
199 
200  ui->buttonBox->addButton(tr("Close"), QDialogButtonBox::RejectRole);
201 
202  // Begin with a small bold monospace font for the textual version of the key and address.
203  QFont font("Monospace");
204  font.setBold(true);
205  font.setStyleHint(QFont::TypeWriter);
206  font.setPixelSize(1);
207  ui->addressText->setFont(font);
208  ui->privateKeyText->setFont(font);
209  ui->addressText->setAlignment(Qt::AlignJustify);
210  ui->privateKeyText->setAlignment(Qt::AlignJustify);
211  setFixedSize(size());
212 }
213 
215 {
216  this->clientModel = _clientModel;
217 
218  // FIXME: This cannot be the right way of doing something on open
219  if (_clientModel && _clientModel->getNetworkActive()) {
220  QMessageBox::critical(this, "Warning: Network Activity Detected", tr("It is recommended to disconnect from the internet before printing paper wallets. Even though paper wallets are generated on your local computer, it is still possible to unknowingly have malware that transmits your screen to a remote location. It is also recommended to print to a local printer vs a network printer since that network traffic can be monitored. Some advanced printers also store copies of each printed document. Proceed with caution relative to the amount of value you plan to store on each address."), QMessageBox::Ok, QMessageBox::Ok);
221  }
222 }
223 
225 {
226  RandAddSeed();
227  this->model = model;
228  this->on_getNewAddress_clicked();
229 }
230 
232 {
233  delete ui;
234 }
235 
237 {
238  // Create a new private key
239  CKey privKey;
240  privKey.MakeNewKey(true);
241 
242  // Derive the public key
243  CPubKey pubkey = privKey.GetPubKey();
244 
245  // Derive the public key hash
246  CBitcoinAddress pubkeyhash;
247  pubkeyhash.Set(pubkey.GetID());
248 
249  // Create String versions of each
250  std::string myPrivKey = CBitcoinSecret(privKey).ToString();
251  std::string myPubKey = HexStr(pubkey.begin(), pubkey.end());
252  std::string myAddress = pubkeyhash.ToString();
253 
254 
255 #ifdef USE_QRCODE
256  // Generate the address QR code
257  QRcode *code = QRcode_encodeString(myAddress.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1);
258  if (!code) {
259  ui->addressQRCode->setText(tr("Error encoding Address into QR Code."));
260  return;
261  }
262  QImage myImage = QImage(code->width, code->width, QImage::Format_ARGB32);
263  myImage.fill(QColor(0, 0, 0, 0));
264  unsigned char* p = code->data;
265  for (int y = 0; y < code->width; y++) {
266  for (int x = 0; x < code->width; x++) {
267  myImage.setPixel(x, y, ((*p & 1) ? 0xff000000 : 0x0));
268  p++;
269  }
270  }
271  QRcode_free(code);
272 
273 
274  // Generate the private key QR code
275  code = QRcode_encodeString(myPrivKey.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1);
276  if (!code) {
277  ui->privateKeyQRCode->setText(tr("Error encoding private key into QR Code."));
278  return;
279  }
280  QImage myImagePriv = QImage(code->width, code->width, QImage::Format_ARGB32);
281  myImagePriv.fill(QColor(0, 0, 0, 0));
282  p = code->data;
283  for (int y = 0; y < code->width; y++) {
284  for (int x = 0; x < code->width; x++) {
285  myImagePriv.setPixel(x, y, ((*p & 1) ? 0xff000000 : 0x0));
286  p++;
287  }
288  }
289  QRcode_free(code);
290 
291  // Populate the QR Codes
292  ui->addressQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(ui->addressQRCode->width(), ui->addressQRCode->height()));
293  ui->privateKeyQRCode->setPixmap(QPixmap::fromImage(myImagePriv).scaled(ui->privateKeyQRCode->width(), ui->privateKeyQRCode->height()));
294 #endif
295 
296  // Populate the Texts
297  ui->addressText->setText(myAddress.c_str());
298  ui->privateKeyText->setText(tr(myPrivKey.c_str()));
299 
300  ui->publicKey->setHtml(myPubKey.c_str());
301 
302  // Update the fonts to fit the height of the wallet.
303  // This should only really trigger the first time since the font size persists.
304  double paperHeight = (double)ui->paperTemplate->height();
305  double maxTextWidth = paperHeight * 0.99;
306  double minTextWidth = paperHeight * 0.95;
307  int pixelSizeStep = 1;
308 
309  int addressTextLength = ui->addressText->fontMetrics().boundingRect(ui->addressText->text()).width();
310  QFont font = ui->addressText->font();
311  for (int i = 0; i < PAPER_WALLET_READJUST_LIMIT; i++) {
312  if (addressTextLength < minTextWidth) {
313  font.setPixelSize(font.pixelSize() + pixelSizeStep);
314  ui->addressText->setFont(font);
315  addressTextLength = ui->addressText->fontMetrics().boundingRect(ui->addressText->text()).width();
316  } else {
317  break;
318  }
319  }
320  if (addressTextLength > maxTextWidth) {
321  font.setPixelSize(font.pixelSize() - pixelSizeStep);
322  ui->addressText->setFont(font);
323  addressTextLength = ui->addressText->fontMetrics().boundingRect(ui->addressText->text()).width();
324  }
325 
326  int privateKeyTextLength = ui->privateKeyText->fontMetrics().boundingRect(ui->privateKeyText->text()).width();
327  font = ui->privateKeyText->font();
328  for (int i = 0; i < PAPER_WALLET_READJUST_LIMIT; i++) {
329  if (privateKeyTextLength < minTextWidth) {
330  font.setPixelSize(font.pixelSize() + pixelSizeStep);
331  ui->privateKeyText->setFont(font);
332  privateKeyTextLength = ui->privateKeyText->fontMetrics().boundingRect(ui->privateKeyText->text()).width();
333  } else {
334  break;
335  }
336  }
337  if (privateKeyTextLength > maxTextWidth) {
338  font.setPixelSize(font.pixelSize() - pixelSizeStep);
339  ui->privateKeyText->setFont(font);
340  privateKeyTextLength = ui->privateKeyText->fontMetrics().boundingRect(ui->privateKeyText->text()).width();
341  }
342 }
343 
345 {
346  QPrinter printer(QPrinter::HighResolution);
347  QPrintDialog* qpd = new QPrintDialog(&printer, this);
348 
349  qpd->setPrintRange(QAbstractPrintDialog::AllPages);
350 
351  QList<QString> recipientPubKeyHashes;
352 
353  if (qpd->exec() != QDialog::Accepted) {
354  return;
355  }
356 
357  // Hardcode these values
358  printer.setOrientation(QPrinter::Portrait);
359  printer.setPaperSize(QPrinter::A4);
360  printer.setFullPage(true);
361 
362  QPainter painter;
363  if (!painter.begin(&printer)) { // failed to open file
364  QMessageBox::critical(this, "Printing Error", tr("failed to open file, is it writable?"), QMessageBox::Ok, QMessageBox::Ok);
365  return;
366  }
367 
368  int walletCount = ui->walletCount->currentIndex() + 1;
369  int walletsPerPage = 4;
370 
371  int pageHeight = printer.pageRect().height() - PAPER_WALLET_PAGE_MARGIN;
372  int walletHeight = ui->paperTemplate->height();
373  double computedWalletHeight = 0.9 * pageHeight / walletsPerPage;
374  double scale = computedWalletHeight / walletHeight;
375  double walletPadding = pageHeight * 0.05 / (walletsPerPage - 1) / scale;
376 
377  QRegion walletRegion = QRegion(ui->paperTemplate->x(), ui->paperTemplate->y(), ui->paperTemplate->width(), ui->paperTemplate->height());
378  painter.scale(scale, scale);
379 
380  for (int i = 0; i < walletCount; i++) {
381  QPoint point = QPoint(PAPER_WALLET_PAGE_MARGIN, (PAPER_WALLET_PAGE_MARGIN / 2) + (i % walletsPerPage) * (walletHeight + walletPadding));
382  this->render(&painter, point, walletRegion);
383  recipientPubKeyHashes.append(ui->addressText->text());
384 
385  if (i % walletsPerPage == (walletsPerPage - 1)) {
386  printer.newPage();
387  }
388 
389  this->on_getNewAddress_clicked();
390  }
391 
392  painter.end();
393 
394 #ifdef ENABLE_WALLET
395  QStringList formatted;
396 
398  while (true) {
399  bool ok;
400 
401  // Ask for an amount to send to each paper wallet. It might be better to try to use the BitcoinAmountField, but this works fine.
402  double amountInput = QInputDialog::getDouble(this, tr("Load Paper Wallets"), tr("The paper wallet printing process has begun.<br/>Please wait for the wallets to print completely and verify that everything printed correctly.<br/>Check for misalignments, ink bleeding, smears, or anything else that could make the private keys unreadable.<br/>Now, enter the number of DOGE you wish to send to each wallet:"), 0, 0, 2147483647, 8, &ok);
403 
404  if (!ok) {
405  return;
406  }
407 
408 
410  if (!ctx.isValid()) {
411  return;
412  }
413 
414  QList<SendCoinsRecipient> recipients;
415  quint64 amount = (quint64)(amountInput * COIN);
416  Q_FOREACH (const QString& dest, recipientPubKeyHashes) {
417  recipients.append(SendCoinsRecipient(dest, tr("Paper wallet %1").arg(dest), amount, ""));
418  formatted.append(tr("<b>%1</b> to Paper Wallet <span style='font-family: monospace;'>%2</span>").arg(QString::number(amountInput, 'f', 8), GUIUtil::HtmlEscape(dest)));
419  }
420 
421  tx = new WalletModelTransaction(recipients);
422 
423  WalletModel::SendCoinsReturn prepareStatus;
424  if (this->model->getOptionsModel()->getCoinControlFeatures()) // coin control enabled
425  prepareStatus = this->model->prepareTransaction(*tx, CoinControlDialog::coinControl);
426  else
427  prepareStatus = this->model->prepareTransaction(*tx);
428 
429  if (prepareStatus.status == WalletModel::InvalidAddress) {
430  QMessageBox::critical(this, tr("Send Coins"), tr("The recipient address is not valid, please recheck."), QMessageBox::Ok, QMessageBox::Ok);
431  } else if (prepareStatus.status == WalletModel::InvalidAmount) {
432  QMessageBox::critical(this, tr("Send Coins"), tr("The amount to pay must be larger than 0"), QMessageBox::Ok, QMessageBox::Ok);
433  } else if (prepareStatus.status == WalletModel::AmountExceedsBalance) {
434  QMessageBox::critical(this, tr("Send Coins"), tr("The amount exceeds your balance."), QMessageBox::Ok, QMessageBox::Ok);
435  } else if (prepareStatus.status == WalletModel::AmountWithFeeExceedsBalance) {
436  QMessageBox::critical(this, tr("Send Coins"), tr("The total exceeds your balance when the transaction fee is included"), QMessageBox::Ok, QMessageBox::Ok);
437  } else if (prepareStatus.status == WalletModel::DuplicateAddress) {
438  QMessageBox::critical(this, tr("Send Coins"), tr("Duplicate address found, can only send to each address once per send operation."), QMessageBox::Ok, QMessageBox::Ok);
439  } else if (prepareStatus.status == WalletModel::TransactionCreationFailed) {
440  QMessageBox::critical(this, tr("Send Coins"), tr("Transaction creation failed!"), QMessageBox::Ok, QMessageBox::Ok);
441  } else if (prepareStatus.status == WalletModel::OK) {
442  break;
443  } else {
444  delete tx;
445  return;
446  }
447  }
448 
449  // Stolen from sendcoinsdialog.cpp
450  qint64 txFee = tx->getTransactionFee();
451  QString questionString = tr("Are you sure you want to send?");
452  questionString.append("<br /><br />%1");
453 
454  if (txFee > 0) {
455  // append fee string if a fee is required
456  questionString.append("<hr /><span style='color:#aa0000;'>");
457  questionString.append(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
458  questionString.append("</span> ");
459  questionString.append(tr("added as transaction fee"));
460  }
461 
462  // add total amount in all subdivision units
463  questionString.append("<hr />");
464  qint64 totalAmount = tx->getTotalTransactionAmount() + txFee;
465  QStringList alternativeUnits;
467  if (u != model->getOptionsModel()->getDisplayUnit())
468  alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
469  }
470 
471  questionString.append(tr("Total Amount %1 (= %2)")
473  .arg(alternativeUnits.join(" " + tr("or") + " ")));
474 
475  QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
476 
477  if (retval != QMessageBox::Yes) {
478  delete tx;
479  return;
480  }
481 
482  WalletModel::SendCoinsReturn sendStatus = this->model->sendCoins(*tx);
483 
484  if (sendStatus.status == WalletModel::TransactionCommitFailed) {
485  QMessageBox::critical(this, tr("Send Coins"), tr("The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."), QMessageBox::Ok, QMessageBox::Ok);
486  }
487  delete tx;
488 #endif
489  return;
490 }
491 
493 ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):
494  QWidget(parent, f)
495 {
496  QVBoxLayout *layout = new QVBoxLayout();
497  layout->addWidget(new QLabel(
498  tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" +
499  tr("Do not shut down the computer until this window disappears.")));
500  setLayout(layout);
501 }
502 
504 {
505  if (!window)
506  return nullptr;
507 
508  // Show a simple window indicating shutdown status
509  QWidget *shutdownWindow = new ShutdownWindow();
510  shutdownWindow->setWindowTitle(window->windowTitle());
511 
512  // Center shutdown window at where main window was
513  const QPoint global = window->mapToGlobal(window->rect().center());
514  shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2);
515  shutdownWindow->show();
516  return shutdownWindow;
517 }
518 
519 void ShutdownWindow::closeEvent(QCloseEvent *event)
520 {
521  event->ignore();
522 }
Bitcoin GUI main class.
Definition: bitcoingui.h:47
static const std::string DEFAULT_UIPLATFORM
Definition: bitcoingui.h:52
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
Unit
Bitcoin units.
Definition: bitcoinunits.h:58
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
std::string ToString() const
Definition: base58.cpp:193
base58-encoded Bitcoin addresses.
Definition: base58.h:104
bool Set(const CKeyID &id)
Definition: base58.cpp:230
A base58-encoded secret key.
Definition: base58.h:126
An encapsulated private key.
Definition: key.h:36
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
Definition: key.cpp:126
CPubKey GetPubKey() const
Compute the public key from a private key.
Definition: key.cpp:155
An encapsulated public key.
Definition: pubkey.h:40
const unsigned char * end() const
Definition: pubkey.h:99
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Definition: pubkey.h:142
const unsigned char * begin() const
Definition: pubkey.h:98
Model for Bitcoin network client.
Definition: clientmodel.h:42
bool getNetworkActive() const
Return true if network activity in core is enabled.
static CCoinControl * coinControl
"Help message" dialog box
Definition: utilitydialog.h:46
HelpMessageDialog(QWidget *parent, bool about)
"Help message" or "About" dialog box
Ui::HelpMessageDialog * ui
Definition: utilitydialog.h:57
int getDisplayUnit()
Definition: optionsmodel.h:65
bool getCoinControlFeatures()
Definition: optionsmodel.h:68
"Paper Wallet" dialog box
Definition: utilitydialog.h:22
ClientModel * clientModel
Definition: utilitydialog.h:34
WalletModel * model
Definition: utilitydialog.h:35
Ui::PaperWalletDialog * ui
Definition: utilitydialog.h:33
PaperWalletDialog(QWidget *parent)
"PaperWallet" dialog box
void setClientModel(ClientModel *clientModel)
static const int PAPER_WALLET_READJUST_LIMIT
Definition: utilitydialog.h:36
void setModel(WalletModel *model)
void on_getNewAddress_clicked()
static const int PAPER_WALLET_PAGE_MARGIN
Definition: utilitydialog.h:37
static QWidget * showShutdownWindow(BitcoinGUI *window)
ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=0)
"Shutdown" window
void closeEvent(QCloseEvent *event)
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:99
SendCoinsReturn sendCoins(WalletModelTransaction &transaction)
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl=NULL)
OptionsModel * getOptionsModel()
UnlockContext requestUnlock()
@ AmountWithFeeExceedsBalance
Definition: walletmodel.h:112
@ TransactionCreationFailed
Definition: walletmodel.h:114
@ AmountExceedsBalance
Definition: walletmodel.h:111
@ TransactionCommitFailed
Definition: walletmodel.h:115
Data model for a walletmodel transaction.
std::string FormatFullVersion()
std::string HelpMessage(HelpMessageMode mode)
Help for options shared between UI and daemon (for -help)
Definition: init.cpp:319
std::string LicenseInfo()
Returns licensing information (for -version)
Definition: init.cpp:510
@ HMM_BITCOIN_QT
Definition: init.h:56
QString HtmlEscape(const QString &str, bool fMultiLine)
Definition: guiutil.cpp:255
void RandAddSeed()
Definition: random.cpp:46
#define strprintf
Definition: tinyformat.h:1047
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
Definition: util.cpp:411
std::string HelpMessageGroup(const std::string &message)
Format a string to be used as group of options in help messages.
Definition: util.cpp:448
std::string HelpMessageOpt(const std::string &option, const std::string &message)
Format a string to be used as option description in help messages.
Definition: util.cpp:452
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)