aboutsummaryrefslogtreecommitdiff
path: root/src/qt/utilitydialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/utilitydialog.cpp')
-rw-r--r--src/qt/utilitydialog.cpp62
1 files changed, 44 insertions, 18 deletions
diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp
index 02a337fdf..e25e8cf7b 100644
--- a/src/qt/utilitydialog.cpp
+++ b/src/qt/utilitydialog.cpp
@@ -1,8 +1,11 @@
-// Copyright (c) 2011-2014 The Bitcoin Core developers
-// Copyright (c) 2014-2015 The Dogecoin Core developers
+// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#if defined(HAVE_CONFIG_H)
+#include "config/bitcoin-config.h"
+#endif
+
#include "utilitydialog.h"
#include "ui_helpmessagedialog.h"
@@ -13,19 +16,22 @@
#ifdef ENABLE_WALLET
#include "sendcoinsdialog.h"
#include "sendcoinsentry.h"
-#include "coincontrol.h"
#include "coincontroldialog.h"
#endif
#include "optionsmodel.h"
#include "bitcoingui.h"
#include "clientmodel.h"
+#include "guiconstants.h"
+#include "intro.h"
+#include "paymentrequestplus.h"
#include "guiutil.h"
#include "clientversion.h"
#include "init.h"
#include "util.h"
#include "net.h"
+#include "utilstrencodings.h"
#include <stdio.h>
@@ -62,9 +68,9 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
{
ui->setupUi(this);
- QString version = tr("Dogecoin Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion());
+ QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion());
/* On x86 add a bit specifier to the version so that users can distinguish between
- * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious.
+ * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambiguous.
*/
#if defined(__x86_64__)
version += " " + tr("(%1-bit)").arg(64);
@@ -74,7 +80,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
if (about)
{
- setWindowTitle(tr("About Dogecoin Core"));
+ setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME)));
/// HTML-format the license message from the core
QString licenseInfo = QString::fromStdString(LicenseInfo());
@@ -84,7 +90,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
uri.setMinimal(true); // use non-greedy matching
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
// Replace newlines with HTML breaks
- licenseInfoHTML.replace("\n\n", "<br><br>");
+ licenseInfoHTML.replace("\n", "<br>");
ui->aboutMessage->setTextFormat(Qt::RichText);
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
@@ -102,7 +108,22 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
cursor.insertText(header);
cursor.insertBlock();
- QString coreOptions = QString::fromStdString(HelpMessage(HMM_BITCOIN_QT));
+ std::string strUsage = HelpMessage(HMM_BITCOIN_QT);
+ const bool showDebug = GetBoolArg("-help-debug", false);
+ strUsage += HelpMessageGroup(tr("UI Options:").toStdString());
+ if (showDebug) {
+ strUsage += HelpMessageOpt("-allowselfsignedrootcertificates", strprintf("Allow self signed root certificates (default: %u)", DEFAULT_SELFSIGNED_ROOTCERTS));
+ }
+ strUsage += HelpMessageOpt("-choosedatadir", strprintf(tr("Choose data directory on startup (default: %u)").toStdString(), DEFAULT_CHOOSE_DATADIR));
+ strUsage += HelpMessageOpt("-lang=<lang>", tr("Set language, for example \"de_DE\" (default: system locale)").toStdString());
+ strUsage += HelpMessageOpt("-min", tr("Start minimized").toStdString());
+ strUsage += HelpMessageOpt("-rootcertificates=<file>", tr("Set SSL root certificates for payment request (default: -system-)").toStdString());
+ strUsage += HelpMessageOpt("-splash", strprintf(tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN));
+ strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changed in the GUI").toStdString());
+ if (showDebug) {
+ strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM));
+ }
+ QString coreOptions = QString::fromStdString(strUsage);
text = version + "\n" + header + "\n" + coreOptions;
QTextTableFormat tf;
@@ -116,7 +137,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
QTextCharFormat bold;
bold.setFontWeight(QFont::Bold);
- foreach (const QString &line, coreOptions.split("\n")) {
+ Q_FOREACH (const QString &line, coreOptions.split("\n")) {
if (line.startsWith(" -"))
{
cursor.currentTable()->appendRows(1);
@@ -187,8 +208,15 @@ PaperWalletDialog::PaperWalletDialog(QWidget *parent) :
ui->privateKeyText->setFont(font);
ui->addressText->setAlignment(Qt::AlignJustify);
ui->privateKeyText->setAlignment(Qt::AlignJustify);
+ setFixedSize(size());
+}
+
+void PaperWalletDialog::setClientModel(ClientModel *_clientModel)
+{
+ this->clientModel = _clientModel;
- if (vNodes.size() > 0) {
+ // FIXME: This cannot be the right way of doing something on open
+ if (_clientModel && _clientModel->getNetworkActive()) {
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);
}
}
@@ -385,7 +413,7 @@ void PaperWalletDialog::on_printButton_clicked()
QList<SendCoinsRecipient> recipients;
quint64 amount = (quint64)(amountInput * COIN);
- foreach (const QString& dest, recipientPubKeyHashes) {
+ Q_FOREACH (const QString& dest, recipientPubKeyHashes) {
recipients.append(SendCoinsRecipient(dest, tr("Paper wallet %1").arg(dest), amount, ""));
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)));
}
@@ -435,7 +463,7 @@ void PaperWalletDialog::on_printButton_clicked()
questionString.append("<hr />");
qint64 totalAmount = tx->getTotalTransactionAmount() + txFee;
QStringList alternativeUnits;
- foreach (BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) {
+ Q_FOREACH (BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) {
if (u != model->getOptionsModel()->getDisplayUnit())
alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
}
@@ -467,27 +495,25 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):
{
QVBoxLayout *layout = new QVBoxLayout();
layout->addWidget(new QLabel(
- tr("Dogecoin Core is shutting down...") + "<br /><br />" +
+ tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "<br /><br />" +
tr("Do not shut down the computer until this window disappears.")));
setLayout(layout);
}
-void ShutdownWindow::showShutdownWindow(BitcoinGUI *window)
+QWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window)
{
if (!window)
- return;
+ return nullptr;
// Show a simple window indicating shutdown status
QWidget *shutdownWindow = new ShutdownWindow();
- // We don't hold a direct pointer to the shutdown window after creation, so use
- // Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually.
- shutdownWindow->setAttribute(Qt::WA_DeleteOnClose);
shutdownWindow->setWindowTitle(window->windowTitle());
// Center shutdown window at where main window was
const QPoint global = window->mapToGlobal(window->rect().center());
shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2);
shutdownWindow->show();
+ return shutdownWindow;
}
void ShutdownWindow::closeEvent(QCloseEvent *event)