From d5f46832de900cee0801ca40bba743c9564cccb8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 9 Dec 2015 10:53:12 +0000 Subject: Unify package name to as few places as possible without major changes --- src/qt/askpassphrasedialog.cpp | 8 ++++++-- src/qt/bitcoin.cpp | 8 ++++---- src/qt/bitcoingui.cpp | 16 ++++++++++------ src/qt/forms/debugwindow.ui | 2 +- src/qt/forms/helpmessagedialog.ui | 3 --- src/qt/forms/intro.ui | 10 +++++----- src/qt/forms/optionsdialog.ui | 6 +++--- src/qt/intro.cpp | 10 ++++++++-- src/qt/optionsdialog.cpp | 5 +++++ src/qt/res/bitcoin-qt-res.rc | 4 ++-- src/qt/rpcconsole.cpp | 8 +++++++- src/qt/splashscreen.cpp | 8 ++++++-- src/qt/utilitydialog.cpp | 10 +++++++--- 13 files changed, 64 insertions(+), 34 deletions(-) (limited to 'src/qt') diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 441814ff07..e8e5825d1a 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -2,6 +2,10 @@ // 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 "askpassphrasedialog.h" #include "ui_askpassphrasedialog.h" @@ -119,9 +123,9 @@ void AskPassphraseDialog::accept() { QMessageBox::warning(this, tr("Wallet encrypted"), "" + - tr("Bitcoin Core will close now to finish the encryption process. " + tr("%1 will close now to finish the encryption process. " "Remember that encrypting your wallet cannot fully protect " - "your bitcoins from being stolen by malware infecting your computer.") + + "your bitcoins from being stolen by malware infecting your computer.").arg(tr(PACKAGE_NAME)) + "

" + tr("IMPORTANT: Any previous backups you have made of your wallet file " "should be replaced with the newly generated, encrypted wallet file. " diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 06a6c239ef..e108c84e39 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -578,14 +578,14 @@ int main(int argc, char *argv[]) /// - Do not call GetDataDir(true) before this step finishes if (!boost::filesystem::is_directory(GetDataDir(false))) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } try { ReadConfigFile(mapArgs, mapMultiArgs); } catch (const std::exception& e) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); return false; } @@ -600,7 +600,7 @@ int main(int argc, char *argv[]) try { SelectParams(ChainNameFromCommandLine()); } catch(std::exception &e) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: %1").arg(e.what())); + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what())); return 1; } #ifdef ENABLE_WALLET @@ -658,7 +658,7 @@ int main(int argc, char *argv[]) app.createWindow(networkStyle.data()); app.requestInitialize(); #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 - WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Bitcoin Core didn't yet exit safely..."), (HWND)app.getMainWinId()); + WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId()); #endif app.exec(); app.requestShutdown(); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6f9f6e90d6..811f27f97b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -2,6 +2,10 @@ // 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 "bitcoingui.h" #include "bitcoinunits.h" @@ -105,7 +109,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); - QString windowTitle = tr("Bitcoin Core") + " - "; + QString windowTitle = tr(PACKAGE_NAME) + " - "; #ifdef ENABLE_WALLET /* if compiled with wallet support, -disablewallet can still disable the wallet */ enableWallet = !GetBoolArg("-disablewallet", false); @@ -303,14 +307,14 @@ void BitcoinGUI::createActions() quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); - aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About Bitcoin Core"), this); - aboutAction->setStatusTip(tr("Show information about Bitcoin Core")); + aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this); + aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME))); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this); - optionsAction->setStatusTip(tr("Modify configuration options for Bitcoin Core")); + optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME))); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); @@ -340,7 +344,7 @@ void BitcoinGUI::createActions() showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this); showHelpMessageAction->setMenuRole(QAction::NoRole); - showHelpMessageAction->setStatusTip(tr("Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options")); + showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(tr(PACKAGE_NAME))); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); @@ -518,7 +522,7 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) { #ifndef Q_OS_MAC trayIcon = new QSystemTrayIcon(this); - QString toolTip = tr("Bitcoin Core client") + " " + networkStyle->getTitleAddText(); + QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText(); trayIcon->setToolTip(toolTip); trayIcon->setIcon(networkStyle->getTrayAndWindowIcon()); trayIcon->show(); diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 2471470363..7a3d29417e 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -415,7 +415,7 @@ - Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. + Open the %1 debug log file from the current data directory. This can take a few seconds for large log files. &Open diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui index dc7df9d6c8..b7f941f70b 100644 --- a/src/qt/forms/helpmessagedialog.ui +++ b/src/qt/forms/helpmessagedialog.ui @@ -10,9 +10,6 @@ 400 - - Bitcoin Core - Command-line options - 0 diff --git a/src/qt/forms/intro.ui b/src/qt/forms/intro.ui index 09e7bdb024..e4ff3da1ab 100644 --- a/src/qt/forms/intro.ui +++ b/src/qt/forms/intro.ui @@ -15,12 +15,12 @@ - + QLabel { font-style:italic; } - Welcome to Bitcoin Core. + Welcome to %1. true @@ -44,9 +44,9 @@ - + - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. + As this is the first time the program is launched, you can choose where %1 will store its data. true @@ -56,7 +56,7 @@ - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + %1 will download and store a copy of the Bitcoin block chain. At least %2GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. true diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 22c67b8040..c712e6ea01 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -30,10 +30,10 @@ - Automatically start Bitcoin Core after logging in to the system. + Automatically start %1 after logging in to the system. - &Start Bitcoin Core on system login + &Start %1 on system login @@ -562,7 +562,7 @@ - The user interface language can be set here. This setting will take effect after restarting Bitcoin Core. + The user interface language can be set here. This setting will take effect after restarting %1. diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 4ab87e0f32..8d1dc349db 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -2,6 +2,10 @@ // 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 "intro.h" #include "ui_intro.h" @@ -112,7 +116,9 @@ Intro::Intro(QWidget *parent) : signalled(false) { ui->setupUi(this); - ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(BLOCK_CHAIN_SIZE/GB_BYTES)); + ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); + ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); + ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(tr(PACKAGE_NAME)).arg(BLOCK_CHAIN_SIZE/GB_BYTES)); startThread(); } @@ -181,7 +187,7 @@ void Intro::pickDataDirectory() TryCreateDirectory(GUIUtil::qstringToBoostPath(dataDir)); break; } catch (const fs::filesystem_error&) { - QMessageBox::critical(0, tr("Bitcoin Core"), + QMessageBox::critical(0, tr(PACKAGE_NAME), tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir)); /* fall through, back to choosing screen */ } diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index d0191fa6d8..79a7406129 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -80,6 +80,11 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : /* Display elements init */ QDir translations(":translations"); + + ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(tr(PACKAGE_NAME))); + ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(tr(PACKAGE_NAME))); + + ui->lang->setToolTip(ui->lang->toolTip().arg(tr(PACKAGE_NAME))); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); Q_FOREACH(const QString &langStr, translations.entryList()) { diff --git a/src/qt/res/bitcoin-qt-res.rc b/src/qt/res/bitcoin-qt-res.rc index 9f66d0af79..19c3d5d97d 100644 --- a/src/qt/res/bitcoin-qt-res.rc +++ b/src/qt/res/bitcoin-qt-res.rc @@ -19,13 +19,13 @@ BEGIN BLOCK "040904E4" // U.S. English - multilingual (hex) BEGIN VALUE "CompanyName", "Bitcoin" - VALUE "FileDescription", "Bitcoin Core (GUI node for Bitcoin)" + VALUE "FileDescription", PACKAGE_NAME " (GUI node for Bitcoin)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-qt" VALUE "LegalCopyright", COPYRIGHT_STR VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "bitcoin-qt.exe" - VALUE "ProductName", "Bitcoin Core" + VALUE "ProductName", PACKAGE_NAME VALUE "ProductVersion", VER_PRODUCTVERSION_STR END END diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 619c8631ae..b60aa00f13 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -2,6 +2,10 @@ // 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 "rpcconsole.h" #include "ui_debugwindow.h" @@ -250,6 +254,8 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) : ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); + ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); + if (platformStyle->getImagesOnButtons()) { ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); } @@ -478,7 +484,7 @@ void RPCConsole::clear() ).arg(fixedFontInfo.family(), ptSize) ); - message(CMD_REPLY, (tr("Welcome to the Bitcoin Core RPC console.") + "
" + + message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(tr(PACKAGE_NAME)) + "
" + tr("Use up and down arrows to navigate history, and Ctrl-L to clear screen.") + "
" + tr("Type help for an overview of available commands.")), true); } diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index c15b64c327..339b684426 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -2,6 +2,10 @@ // 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 "splashscreen.h" #include "networkstyle.h" @@ -38,9 +42,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) #endif // define text to place - QString titleText = tr("Bitcoin Core"); + QString titleText = tr(PACKAGE_NAME); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); + QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The %1 developers").arg(tr(PACKAGE_NAME))); QString titleAddText = networkStyle->getTitleAddText(); QString font = QApplication::font().toString(); diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 5e26f3e01b..3e96f26b3a 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -2,6 +2,10 @@ // 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" @@ -30,7 +34,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : { ui->setupUi(this); - QString version = tr("Bitcoin 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. */ @@ -42,7 +46,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : if (about) { - setWindowTitle(tr("About Bitcoin Core")); + setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME))); /// HTML-format the license message from the core QString licenseInfo = QString::fromStdString(LicenseInfo()); @@ -144,7 +148,7 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): { QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(new QLabel( - tr("Bitcoin Core is shutting down...") + "

" + + tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "

" + tr("Do not shut down the computer until this window disappears."))); setLayout(layout); } -- cgit v1.2.3