Browse Source

change strings to Bitcoin (uppercase), where it is used as a noun and update strings to use "Qt" (and not qt or QT) / update initialisation of notificator to use qApp->applicationName() instead of a static string

miguelfreitas
Philip Kaufmann 13 years ago
parent
commit
ff0ee876bb
  1. 2
      src/base58.h
  2. 26
      src/bitcoinrpc.cpp
  3. 7
      src/init.cpp
  4. 8
      src/qt/bitcoingui.cpp
  5. 2
      src/qt/editaddressdialog.cpp
  6. 2
      src/qt/guiutil.h
  7. 2
      src/qt/optionsmodel.cpp
  8. 4
      src/qt/optionsmodel.h
  9. 2
      src/qt/rpcconsole.h
  10. 2
      src/rpcdump.cpp
  11. 2
      src/test/util_tests.cpp
  12. 2
      src/wallet.cpp

2
src/base58.h

@ -252,7 +252,7 @@ public:
bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; } bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; }
}; };
/** base58-encoded bitcoin addresses. /** base58-encoded Bitcoin addresses.
* Public-key-hash-addresses have version 0 (or 111 testnet). * Public-key-hash-addresses have version 0 (or 111 testnet).
* The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key. * The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
* Script-hash-addresses have version 5 (or 196 testnet). * Script-hash-addresses have version 5 (or 196 testnet).

26
src/bitcoinrpc.cpp

@ -418,10 +418,10 @@ Value stop(const Array& params, bool fHelp)
if (fHelp || params.size() != 0) if (fHelp || params.size() != 0)
throw runtime_error( throw runtime_error(
"stop\n" "stop\n"
"Stop bitcoin server."); "Stop Bitcoin server.");
// Shutdown will take long enough that the response should get back // Shutdown will take long enough that the response should get back
QueueShutdown(); QueueShutdown();
return "bitcoin server stopping"; return "Bitcoin server stopping";
} }
@ -562,7 +562,7 @@ Value getnewaddress(const Array& params, bool fHelp)
if (fHelp || params.size() > 1) if (fHelp || params.size() > 1)
throw runtime_error( throw runtime_error(
"getnewaddress [account]\n" "getnewaddress [account]\n"
"Returns a new bitcoin address for receiving payments. " "Returns a new Bitcoin address for receiving payments. "
"If [account] is specified (recommended), it is added to the address book " "If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account]."); "so payments received with the address will be credited to [account].");
@ -629,7 +629,7 @@ Value getaccountaddress(const Array& params, bool fHelp)
if (fHelp || params.size() != 1) if (fHelp || params.size() != 1)
throw runtime_error( throw runtime_error(
"getaccountaddress <account>\n" "getaccountaddress <account>\n"
"Returns the current bitcoin address for receiving payments to this account."); "Returns the current Bitcoin address for receiving payments to this account.");
// Parse the account first so we don't generate a key if there's an error // Parse the account first so we don't generate a key if there's an error
string strAccount = AccountFromValue(params[0]); string strAccount = AccountFromValue(params[0]);
@ -652,7 +652,7 @@ Value setaccount(const Array& params, bool fHelp)
CBitcoinAddress address(params[0].get_str()); CBitcoinAddress address(params[0].get_str());
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address"); throw JSONRPCError(-5, "Invalid Bitcoin address");
string strAccount; string strAccount;
@ -682,7 +682,7 @@ Value getaccount(const Array& params, bool fHelp)
CBitcoinAddress address(params[0].get_str()); CBitcoinAddress address(params[0].get_str());
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address"); throw JSONRPCError(-5, "Invalid Bitcoin address");
string strAccount; string strAccount;
map<CBitcoinAddress, string>::iterator mi = pwalletMain->mapAddressBook.find(address); map<CBitcoinAddress, string>::iterator mi = pwalletMain->mapAddressBook.find(address);
@ -743,7 +743,7 @@ Value sendtoaddress(const Array& params, bool fHelp)
CBitcoinAddress address(params[0].get_str()); CBitcoinAddress address(params[0].get_str());
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address"); throw JSONRPCError(-5, "Invalid Bitcoin address");
// Amount // Amount
int64 nAmount = AmountFromValue(params[1]); int64 nAmount = AmountFromValue(params[1]);
@ -841,7 +841,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
CBitcoinAddress address = CBitcoinAddress(params[0].get_str()); CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey; CScript scriptPubKey;
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address"); throw JSONRPCError(-5, "Invalid Bitcoin address");
scriptPubKey.SetBitcoinAddress(address); scriptPubKey.SetBitcoinAddress(address);
if (!IsMine(*pwalletMain,scriptPubKey)) if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0; return (double)0.0;
@ -1067,7 +1067,7 @@ Value sendfrom(const Array& params, bool fHelp)
string strAccount = AccountFromValue(params[0]); string strAccount = AccountFromValue(params[0]);
CBitcoinAddress address(params[1].get_str()); CBitcoinAddress address(params[1].get_str());
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(-5, "Invalid bitcoin address"); throw JSONRPCError(-5, "Invalid Bitcoin address");
int64 nAmount = AmountFromValue(params[2]); int64 nAmount = AmountFromValue(params[2]);
int nMinDepth = 1; int nMinDepth = 1;
if (params.size() > 3) if (params.size() > 3)
@ -1128,7 +1128,7 @@ Value sendmany(const Array& params, bool fHelp)
{ {
CBitcoinAddress address(s.name_); CBitcoinAddress address(s.name_);
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(-5, string("Invalid bitcoin address:")+s.name_); throw JSONRPCError(-5, string("Invalid Bitcoin address:")+s.name_);
if (setAddress.count(address)) if (setAddress.count(address))
throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+s.name_); throw JSONRPCError(-8, string("Invalid parameter, duplicated address: ")+s.name_);
@ -1172,7 +1172,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
{ {
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n" string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
"Add a nrequired-to-sign multisignature address to the wallet\"\n" "Add a nrequired-to-sign multisignature address to the wallet\"\n"
"each key is a bitcoin address or hex-encoded public key\n" "each key is a Bitcoin address or hex-encoded public key\n"
"If [account] is specified, assign address to [account]."; "If [account] is specified, assign address to [account].";
throw runtime_error(msg); throw runtime_error(msg);
} }
@ -1196,7 +1196,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
{ {
const std::string& ks = keys[i].get_str(); const std::string& ks = keys[i].get_str();
// Case 1: bitcoin address and we have full public key: // Case 1: Bitcoin address and we have full public key:
CBitcoinAddress address(ks); CBitcoinAddress address(ks);
if (address.IsValid()) if (address.IsValid())
{ {
@ -1933,7 +1933,7 @@ Value encryptwallet(const Array& params, bool fHelp)
// slack space in .dat files; that is bad if the old data is // slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So: // unencrypted private keys. So:
QueueShutdown(); QueueShutdown();
return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet"; return "wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet";
} }

7
src/init.cpp

@ -162,7 +162,6 @@ bool static InitError(const std::string &str)
{ {
ThreadSafeMessageBox(str, _("Bitcoin"), wxOK | wxMODAL); ThreadSafeMessageBox(str, _("Bitcoin"), wxOK | wxMODAL);
return false; return false;
} }
bool static InitWarning(const std::string &str) bool static InitWarning(const std::string &str)
@ -352,7 +351,7 @@ bool AppInit2()
return false; return false;
} }
// Make sure only a single bitcoin process is using the data directory. // Make sure only a single Bitcoin process is using the data directory.
boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; boost::filesystem::path pathLockFile = GetDataDir() / ".lock";
FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist. FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist.
if (file) fclose(file); if (file) fclose(file);
@ -365,7 +364,7 @@ bool AppInit2()
// Load data files // Load data files
// //
if (fDaemon) if (fDaemon)
fprintf(stdout, "bitcoin server starting\n"); fprintf(stdout, "Bitcoin server starting\n");
int64 nStart; int64 nStart;
InitMessage(_("Loading addresses...")); InitMessage(_("Loading addresses..."));
@ -498,7 +497,7 @@ bool AppInit2()
// Add wallet transactions that aren't already in a block to mapTransactions // Add wallet transactions that aren't already in a block to mapTransactions
pwalletMain->ReacceptWalletTransactions(); pwalletMain->ReacceptWalletTransactions();
// Note: Bitcoin-QT stores several settings in the wallet, so we want // Note: Bitcoin-Qt stores several settings in the wallet, so we want
// to load the wallet BEFORE parsing command-line arguments, so // to load the wallet BEFORE parsing command-line arguments, so
// the command-line/bitcoin.conf settings override GUI setting. // the command-line/bitcoin.conf settings override GUI setting.

8
src/qt/bitcoingui.cpp

@ -207,7 +207,7 @@ void BitcoinGUI::createActions()
tabGroup->addAction(receiveCoinsAction); tabGroup->addAction(receiveCoinsAction);
sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
sendCoinsAction->setToolTip(tr("Send coins to a bitcoin address")); sendCoinsAction->setToolTip(tr("Send coins to a Bitcoin address"));
sendCoinsAction->setCheckable(true); sendCoinsAction->setCheckable(true);
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(sendCoinsAction); tabGroup->addAction(sendCoinsAction);
@ -243,7 +243,7 @@ void BitcoinGUI::createActions()
aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setToolTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole); aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
optionsAction->setToolTip(tr("Modify configuration options for bitcoin")); optionsAction->setToolTip(tr("Modify configuration options for Bitcoin"));
optionsAction->setMenuRole(QAction::PreferencesRole); optionsAction->setMenuRole(QAction::PreferencesRole);
toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &Bitcoin"), this); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &Bitcoin"), this);
toggleHideAction->setToolTip(tr("Show or hide the Bitcoin window")); toggleHideAction->setToolTip(tr("Show or hide the Bitcoin window"));
@ -426,7 +426,7 @@ void BitcoinGUI::createTrayIcon()
trayIconMenu->addAction(quitAction); trayIconMenu->addAction(quitAction);
#endif #endif
notificator = new Notificator(tr("bitcoin-qt"), trayIcon); notificator = new Notificator(qApp->applicationName(), trayIcon);
} }
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
@ -434,7 +434,7 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
{ {
if(reason == QSystemTrayIcon::Trigger) if(reason == QSystemTrayIcon::Trigger)
{ {
// Click on system tray icon triggers "show/hide bitcoin" // Click on system tray icon triggers "show/hide Bitcoin"
toggleHideAction->trigger(); toggleHideAction->trigger();
} }
} }

2
src/qt/editaddressdialog.cpp

@ -93,7 +93,7 @@ void EditAddressDialog::accept()
break; break;
case AddressTableModel::INVALID_ADDRESS: case AddressTableModel::INVALID_ADDRESS:
QMessageBox::warning(this, windowTitle(), QMessageBox::warning(this, windowTitle(),
tr("The entered address \"%1\" is not a valid bitcoin address.").arg(ui->addressEdit->text()), tr("The entered address \"%1\" is not a valid Bitcoin address.").arg(ui->addressEdit->text()),
QMessageBox::Ok, QMessageBox::Ok); QMessageBox::Ok, QMessageBox::Ok);
return; return;
case AddressTableModel::WALLET_UNLOCK_FAILURE: case AddressTableModel::WALLET_UNLOCK_FAILURE:

2
src/qt/guiutil.h

@ -22,7 +22,7 @@ namespace GUIUtil
QString dateTimeStr(const QDateTime &datetime); QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime); QString dateTimeStr(qint64 nTime);
// Render bitcoin addresses in monospace font // Render Bitcoin addresses in monospace font
QFont bitcoinAddressFont(); QFont bitcoinAddressFont();
// Set up widgets for address and amounts // Set up widgets for address and amounts

2
src/qt/optionsmodel.cpp

@ -24,7 +24,7 @@ void OptionsModel::Init()
nTransactionFee = settings.value("nTransactionFee").toLongLong(); nTransactionFee = settings.value("nTransactionFee").toLongLong();
language = settings.value("language", "").toString(); language = settings.value("language", "").toString();
// These are shared with core bitcoin; we want // These are shared with core Bitcoin; we want
// command-line options to override the GUI settings: // command-line options to override the GUI settings:
if (settings.contains("fUseUPnP")) if (settings.contains("fUseUPnP"))
SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()); SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool());

4
src/qt/optionsmodel.h

@ -3,8 +3,8 @@
#include <QAbstractListModel> #include <QAbstractListModel>
/** Interface from QT to configuration data structure for bitcoin client. /** Interface from Qt to configuration data structure for Bitcoin client.
To QT, the options are presented as a list with the different options To Qt, the options are presented as a list with the different options
laid out vertically. laid out vertically.
This can be changed to a tree once the settings become sufficiently This can be changed to a tree once the settings become sufficiently
complex. complex.

2
src/qt/rpcconsole.h

@ -8,7 +8,7 @@ namespace Ui {
} }
class ClientModel; class ClientModel;
/** Local bitcoin RPC console. */ /** Local Bitcoin RPC console. */
class RPCConsole: public QDialog class RPCConsole: public QDialog
{ {
Q_OBJECT Q_OBJECT

2
src/rpcdump.cpp

@ -88,7 +88,7 @@ Value dumpprivkey(const Array& params, bool fHelp)
string strAddress = params[0].get_str(); string strAddress = params[0].get_str();
CBitcoinAddress address; CBitcoinAddress address;
if (!address.SetString(strAddress)) if (!address.SetString(strAddress))
throw JSONRPCError(-5, "Invalid bitcoin address"); throw JSONRPCError(-5, "Invalid Bitcoin address");
CSecret vchSecret; CSecret vchSecret;
bool fCompressed; bool fCompressed;
if (!pwalletMain->GetSecret(address, vchSecret, fCompressed)) if (!pwalletMain->GetSecret(address, vchSecret, fCompressed))

2
src/test/util_tests.cpp

@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(util_DateTimeStrFormat)
{ {
BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M:%S", 0), "01/01/70 00:00:00"); BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M:%S", 0), "01/01/70 00:00:00");
BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M:%S", 0x7FFFFFFF), "01/19/38 03:14:07"); BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M:%S", 0x7FFFFFFF), "01/19/38 03:14:07");
// Formats used within bitcoin // Formats used within Bitcoin
BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M:%S", 1317425777), "09/30/11 23:36:17"); BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M:%S", 1317425777), "09/30/11 23:36:17");
BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M", 1317425777), "09/30/11 23:36"); BOOST_CHECK_EQUAL(DateTimeStrFormat("%x %H:%M", 1317425777), "09/30/11 23:36");
} }

2
src/wallet.cpp

@ -1251,7 +1251,7 @@ string CWallet::SendMoneyToBitcoinAddress(const CBitcoinAddress& address, int64
if (nValue + nTransactionFee > GetBalance()) if (nValue + nTransactionFee > GetBalance())
return _("Insufficient funds"); return _("Insufficient funds");
// Parse bitcoin address // Parse Bitcoin address
CScript scriptPubKey; CScript scriptPubKey;
scriptPubKey.SetBitcoinAddress(address); scriptPubKey.SetBitcoinAddress(address);

Loading…
Cancel
Save