all builds are now with wxWidgets-2.9.0, we are now using UTF-8, added support for language translation file locale/<lang>/LC_MESSAGES/bitcoin.mo -- version 0.2.2
Commit by Satoshi Nakamoto (s_nakamoto) on 17 February 2010 · SVN r66 · release v0.2.2 · 18 files, +428 −609
Open in Satoshi Mail View on GitHub
Files changed
build-msw.txt
@@ -29,11 +29,11 @@ Dependencies
------------
Libraries you need to download separately and build:
- default path download
-wxWidgets \wxwidgets prebuilt: http://wxpack.sourceforge.net
-OpenSSL \openssl http://www.openssl.org/source/
-Berkeley DB \db http://www.oracle.com/technology/software/products/berkeley-db/index.html
-Boost \boost http://www.boost.org/users/download/
+ default path download
+wxWidgets-2.9 \wxwidgets http://www.wxwidgets.org/downloads/
+OpenSSL \openssl http://www.openssl.org/source/
+Berkeley DB \db http://www.oracle.com/technology/software/products/berkeley-db/index.html
+Boost \boost http://www.boost.org/users/download/
Their licenses:
wxWidgets LGPL 2.1 with very liberal exceptions
@@ -43,10 +43,10 @@ Boost MIT-like license
Versions used in this release:
MinGW GCC 3.4.5
-wxWidgets 2.8.9
+wxWidgets 2.9.0
OpenSSL 0.9.8k
Berkeley DB 4.7.25.NC
-Boost 1.34.1
+Boost 1.42.1
Notes
@@ -59,6 +59,14 @@ The release is built with GCC and then "strip bitcoin.exe" to strip the debug
symbols, which reduces the executable size by about 90%.
+wxWidgets
+---------
+cd \wxwidgets\build\msw
+make -f makefile.gcc
+ or
+nmake -f makefile.vc
+
+
OpenSSL
-------
Bitcoin does not use any encryption. If you want to do a no-everything
@@ -104,5 +112,5 @@ download bjam.exe from
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
cd \boost
bjam toolset=gcc --build-type=complete stage
-or
+ or
bjam toolset=msvc --build-type=complete stage
build-unix.txt
@@ -20,15 +20,11 @@ sudo apt-get install libdb4.7-dev
sudo apt-get install libdb4.7++-dev
sudo apt-get install libboost-dev
-The release was built with wxWidgets 2.8.9 ansi on 32-bit. The current
-sourcecode can be built on 64-bit with wxWidgets 2.9.0.
+We're now using wxWidgets 2.9, which uses UTF-8.
-There is currently no libwxgtk2.8-ansi-dev debian package for Karmic.
-libwxgtk2.8-dev is the "unicode" build, but for wxWidgets 2.8 "unicode"
-means wchar, not UTF-8. wchar wxString doesn't convert to std::string.
-We haven't been able to compile the 2.8 versions on 64-bit.
-
-wxWidgets 2.9 is UTF-8 and compiles on 64-bit.
+There isn't currently a debian package of wxWidgets we can use. The 2.8
+packages for Karmic are UTF-16 unicode and won't work for us, and we've had
+trouble building 2.8 on 64-bit.
You need to download wxWidgets from http://www.wxwidgets.org/downloads/
and build it yourself. See the build instructions and configure parameters
@@ -42,9 +38,9 @@ Boost MIT-like license
Versions used in this release:
GCC 4.3.3
OpenSSL 0.9.8k
-wxWidgets 2.8.9
+wxWidgets 2.9.0
Berkeley DB 4.7.25.NC
-Boost 1.40.0
+Boost 1.38.0
Notes
@@ -59,7 +55,9 @@ symbols, which reduces the executable size by about 90%.
wxWidgets
---------
-cd /usr/local/wxWidgets-2.8.9 or 2.9.0
+cd /usr/local
+tar -xzvf wxWidgets-2.9.0.tar.gz
+cd /usr/local/wxWidgets-2.9.0
mkdir buildgtk
cd buildgtk
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic
@@ -72,7 +70,7 @@ ldconfig
Boost
-----
If you want to build Boost yourself,
-cd /usr/local/boost_1_40_0
+cd /usr/local/boost_1_42_0
su
./bootstrap.sh
./bjam install
locale/readme.txt
@@ -0,0 +1,5 @@
+put bitcoin.po and bitcoin.mo files at:
+locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
+
+.po is the sourcefile
+.mo is the compiled translation
main.cpp
@@ -1460,27 +1460,13 @@ bool ScanMessageStart(Stream& s)
bool CheckDiskSpace(int64 nAdditionalBytes)
{
-#ifdef __WXMSW__
- uint64 nFreeBytesAvailable = 0; // bytes available to caller
- uint64 nTotalNumberOfBytes = 0; // bytes on disk
- uint64 nTotalNumberOfFreeBytes = 0; // free bytes on disk
- if (!GetDiskFreeSpaceEx(GetDataDir().c_str(),
- (PULARGE_INTEGER)&nFreeBytesAvailable,
- (PULARGE_INTEGER)&nTotalNumberOfBytes,
- (PULARGE_INTEGER)&nTotalNumberOfFreeBytes))
- {
- printf("ERROR: GetDiskFreeSpaceEx() failed\n");
- return true;
- }
-#else
uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available;
-#endif
// Check for 15MB because database could create another 10MB log file at any time
if (nFreeBytesAvailable < (int64)15000000 + nAdditionalBytes)
{
fShutdown = true;
- ThreadSafeMessageBox("Warning: Your disk space is low ", "Bitcoin", wxOK | wxICON_EXCLAMATION);
+ ThreadSafeMessageBox(_("Warning: Disk space is low "), "Bitcoin", wxOK | wxICON_EXCLAMATION);
CreateThread(Shutdown, NULL);
return false;
}
@@ -2962,16 +2948,16 @@ string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew)
{
string strError;
if (nValue + nFeeRequired > GetBalance())
- strError = strprintf("Error: This is an oversized transaction that requires a transaction fee of %s ", FormatMoney(nFeeRequired).c_str());
+ strError = strprintf(_("Error: This is an oversized transaction that requires a transaction fee of %s "), FormatMoney(nFeeRequired).c_str());
else
- strError = "Error: Transaction creation failed ";
+ strError = _("Error: Transaction creation failed ");
printf("SendMoney() : %s", strError.c_str());
return strError;
}
if (!CommitTransactionSpent(wtxNew, key))
{
printf("SendMoney() : Error finalizing transaction");
- return "Error finalizing transaction";
+ return _("Error finalizing transaction");
}
// Track how many getdata requests our transaction gets
@@ -2985,7 +2971,7 @@ string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew)
{
// This must not fail. The transaction has already been signed and recorded.
printf("SendMoney() : Error: Transaction not valid");
- return "Error: 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.";
+ return _("Error: 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.");
}
wtxNew.RelayWalletTransaction();
}
@@ -2999,14 +2985,14 @@ string SendMoneyToBitcoinAddress(string strAddress, int64 nValue, CWalletTx& wtx
{
// Check amount
if (nValue <= 0)
- return "Invalid amount";
+ return _("Invalid amount");
if (nValue + nTransactionFee > GetBalance())
- return "You don't have enough money";
+ return _("You don't have enough money");
// Parse bitcoin address
CScript scriptPubKey;
if (!scriptPubKey.SetBitcoinAddress(strAddress))
- return "Invalid bitcoin address";
+ return _("Invalid bitcoin address");
return SendMoney(scriptPubKey, nValue, wtxNew);
}
makefile
makefile.mingw
@@ -3,27 +3,30 @@
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
-ifneq "$(BUILD)" "debug"
-ifneq "$(BUILD)" "release"
-BUILD=debug
-endif
-endif
-ifeq "$(BUILD)" "debug"
-D=d
-DEBUGFLAGS=-g -D__WXDEBUG__
-endif
+# for wxWidgets-2.8.x, search and replace "mswud"->"mswd" and "29u"->"28"
+INCLUDEPATHS= \
+ -I"/boost" \
+ -I"/db/build_unix" \
+ -I"/openssl/include" \
+ -I"/wxwidgets/lib/gcc_lib/mswud" \
+ -I"/wxwidgets/include"
+LIBPATHS= \
+ -L"/boost/stage/lib" \
+ -L"/db/build_unix" \
+ -L"/openssl/out" \
+ -L"/wxwidgets/lib/gcc_lib"
-INCLUDEPATHS=-I"/boost" -I"/db/build_unix" -I"/openssl/include" -I"/wxwidgets/lib/gcc_lib/mswd" -I"/wxwidgets/include"
-LIBPATHS=-L"/boost/stage/lib" -L"/db/build_unix" -L"/openssl/out" -L"/wxwidgets/lib/gcc_lib"
LIBS= \
-l libboost_system-mgw34-mt-d -l libboost_filesystem-mgw34-mt-d \
-l db_cxx \
-l eay32 \
- -l wxmsw28$(D)_richtext -l wxmsw28$(D)_html -l wxmsw28$(D)_core -l wxmsw28$(D)_adv -l wxbase28$(D) -l wxtiff$(D) -l wxjpeg$(D) -l wxpng$(D) -l wxzlib$(D) -l wxregex$(D) -l wxexpat$(D) \
+ -l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd \
-l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
+
WXDEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH
+DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-mthreads -O0 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h
makefile.unix
@@ -3,17 +3,6 @@
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
-ifneq "$(BUILD)" "debug"
-ifneq "$(BUILD)" "release"
-BUILD=debug
-endif
-endif
-ifeq "$(BUILD)" "debug"
-D=d
-DEBUGFLAGS=-g -D__WXDEBUG__
-endif
-
-
INCLUDEPATHS= \
-I"/usr/include" \
@@ -28,12 +17,13 @@ LIBS= \
-Wl,-Bstatic \
-l boost_system-mt -l boost_filesystem-mt \
-l db_cxx \
- -l wx_gtk2u$(D)-2.9 \
+ -l wx_gtk2ud-2.9 \
-Wl,-Bdynamic \
-l crypto \
-l gtk-x11-2.0 -l gthread-2.0 -l SM
WXDEFS=-D__WXGTK__ -DNOPCH
+DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-O0 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h
makefile.unix.wx2.8
@@ -1,88 +0,0 @@
-# Copyright (c) 2009-2010 Satoshi Nakamoto
-# Distributed under the MIT/X11 software license, see the accompanying
-# file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
-
-ifneq "$(BUILD)" "debug"
-ifneq "$(BUILD)" "release"
-BUILD=debug
-endif
-endif
-ifeq "$(BUILD)" "debug"
-D=d
-DEBUGFLAGS=-g -D__WXDEBUG__
-endif
-
-
-
-INCLUDEPATHS= \
- -I"/usr/include" \
- -I"/usr/local/include/wx-2.8" \
- -I"/usr/local/lib/wx/include/gtk2-ansi-debug-static-2.8"
-
-LIBPATHS= \
- -L"/usr/lib" \
- -L"/usr/local/lib"
-
-LIBS= \
- -Wl,-Bstatic \
- -l boost_system -l boost_filesystem \
- -l db_cxx \
- -l wx_gtk2$(D)-2.8 \
- -Wl,-Bdynamic \
- -l crypto \
- -l gtk-x11-2.0 -l gthread-2.0 -l SM
-
-WXDEFS=-D__WXGTK__ -DNOPCH
-CFLAGS=-O0 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
-HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h
-
-
-
-all: bitcoin
-
-
-headers.h.gch: headers.h $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/util.o: util.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/script.o: script.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/db.o: db.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/net.o: net.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/main.o: main.cpp $(HEADERS) sha.h
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/ui.o: ui.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/uibase.o: uibase.cpp uibase.h
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/sha.o: sha.cpp sha.h
- g++ -c $(CFLAGS) -O3 -o $@ $<
-
-obj/irc.o: irc.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-obj/rpc.o: rpc.cpp $(HEADERS)
- g++ -c $(CFLAGS) -o $@ $<
-
-
-
-OBJS=obj/util.o obj/script.o obj/db.o obj/net.o obj/main.o \
- obj/ui.o obj/uibase.o obj/sha.o obj/irc.o obj/rpc.o
-
-bitcoin: headers.h.gch $(OBJS)
- g++ $(CFLAGS) -o $@ $(LIBPATHS) $(OBJS) $(LIBS)
-
-clean:
- -rm obj/*
- -rm headers.h.gch
makefile.unix.wx2.9
makefile.vc
@@ -3,26 +3,31 @@
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
-!IF "$(BUILD)" != "debug" && "$(BUILD)" != "release"
-BUILD=debug
-!ENDIF
-!IF "$(BUILD)" == "debug"
-D=d
-DEBUGFLAGS=/Zi /Od /D__WXDEBUG__
-!ENDIF
+# for wxWidgets-2.8.x, search and replace "mswud"->"mswd" and "29u"->"28"
+INCLUDEPATHS= \
+ /I"/boost" \
+ /I"/db/build_windows" \
+ /I"/openssl/include" \
+ /I"/wxwidgets/lib/vc_lib/mswud" \
+ /I"/wxwidgets/include"
+LIBPATHS= \
+ /LIBPATH:"/boost/stage/lib" \
+ /LIBPATH:"/db/build_windows/debug" \
+ /LIBPATH:"/openssl/out" \
+ /LIBPATH:"/wxwidgets/lib/vc_lib"
-INCLUDEPATHS=/I"/boost" /I"/db/build_windows" /I"/openssl/include" /I"/wxwidgets/lib/vc_lib/mswd" /I"/wxwidgets/include"
-LIBPATHS=/LIBPATH:"/boost/stage/lib" /LIBPATH:"/db/build_windows/$(BUILD)" /LIBPATH:"/openssl/out" /LIBPATH:"/wxwidgets/lib/vc_lib"
LIBS= \
- libboost_system-vc80-mt-gd.lib libboost_filesystem-vc80-mt-gd.lib \
- libdb47s$(D).lib \
- libeay32.lib \
- wxmsw28$(D)_richtext.lib wxmsw28$(D)_html.lib wxmsw28$(D)_core.lib wxmsw28$(D)_adv.lib wxbase28$(D).lib wxtiff$(D).lib wxjpeg$(D).lib wxpng$(D).lib wxzlib$(D).lib wxregex$(D).lib wxexpat$(D).lib \
- kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib
+ libboost_system-vc80-mt-gd.lib libboost_filesystem-vc80-mt-gd.lib \
+ libdb47sd.lib \
+ libeay32.lib \
+ wxmsw29ud_html.lib wxmsw29ud_core.lib wxmsw29ud_adv.lib wxbase29ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib \
+ kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib
+
WXDEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH
-CFLAGS=/c /nologo /Ob0 /MD$(D) /EHsc /GR /Zm300 $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
+DEBUGFLAGS=/Zi /Od /D__WXDEBUG__
+CFLAGS=/c /nologo /Ob0 /MDd /EHsc /GR /Zm300 $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h
serialize.h
@@ -19,8 +19,8 @@ class CScript;
class CDataStream;
class CAutoFile;
-static const int VERSION = 201;
-static const char* pszSubVer = ".2";
+static const int VERSION = 202;
+static const char* pszSubVer = ".0";
ui.cpp
@@ -229,8 +229,8 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
m_staticTextBalance->SetSize(140, 17);
// & underlines don't work on the toolbar buttons on gtk
m_toolBar->ClearTools();
- m_toolBar->AddTool(wxID_BUTTONSEND, "Send Coins", wxBitmap(send20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
- m_toolBar->AddTool(wxID_BUTTONRECEIVE, "Address Book", wxBitmap(addressbook20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
+ m_toolBar->AddTool(wxID_BUTTONSEND, _("Send Coins"), wxBitmap(send20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
+ m_toolBar->AddTool(wxID_BUTTONRECEIVE, _("Address Book"), wxBitmap(addressbook20_xpm), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString);
m_toolBar->Realize();
// resize to fit ubuntu's huge default font
dResize = 1.20;
@@ -244,13 +244,13 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
int nDateWidth = DateTimeStr(1229413914).size() * 6 + 8;
if (!strstr(DateTimeStr(1229413914).c_str(), "2008"))
nDateWidth += 12;
- m_listCtrl->InsertColumn(0, "", wxLIST_FORMAT_LEFT, dResize * 0);
- m_listCtrl->InsertColumn(1, "", wxLIST_FORMAT_LEFT, dResize * 0);
- m_listCtrl->InsertColumn(2, "Status", wxLIST_FORMAT_LEFT, dResize * 110);
- m_listCtrl->InsertColumn(3, "Date", wxLIST_FORMAT_LEFT, dResize * nDateWidth);
- m_listCtrl->InsertColumn(4, "Description", wxLIST_FORMAT_LEFT, dResize * 409 - nDateWidth);
- m_listCtrl->InsertColumn(5, "Debit", wxLIST_FORMAT_RIGHT, dResize * 79);
- m_listCtrl->InsertColumn(6, "Credit", wxLIST_FORMAT_RIGHT, dResize * 79);
+ m_listCtrl->InsertColumn(0, "", wxLIST_FORMAT_LEFT, dResize * 0);
+ m_listCtrl->InsertColumn(1, "", wxLIST_FORMAT_LEFT, dResize * 0);
+ m_listCtrl->InsertColumn(2, _("Status"), wxLIST_FORMAT_LEFT, dResize * 110);
+ m_listCtrl->InsertColumn(3, _("Date"), wxLIST_FORMAT_LEFT, dResize * nDateWidth);
+ m_listCtrl->InsertColumn(4, _("Description"), wxLIST_FORMAT_LEFT, dResize * 409 - nDateWidth);
+ m_listCtrl->InsertColumn(5, _("Debit"), wxLIST_FORMAT_RIGHT, dResize * 79);
+ m_listCtrl->InsertColumn(6, _("Credit"), wxLIST_FORMAT_RIGHT, dResize * 79);
// Init status bar
int pnWidths[3] = { -100, 88, 290 };
@@ -450,19 +450,19 @@ string FormatTxStatus(const CWalletTx& wtx)
if (!wtx.IsFinal())
{
if (wtx.nLockTime < 500000000)
- return strprintf("Open for %d blocks", nBestHeight - wtx.nLockTime);
+ return strprintf(_("Open for %d blocks"), nBestHeight - wtx.nLockTime);
else
- return strprintf("Open until %s", DateTimeStr(wtx.nLockTime).c_str());
+ return strprintf(_("Open until %s"), DateTimeStr(wtx.nLockTime).c_str());
}
else
{
int nDepth = wtx.GetDepthInMainChain();
if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
- return strprintf("%d/offline?", nDepth);
+ return strprintf(_("%d/offline?"), nDepth);
else if (nDepth < 6)
- return strprintf("%d/unconfirmed", nDepth);
+ return strprintf(_("%d/unconfirmed"), nDepth);
else
- return strprintf("%d confirmations", nDepth);
+ return strprintf(_("%d confirmations"), nDepth);
}
}
@@ -547,7 +547,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
if (wtx.IsCoinBase())
{
// Coinbase
- strDescription = "Generated";
+ strDescription = _("Generated");
if (nCredit == 0)
{
int64 nUnmatured = 0;
@@ -555,15 +555,15 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
nUnmatured += txout.GetCredit();
if (wtx.IsInMainChain())
{
- strDescription = strprintf("Generated (%s matures in %d more blocks)", FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());
+ strDescription = strprintf(_("Generated (%s matures in %d more blocks)"), FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());
// Check if the block was requested by anyone
if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
- strDescription = "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!";
+ strDescription = _("Generated - Warning: This block was not received by any other nodes and will probably not be accepted!");
}
else
{
- strDescription = "Generated (not accepted)";
+ strDescription = _("Generated (not accepted)");
}
}
}
@@ -571,7 +571,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
{
// Online transaction
if (!mapValue["from"].empty())
- strDescription += "From: " + mapValue["from"];
+ strDescription += _("From: ") + mapValue["from"];
if (!mapValue["message"].empty())
{
if (!strDescription.empty())
@@ -594,9 +594,9 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
string strAddress = PubKeyToAddress(vchPubKey);
if (mapAddressBook.count(strAddress))
{
- //strDescription += "Received payment to ";
- //strDescription += "Received with address ";
- strDescription += "From: unknown, To: ";
+ //strDescription += _("Received payment to ");
+ //strDescription += _("Received with address ");
+ strDescription += _("From: unknown, To: ");
strDescription += strAddress;
/// The labeling feature is just too confusing, so I hid it
/// by putting it at the end where it runs off the screen.
@@ -636,7 +636,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
InsertLine(fNew, nIndex, hash, strSort,
strStatus,
nTime ? DateTimeStr(nTime) : "",
- "Payment to yourself",
+ _("Payment to yourself"),
"",
"");
/// issue: can't tell which is the payment and which is the change anymore
@@ -670,7 +670,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
strAddress = Hash160ToAddress(hash160);
}
- string strDescription = "To: ";
+ string strDescription = _("To: ");
CRITICAL_BLOCK(cs_mapAddressBook)
if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())
strDescription += mapAddressBook[strAddress] + " ";
@@ -960,12 +960,12 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
// Update status bar
string strGen = "";
if (fGenerateBitcoins)
- strGen = " Generating";
+ strGen = _(" Generating");
if (fGenerateBitcoins && vNodes.empty())
- strGen = "(not connected)";
+ strGen = _("(not connected)");
m_statusBar->SetStatusText(strGen, 1);
- string strStatus = strprintf(" %d connections %d blocks %d transactions", vNodes.size(), nBestHeight + 1, nTransactionCount);
+ string strStatus = strprintf(_(" %d connections %d blocks %d transactions"), vNodes.size(), nBestHeight + 1, nTransactionCount);
m_statusBar->SetStatusText(strStatus, 2);
if (fDebug && GetTime() - nThreadSocketHandlerHeartbeat > 60)
@@ -1160,20 +1160,20 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
- strHTML += "<b>Status:</b> " + FormatTxStatus(wtx);
+ strHTML += _("<b>Status:</b> ") + FormatTxStatus(wtx);
int nRequests = wtx.GetRequestCount();
if (nRequests != -1)
{
if (nRequests == 0)
- strHTML += ", has not been successfully broadcast yet";
+ strHTML += _(", has not been successfully broadcast yet");
else if (nRequests == 1)
- strHTML += strprintf(", broadcast through %d node", nRequests);
+ strHTML += strprintf(_(", broadcast through %d node"), nRequests);
else
- strHTML += strprintf(", broadcast through %d nodes", nRequests);
+ strHTML += strprintf(_(", broadcast through %d nodes"), nRequests);
}
strHTML += "<br>";
- strHTML += "<b>Date:</b> " + (nTime ? DateTimeStr(nTime) : "") + "<br>";
+ strHTML += _("<b>Date:</b> ") + (nTime ? DateTimeStr(nTime) : "") + "<br>";
//
@@ -1181,13 +1181,13 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
//
if (wtx.IsCoinBase())
{
- strHTML += "<b>Source:</b> Generated<br>";
+ strHTML += _("<b>Source:</b> Generated<br>");
}
else if (!wtx.mapValue["from"].empty())
{
// Online transaction
if (!wtx.mapValue["from"].empty())
- strHTML += "<b>From:</b> " + HtmlEscape(wtx.mapValue["from"]) + "<br>";
+ strHTML += _("<b>From:</b> ") + HtmlEscape(wtx.mapValue["from"]) + "<br>";
}
else
{
@@ -1205,13 +1205,13 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
string strAddress = PubKeyToAddress(vchPubKey);
if (mapAddressBook.count(strAddress))
{
- strHTML += "<b>From:</b> unknown<br>";
- strHTML += "<b>To:</b> ";
+ strHTML += string() + _("<b>From:</b> ") + _("unknown") + "<br>";
+ strHTML += _("<b>To:</b> ");
strHTML += HtmlEscape(strAddress);
if (!mapAddressBook[strAddress].empty())
- strHTML += " (yours, label: " + mapAddressBook[strAddress] + ")";
+ strHTML += _(" (yours, label: ") + mapAddressBook[strAddress] + ")";
else
- strHTML += " (yours)";
+ strHTML += _(" (yours)");
strHTML += "<br>";
}
}
@@ -1230,7 +1230,7 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
{
// Online transaction
strAddress = wtx.mapValue["to"];
- strHTML += "<b>To:</b> ";
+ strHTML += _("<b>To:</b> ");
if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())
strHTML += mapAddressBook[strAddress] + " ";
strHTML += HtmlEscape(strAddress) + "<br>";
@@ -1248,17 +1248,19 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
int64 nUnmatured = 0;
foreach(const CTxOut& txout, wtx.vout)
nUnmatured += txout.GetCredit();
+ strHTML += _("<b>Credit:</b> ");
if (wtx.IsInMainChain())
- strHTML += strprintf("<b>Credit:</b> (%s matures in %d more blocks)<br>", FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());
+ strHTML += strprintf(_("(%s matures in %d more blocks)"), FormatMoney(nUnmatured).c_str(), wtx.GetBlocksToMaturity());
else
- strHTML += "<b>Credit:</b> (not accepted)<br>";
+ strHTML += _("(not accepted)");
+ strHTML += "<br>";
}
else if (nNet > 0)
{
//
// Credit
//
- strHTML += "<b>Credit:</b> " + FormatMoney(nNet) + "<br>";
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(nNet) + "<br>";
}
else
{
@@ -1287,7 +1289,7 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
if (ExtractHash160(txout.scriptPubKey, hash160))
{
string strAddress = Hash160ToAddress(hash160);
- strHTML += "<b>To:</b> ";
+ strHTML += _("<b>To:</b> ");
if (mapAddressBook.count(strAddress) && !mapAddressBook[strAddress].empty())
strHTML += mapAddressBook[strAddress] + " ";
strHTML += strAddress;
@@ -1295,7 +1297,7 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
}
}
- strHTML += "<b>Debit:</b> " + FormatMoney(-txout.nValue) + "<br>";
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-txout.nValue) + "<br>";
}
if (fAllToMe)
@@ -1303,13 +1305,13 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
// Payment to self
/// issue: can't tell which is the payment and which is the change anymore
//int64 nValue = wtx.vout[0].nValue;
- //strHTML += "<b>Debit:</b> " + FormatMoney(-nValue) + "<br>";
- //strHTML += "<b>Credit:</b> " + FormatMoney(nValue) + "<br>";
+ //strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
+ //strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
}
int64 nTxFee = nDebit - wtx.GetValueOut();
if (nTxFee > 0)
- strHTML += "<b>Transaction fee:</b> " + FormatMoney(-nTxFee) + "<br>";
+ strHTML += _("<b>Transaction fee:</b> ") + FormatMoney(-nTxFee) + "<br>";
}
else
{
@@ -1318,24 +1320,24 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
//
foreach(const CTxIn& txin, wtx.vin)
if (txin.IsMine())
- strHTML += "<b>Debit:</b> " + FormatMoney(-txin.GetDebit()) + "<br>";
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-txin.GetDebit()) + "<br>";
foreach(const CTxOut& txout, wtx.vout)
if (txout.IsMine())
- strHTML += "<b>Credit:</b> " + FormatMoney(txout.GetCredit()) + "<br>";
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(txout.GetCredit()) + "<br>";
}
}
- strHTML += "<b>Net amount:</b> " + FormatMoney(nNet, true) + "<br>";
+ strHTML += _("<b>Net amount:</b> ") + FormatMoney(nNet, true) + "<br>";
//
// Message
//
if (!wtx.mapValue["message"].empty())
- strHTML += "<br><b>Message:</b><br>" + HtmlEscape(wtx.mapValue["message"], true) + "<br>";
+ strHTML += string() + "<br><b>" + _("Message:") + "</b><br>" + HtmlEscape(wtx.mapValue["message"], true) + "<br>";
if (wtx.IsCoinBase())
- strHTML += "<br>Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.<br>";
+ strHTML += string() + "<br>" + _("Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>";
//
@@ -1402,12 +1404,12 @@ void CTxDetailsDialog::OnButtonOK(wxCommandEvent& event)
COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent)
ui.h
@@ -16,12 +16,12 @@ extern int fMinimizeOnClose;
-extern void HandleCtrlA(wxKeyEvent& event);
-extern string FormatTxStatus(const CWalletTx& wtx);
-extern void UIThreadCall(boost::function0<void>);
-extern void MainFrameRepaint();
-extern void Shutdown(void* parg);
-extern int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
+void HandleCtrlA(wxKeyEvent& event);
+string FormatTxStatus(const CWalletTx& wtx);
+void UIThreadCall(boost::function0<void>);
+void MainFrameRepaint();
+void Shutdown(void* parg);
+int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
uibase.cpp
@@ -1,6 +1,3 @@
-// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
@@ -406,22 +403,14 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
bSizer64->Add( 0, 16, 0, wxEXPAND, 5 );
- m_staticText321 = new wxStaticText( m_panelTest2, wxID_ANY, _("Test panel 2 for future expansion"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText321 = new wxStaticText( m_panelTest2, wxID_ANY, _("// [don't translate] Test panel 2 for future expansion"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText321->Wrap( -1 );
bSizer64->Add( m_staticText321, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
- m_staticText69 = new wxStaticText( m_panelTest2, wxID_ANY, _("Let's not start multiple pages until the first page is filled up"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText69 = new wxStaticText( m_panelTest2, wxID_ANY, _("// [don't translate] Let's not start multiple pages until the first page is filled up"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText69->Wrap( -1 );
bSizer64->Add( m_staticText69, 0, wxALL, 5 );
- m_staticText70 = new wxStaticText( m_panelTest2, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText70->Wrap( -1 );
- bSizer64->Add( m_staticText70, 0, wxALL, 5 );
-
- m_staticText71 = new wxStaticText( m_panelTest2, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText71->Wrap( -1 );
- bSizer64->Add( m_staticText71, 0, wxALL, 5 );
-
m_panelTest2->SetSizer( bSizer64 );
m_panelTest2->Layout();
bSizer64->Fit( m_panelTest2 );
@@ -521,7 +510,7 @@ CAboutDialogBase::CAboutDialogBase( wxWindow* parent, wxWindowID id, const wxStr
bSizer631->Add( 0, 4, 0, wxEXPAND, 5 );
- m_staticTextMain = new wxStaticText( this, wxID_ANY, _("Copyright © 2009-2010 Satoshi Nakamoto.\n\nThis is experimental software. Do not rely on it for actual financial transactions.\n\nDistributed under the MIT/X11 software license, see the accompanying file \nlicense.txt or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the \nOpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \nEric Young (eay@cryptsoft.com)."), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextMain = new wxStaticText( this, wxID_ANY, _("Copyright (c) 2009-2010 Satoshi Nakamoto.\n\nThis is experimental software. Do not rely on it for actual financial transactions.\n\nDistributed under the MIT/X11 software license, see the accompanying file \nlicense.txt or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the \nOpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \nEric Young (eay@cryptsoft.com)."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMain->Wrap( -1 );
bSizer631->Add( m_staticTextMain, 0, wxALL, 5 );
uibase.h
@@ -1,6 +1,3 @@
-// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
@@ -178,8 +175,6 @@ class COptionsDialogBase : public wxDialog
wxStaticText* m_staticText321;
wxStaticText* m_staticText69;
- wxStaticText* m_staticText70;
- wxStaticText* m_staticText71;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxButton* m_buttonApply;
uiproject.fbp
@@ -2173,7 +2173,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
- <property name="label">Test panel 2 for future expansion</property>
+ <property name="label">// [don't translate] Test panel 2 for future expansion</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticText321</property>
@@ -2224,7 +2224,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
- <property name="label">Let's not start multiple pages until the first page is filled up</property>
+ <property name="label">// [don't translate] Let's not start multiple pages until the first page is filled up</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticText69</property>
@@ -2263,108 +2263,6 @@
<event name="OnUpdateUI"></event>
</object>
</object>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
- <property name="flag">wxALL</property>
- <property name="proportion">0</property>
- <object class="wxStaticText" expanded="1">
- <property name="bg"></property>
- <property name="context_help"></property>
- <property name="enabled">1</property>
- <property name="fg"></property>
- <property name="font"></property>
- <property name="hidden">0</property>
- <property name="id">wxID_ANY</property>
- <property name="label">MyLabel</property>
- <property name="maximum_size"></property>
- <property name="minimum_size"></property>
- <property name="name">m_staticText70</property>
- <property name="permission">protected</property>
- <property name="pos"></property>
- <property name="size"></property>
- <property name="style"></property>
- <property name="subclass"></property>
- <property name="tooltip"></property>
- <property name="window_extra_style"></property>
- <property name="window_name"></property>
- <property name="window_style"></property>
- <property name="wrap">-1</property>
- <event name="OnChar"></event>
- <event name="OnEnterWindow"></event>
- <event name="OnEraseBackground"></event>
- <event name="OnKeyDown"></event>
- <event name="OnKeyUp"></event>
- <event name="OnKillFocus"></event>
- <event name="OnLeaveWindow"></event>
- <event name="OnLeftDClick"></event>
- <event name="OnLeftDown"></event>
- <event name="OnLeftUp"></event>
- <event name="OnMiddleDClick"></event>
- <event name="OnMiddleDown"></event>
- <event name="OnMiddleUp"></event>
- <event name="OnMotion"></event>
- <event name="OnMouseEvents"></event>
- <event name="OnMouseWheel"></event>
- <event name="OnPaint"></event>
- <event name="OnRightDClick"></event>
- <event name="OnRightDown"></event>
- <event name="OnRightUp"></event>
- <event name="OnSetFocus"></event>
- <event name="OnSize"></event>
- <event name="OnUpdateUI"></event>
- </object>
- </object>
- <object class="sizeritem" expanded="1">
- <property name="border">5</property>
- <property name="flag">wxALL</property>
- <property name="proportion">0</property>
- <object class="wxStaticText" expanded="1">
- <property name="bg"></property>
- <property name="context_help"></property>
- <property name="enabled">1</property>
- <property name="fg"></property>
- <property name="font"></property>
- <property name="hidden">0</property>
- <property name="id">wxID_ANY</property>
- <property name="label">MyLabel</property>
- <property name="maximum_size"></property>
- <property name="minimum_size"></property>
- <property name="name">m_staticText71</property>
- <property name="permission">protected</property>
- <property name="pos"></property>
- <property name="size"></property>
- <property name="style"></property>
- <property name="subclass"></property>
- <property name="tooltip"></property>
- <property name="window_extra_style"></property>
- <property name="window_name"></property>
- <property name="window_style"></property>
- <property name="wrap">-1</property>
- <event name="OnChar"></event>
- <event name="OnEnterWindow"></event>
- <event name="OnEraseBackground"></event>
- <event name="OnKeyDown"></event>
- <event name="OnKeyUp"></event>
- <event name="OnKillFocus"></event>
- <event name="OnLeaveWindow"></event>
- <event name="OnLeftDClick"></event>
- <event name="OnLeftDown"></event>
- <event name="OnLeftUp"></event>
- <event name="OnMiddleDClick"></event>
- <event name="OnMiddleDown"></event>
- <event name="OnMiddleUp"></event>
- <event name="OnMotion"></event>
- <event name="OnMouseEvents"></event>
- <event name="OnMouseWheel"></event>
- <event name="OnPaint"></event>
- <event name="OnRightDClick"></event>
- <event name="OnRightDown"></event>
- <event name="OnRightUp"></event>
- <event name="OnSetFocus"></event>
- <event name="OnSize"></event>
- <event name="OnUpdateUI"></event>
- </object>
- </object>
</object>
</object>
</object>
@@ -2820,7 +2718,7 @@
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
- <property name="label">Copyright © 2009-2010 Satoshi Nakamoto.

This is experimental software. Do not rely on it for actual financial transactions.

Distributed under the MIT/X11 software license, see the accompanying file 
license.txt or http://www.opensource.org/licenses/mit-license.php.

This product includes software developed by the OpenSSL Project for use in the 
OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by 
Eric Young (eay@cryptsoft.com).</property>
+ <property name="label">Copyright (c) 2009-2010 Satoshi Nakamoto.

This is experimental software. Do not rely on it for actual financial transactions.

Distributed under the MIT/X11 software license, see the accompanying file 
license.txt or http://www.opensource.org/licenses/mit-license.php.

This product includes software developed by the OpenSSL Project for use in the 
OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by 
Eric Young (eay@cryptsoft.com).</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticTextMain</property>
util.cpp
@@ -90,7 +90,7 @@ void RandAddSeedPerfmon()
unsigned char pdata[250000];
memset(pdata, 0, sizeof(pdata));
unsigned long nSize = sizeof(pdata);
- long ret = RegQueryValueEx(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, pdata, &nSize);
+ long ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, pdata, &nSize);
RegCloseKey(HKEY_PERFORMANCE_DATA);
if (ret == ERROR_SUCCESS)
{
@@ -193,7 +193,7 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
p2++;
char c = *p2;
*p2 = '\0';
- OutputDebugString(p1);
+ OutputDebugStringA(p1);
*p2 = c;
p1 = p2;
}
@@ -441,7 +441,7 @@ void FormatException(char* pszMessage, std::exception* pex, const char* pszThrea
#ifdef __WXMSW__
char pszModule[MAX_PATH];
pszModule[0] = '\0';
- GetModuleFileName(NULL, pszModule, sizeof(pszModule));
+ GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
#else
// might not be thread safe, uses wxString
//const char* pszModule = wxStandardPaths::Get().GetExecutablePath().mb_str();
util.h
@@ -340,10 +340,11 @@ void skipspaces(T& it)
++it;
}
-
-
-
-
+inline const char* wxGetTranslation(const char* psz)
+{
+ // Return translated UTF-8 const char*
+ return wxGetTranslation(wxString(psz, wxConvUTF8)).utf8_str();
+}