Browse Source

Merge pull request #1636 from Diapolo/Warning_string

Update Warning-strings to use a standard-format
miguelfreitas
Jeff Garzik 13 years ago
parent
commit
ffe47d6d5d
  1. 2
      src/init.cpp
  2. 8
      src/main.cpp
  3. 4
      src/net.cpp
  4. 6
      src/qt/askpassphrasedialog.cpp
  5. 2
      src/script.h
  6. 2
      src/util.cpp
  7. 2
      src/wallet.cpp

2
src/init.cpp

@ -417,7 +417,7 @@ bool AppInit2()
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str())); return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"].c_str()));
if (nTransactionFee > 0.25 * COIN) if (nTransactionFee > 0.25 * COIN)
InitWarning(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction.")); InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction."));
} }
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log

8
src/main.cpp

@ -988,7 +988,7 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainWork.ToString().c_str(),
DateTimeStrFormat("%x %H:%M:%S", pindexBest->GetBlockTime()).c_str()); DateTimeStrFormat("%x %H:%M:%S", pindexBest->GetBlockTime()).c_str());
if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6) if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6)
printf("InvalidChainFound: WARNING: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n"); printf("InvalidChainFound: Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n");
} }
void CBlock::UpdateTime(const CBlockIndex* pindexPrev) void CBlock::UpdateTime(const CBlockIndex* pindexPrev)
@ -1657,7 +1657,7 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew)
printf("SetBestChain: %d of last 100 blocks above version %d\n", nUpgraded, CBlock::CURRENT_VERSION); printf("SetBestChain: %d of last 100 blocks above version %d\n", nUpgraded, CBlock::CURRENT_VERSION);
if (nUpgraded > 100/2) if (nUpgraded > 100/2)
// strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user: // strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
strMiscWarning = _("Warning: this version is obsolete, upgrade required"); strMiscWarning = _("Warning: This version is obsolete, upgrade required!");
} }
std::string strCmd = GetArg("-blocknotify", ""); std::string strCmd = GetArg("-blocknotify", "");
@ -1923,7 +1923,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes)
if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes) if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes)
{ {
fShutdown = true; fShutdown = true;
string strMessage = _("Warning: Disk space is low"); string strMessage = _("Warning: Disk space is low!");
strMiscWarning = strMessage; strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str()); printf("*** %s\n", strMessage.c_str());
uiInterface.ThreadSafeMessageBox(strMessage, "Bitcoin", CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL); uiInterface.ThreadSafeMessageBox(strMessage, "Bitcoin", CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL);
@ -2218,7 +2218,7 @@ string GetWarnings(string strFor)
if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6) if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6)
{ {
nPriority = 2000; nPriority = 2000;
strStatusBar = strRPC = "WARNING: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade."; strStatusBar = strRPC = _("Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.");
} }
// Alerts // Alerts

4
src/net.cpp

@ -589,7 +589,7 @@ bool CNode::Misbehaving(int howmuch)
{ {
if (addr.IsLocal()) if (addr.IsLocal())
{ {
printf("Warning: local node %s misbehaving (delta: %d)\n", addrName.c_str(), howmuch); printf("Warning: Local node %s misbehaving (delta: %d)!\n", addrName.c_str(), howmuch);
return false; return false;
} }
@ -812,7 +812,7 @@ void ThreadSocketHandler2(void* parg)
if (hSocket != INVALID_SOCKET) if (hSocket != INVALID_SOCKET)
if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr))
printf("warning: unknown socket family\n"); printf("Warning: Unknown socket family\n");
{ {
LOCK(cs_vNodes); LOCK(cs_vNodes);

6
src/qt/askpassphrasedialog.cpp

@ -98,7 +98,7 @@ void AskPassphraseDialog::accept()
break; break;
} }
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"), QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!\nAre you sure you wish to encrypt your wallet?"), tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel); QMessageBox::Cancel);
if(retval == QMessageBox::Yes) if(retval == QMessageBox::Yes)
@ -204,7 +204,7 @@ bool AskPassphraseDialog::event(QEvent *event)
fCapsLock = !fCapsLock; fCapsLock = !fCapsLock;
} }
if (fCapsLock) { if (fCapsLock) {
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on.")); ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
} else { } else {
ui->capsLabel->clear(); ui->capsLabel->clear();
} }
@ -228,7 +228,7 @@ bool AskPassphraseDialog::eventFilter(QObject *, QEvent *event)
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0; bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
if ((fShift && psz->isLower()) || (!fShift && psz->isUpper())) { if ((fShift && psz->isLower()) || (!fShift && psz->isUpper())) {
fCapsLock = true; fCapsLock = true;
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on.")); ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
} else if (psz->isLetter()) { } else if (psz->isLetter()) {
fCapsLock = false; fCapsLock = false;
ui->capsLabel->clear(); ui->capsLabel->clear();

2
src/script.h

@ -378,7 +378,7 @@ public:
{ {
// I'm not sure if this should push the script or concatenate scripts. // I'm not sure if this should push the script or concatenate scripts.
// If there's ever a use for pushing a script onto a script, delete this member fn // If there's ever a use for pushing a script onto a script, delete this member fn
assert(!"warning: pushing a CScript onto a CScript with << is probably not intended, use + to concatenate"); assert(!"Warning: Pushing a CScript onto a CScript with << is probably not intended, use + to concatenate!");
return *this; return *this;
} }

2
src/util.cpp

@ -1205,7 +1205,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
if (!fMatch) if (!fMatch)
{ {
fDone = true; fDone = true;
string strMessage = _("Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."); string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly.");
strMiscWarning = strMessage; strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str()); printf("*** %s\n", strMessage.c_str());
uiInterface.ThreadSafeMessageBox(strMessage+" ", string("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION); uiInterface.ThreadSafeMessageBox(strMessage+" ", string("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION);

2
src/wallet.cpp

@ -1557,7 +1557,7 @@ CPubKey CReserveKey::GetReservedKey()
vchPubKey = keypool.vchPubKey; vchPubKey = keypool.vchPubKey;
else else
{ {
printf("CReserveKey::GetReservedKey(): Warning: using default key instead of a new key, top up your keypool."); printf("CReserveKey::GetReservedKey(): Warning: Using default key instead of a new key, top up your keypool!");
vchPubKey = pwallet->vchDefaultKey; vchPubKey = pwallet->vchDefaultKey;
} }
} }

Loading…
Cancel
Save