Satoshi MailBeta Open in Satoshi Mail

strip out unfinished product, review and market stuff, enable _() instead of wxT() in uiproject.fbp so it uses wxGetTranslation for the wxFormBuilder generated part of the UI

Commit by Satoshi Nakamoto (s_nakamoto) on 15 February 2010 · SVN r64 · release v0.2.2 · 18 files, +127 −8,464

Open in Satoshi Mail View on GitHub

Files changed

db.cpp
@@ -507,27 +507,6 @@ bool LoadAddresses()
 
 
 
-//
-// CReviewDB
-//
-
-bool CReviewDB::ReadReviews(uint256 hash, vector<CReview>& vReviews)
-{
-    vReviews.size(); // msvc workaround, just need to do anything with vReviews
-    return Read(make_pair(string("reviews"), hash), vReviews);
-}
-
-bool CReviewDB::WriteReviews(uint256 hash, const vector<CReview>& vReviews)
-{
-    return Write(make_pair(string("reviews"), hash), vReviews);
-}
-
-
-
-
-
-
-
 //
 // CWalletDB
 //
db.h
@@ -285,45 +285,6 @@ public:
 
 
 
-class CReviewDB : public CDB
-{
-public:
-    CReviewDB(const char* pszMode="r+") : CDB("reviews.dat", pszMode) { }
-private:
-    CReviewDB(const CReviewDB&);
-    void operator=(const CReviewDB&);
-public:
-    bool ReadUser(uint256 hash, CUser& user)
-    {
-        return Read(make_pair(string("user"), hash), user);
-    }
-
-    bool WriteUser(uint256 hash, const CUser& user)
-    {
-        return Write(make_pair(string("user"), hash), user);
-    }
-
-    bool ReadReviews(uint256 hash, vector<CReview>& vReviews);
-    bool WriteReviews(uint256 hash, const vector<CReview>& vReviews);
-};
-
-
-
-
-
-class CMarketDB : public CDB
-{
-public:
-    CMarketDB(const char* pszMode="r+") : CDB("market.dat", pszMode) { }
-private:
-    CMarketDB(const CMarketDB&);
-    void operator=(const CMarketDB&);
-};
-
-
-
-
-
 class CAddrDB : public CDB
 {
 public:
headers.h
@@ -99,7 +99,6 @@ using namespace boost;
 #include "net.h"
 #include "irc.h"
 #include "main.h"
-#include "market.h"
 #include "rpc.h"
 #include "uibase.h"
 #include "ui.h"
main.cpp
@@ -1706,10 +1706,8 @@ bool AlreadyHave(CTxDB& txdb, const CInv& inv)
 {
     switch (inv.type)
     {
-    case MSG_TX:        return mapTransactions.count(inv.hash) || txdb.ContainsTx(inv.hash);
-    case MSG_BLOCK:     return mapBlockIndex.count(inv.hash) || mapOrphanBlocks.count(inv.hash);
-    case MSG_REVIEW:    return true;
-    case MSG_PRODUCT:   return mapProducts.count(inv.hash);
+    case MSG_TX:    return mapTransactions.count(inv.hash) || txdb.ContainsTx(inv.hash);
+    case MSG_BLOCK: return mapBlockIndex.count(inv.hash) || mapOrphanBlocks.count(inv.hash);
     }
     // Don't know what it is, just say we already got one
     return true;
@@ -2108,24 +2106,6 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
     }
 
 
-    else if (strCommand == "review")
-    {
-        CDataStream vMsg(vRecv);
-        CReview review;
-        vRecv >> review;
-
-        CInv inv(MSG_REVIEW, review.GetHash());
-        pfrom->AddInventoryKnown(inv);
-
-        if (review.AcceptReview())
-        {
-            // Relay the original message as-is in case it's a higher version than we know how to parse
-            RelayMessage(inv, vMsg);
-            mapAlreadyAskedFor.erase(inv);
-        }
-    }
-
-
     else if (strCommand == "block")
     {
         auto_ptr<CBlock> pblock(new CBlock);
makefile
@@ -25,7 +25,7 @@ LIBS= \
  -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
 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 market.h rpc.h uibase.h ui.h
+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
 
 
 
@@ -50,9 +50,6 @@ obj/net.o: net.cpp                  $(HEADERS)
 obj/main.o: main.cpp                $(HEADERS) sha.h
 	g++ -c $(CFLAGS) -o $@ $<
 
-obj/market.o: market.cpp            $(HEADERS)
-	g++ -c $(CFLAGS) -o $@ $<
-
 obj/ui.o: ui.cpp                    $(HEADERS)
 	g++ -c $(CFLAGS) -o $@ $<
 
@@ -73,7 +70,7 @@ obj/ui_res.o: ui.rc  rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp
 
 
 
-OBJS=obj/util.o obj/script.o obj/db.o obj/net.o obj/main.o obj/market.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 \
         obj/ui_res.o
 
makefile.unix.wx2.8
@@ -35,7 +35,7 @@ LIBS= \
 
 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 market.h rpc.h uibase.h ui.h
+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
 
 
 
@@ -60,9 +60,6 @@ obj/net.o: net.cpp                  $(HEADERS)
 obj/main.o: main.cpp                $(HEADERS) sha.h
 	g++ -c $(CFLAGS) -o $@ $<
 
-obj/market.o: market.cpp            $(HEADERS)
-	g++ -c $(CFLAGS) -o $@ $<
-
 obj/ui.o: ui.cpp                    $(HEADERS)
 	g++ -c $(CFLAGS) -o $@ $<
 
@@ -80,7 +77,7 @@ obj/rpc.o: rpc.cpp                  $(HEADERS)
 
 
 
-OBJS=obj/util.o obj/script.o obj/db.o obj/net.o obj/main.o obj/market.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)
makefile.unix.wx2.9
@@ -35,7 +35,7 @@ LIBS= \
 
 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 market.h rpc.h uibase.h ui.h
+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
 
 
 
@@ -60,9 +60,6 @@ obj/net.o: net.cpp                  $(HEADERS)
 obj/main.o: main.cpp                $(HEADERS) sha.h
 	g++ -c $(CFLAGS) -o $@ $<
 
-obj/market.o: market.cpp            $(HEADERS)
-	g++ -c $(CFLAGS) -o $@ $<
-
 obj/ui.o: ui.cpp                    $(HEADERS)
 	g++ -c $(CFLAGS) -o $@ $<
 
@@ -80,7 +77,7 @@ obj/rpc.o: rpc.cpp                  $(HEADERS)
 
 
 
-OBJS=obj/util.o obj/script.o obj/db.o obj/net.o obj/main.o obj/market.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)
makefile.vc
@@ -23,7 +23,7 @@ LIBS= \
     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)
-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 market.h rpc.h uibase.h ui.h
+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
 
 
 
@@ -45,9 +45,6 @@ obj\net.obj: net.cpp          $(HEADERS)
 obj\main.obj: main.cpp        $(HEADERS) sha.h
     cl $(CFLAGS) /Fo$@ %s
 
-obj\market.obj: market.cpp    $(HEADERS)
-    cl $(CFLAGS) /Fo$@ %s
-
 obj\ui.obj: ui.cpp            $(HEADERS)
     cl $(CFLAGS) /Fo$@ %s
 
@@ -68,7 +65,7 @@ obj\ui.res: ui.rc  rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp r
 
 
 
-OBJS=obj\util.obj obj\script.obj obj\db.obj obj\net.obj obj\main.obj obj\market.obj \
+OBJS=obj\util.obj obj\script.obj obj\db.obj obj\net.obj obj\main.obj \
     obj\ui.obj obj\uibase.obj obj\sha.obj obj\irc.obj obj\rpc.obj \
     obj\ui.res
 
market.cpp
@@ -1,264 +0,0 @@
-// Copyright (c) 2009 Satoshi Nakamoto
-// Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
-#include "headers.h"
-
-
-
-
-
-
-
-
-
-
-//
-// Global state variables
-//
-
-//// later figure out how these are persisted
-map<uint256, CProduct> mapMyProducts;
-
-
-
-
-map<uint256, CProduct> mapProducts;
-CCriticalSection cs_mapProducts;
-
-bool AdvertInsert(const CProduct& product)
-{
-    uint256 hash = product.GetHash();
-    bool fNew = false;
-    bool fUpdated = false;
-
-    CRITICAL_BLOCK(cs_mapProducts)
-    {
-        // Insert or find existing product
-        pair<map<uint256, CProduct>::iterator, bool> item = mapProducts.insert(make_pair(hash, product));
-        CProduct* pproduct = &(*(item.first)).second;
-        fNew = item.second;
-
-        // Update if newer
-        if (product.nSequence > pproduct->nSequence)
-        {
-            *pproduct = product;
-            fUpdated = true;
-        }
-    }
-
-    //if (fNew)
-    //    NotifyProductAdded(hash);
-    //else if (fUpdated)
-    //    NotifyProductUpdated(hash);
-
-    return (fNew || fUpdated);
-}
-
-void AdvertErase(const CProduct& product)
-{
-    uint256 hash = product.GetHash();
-    CRITICAL_BLOCK(cs_mapProducts)
-        mapProducts.erase(hash);
-    //NotifyProductDeleted(hash);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-template<typename T>
-unsigned int Union(T& v1, T& v2)
-{
-    // v1 = v1 union v2
-    // v1 and v2 must be sorted
-    // returns the number of elements added to v1
-
-    ///// need to check that this is equivalent, then delete this comment
-    //vector<unsigned short> vUnion(v1.size() + v2.size());
-    //vUnion.erase(set_union(v1.begin(), v1.end(),
-    //                       v2.begin(), v2.end(),
-    //                       vUnion.begin()),
-    //             vUnion.end());
-
-    T vUnion;
-    vUnion.reserve(v1.size() + v2.size());
-    set_union(v1.begin(), v1.end(),
-              v2.begin(), v2.end(),
-              back_inserter(vUnion));
-    unsigned int nAdded = vUnion.size() - v1.size();
-    if (nAdded > 0)
-        v1 = vUnion;
-    return nAdded;
-}
-
-void CUser::AddAtom(unsigned short nAtom, bool fOrigin)
-{
-    // Ignore duplicates
-    if (binary_search(vAtomsIn.begin(), vAtomsIn.end(), nAtom) ||
-        find(vAtomsNew.begin(), vAtomsNew.end(), nAtom) != vAtomsNew.end())
-        return;
-
-    //// instead of zero atom, should change to free atom that propagates,
-    //// limited to lower than a certain value like 5 so conflicts quickly
-    // The zero atom never propagates,
-    // new atoms always propagate through the user that created them
-    if (nAtom == 0 || fOrigin)
-    {
-        vector<unsigned short> vTmp(1, nAtom);
-        Union(vAtomsIn, vTmp);
-        if (fOrigin)
-            vAtomsOut.push_back(nAtom);
-        return;
-    }
-
-    vAtomsNew.push_back(nAtom);
-
-    if (vAtomsNew.size() >= nFlowthroughRate || vAtomsOut.empty())
-    {
-        // Select atom to flow through to vAtomsOut
-        vAtomsOut.push_back(vAtomsNew[GetRand(vAtomsNew.size())]);
-
-        // Merge vAtomsNew into vAtomsIn
-        sort(vAtomsNew.begin(), vAtomsNew.end());
-        Union(vAtomsIn, vAtomsNew);
-        vAtomsNew.clear();
-    }
-}
-
-bool AddAtomsAndPropagate(uint256 hashUserStart, const vector<unsigned short>& vAtoms, bool fOrigin)
-{
-    CReviewDB reviewdb;
-    map<uint256, vector<unsigned short> > pmapPropagate[2];
-    pmapPropagate[0][hashUserStart] = vAtoms;
-
-    for (int side = 0; !pmapPropagate[side].empty(); side = 1 - side)
-    {
-        map<uint256, vector<unsigned short> >& mapFrom = pmapPropagate[side];
-        map<uint256, vector<unsigned short> >& mapTo = pmapPropagate[1 - side];
-
-        for (map<uint256, vector<unsigned short> >::iterator mi = mapFrom.begin(); mi != mapFrom.end(); ++mi)
-        {
-            const uint256& hashUser = (*mi).first;
-            const vector<unsigned short>& vReceived = (*mi).second;
-
-            ///// this would be a lot easier on the database if it put the new atom at the beginning of the list,
-            ///// so the change would be right next to the vector size.
-
-            // Read user
-            CUser user;
-            reviewdb.ReadUser(hashUser, user);
-            unsigned int nIn = user.vAtomsIn.size();
-            unsigned int nNew = user.vAtomsNew.size();
-            unsigned int nOut = user.vAtomsOut.size();
-
-            // Add atoms received
-            foreach(unsigned short nAtom, vReceived)
-                user.AddAtom(nAtom, fOrigin);
-            fOrigin = false;
-
-            // Don't bother writing to disk if no changes
-            if (user.vAtomsIn.size() == nIn && user.vAtomsNew.size() == nNew)
-                continue;
-
-            // Propagate
-            if (user.vAtomsOut.size() > nOut)
-                foreach(const uint256& hash, user.vLinksOut)
-                    mapTo[hash].insert(mapTo[hash].end(), user.vAtomsOut.begin() + nOut, user.vAtomsOut.end());
-
-            // Write back
-            if (!reviewdb.WriteUser(hashUser, user))
-                return false;
-        }
-        mapFrom.clear();
-    }
-    return true;
-}
-
-
-
-
-
-
-bool CReview::AcceptReview()
-{
-    // Timestamp
-    nTime = GetTime();
-
-    // Check signature
-    if (!CKey::Verify(vchPubKeyFrom, GetSigHash(), vchSig))
-        return false;
-
-    CReviewDB reviewdb;
-
-    // Add review text to recipient
-    vector<CReview> vReviews;
-    reviewdb.ReadReviews(hashTo, vReviews);
-    vReviews.push_back(*this);
-    if (!reviewdb.WriteReviews(hashTo, vReviews))
-        return false;
-
-    // Add link from sender
-    CUser user;
-    uint256 hashFrom = Hash(vchPubKeyFrom.begin(), vchPubKeyFrom.end());
-    reviewdb.ReadUser(hashFrom, user);
-    user.vLinksOut.push_back(hashTo);
-    if (!reviewdb.WriteUser(hashFrom, user))
-        return false;
-
-    reviewdb.Close();
-
-    // Propagate atoms to recipient
-    vector<unsigned short> vZeroAtom(1, 0);
-    if (!AddAtomsAndPropagate(hashTo, user.vAtomsOut.size() ? user.vAtomsOut : vZeroAtom, false))
-        return false;
-
-    return true;
-}
-
-
-
-
-
-bool CProduct::CheckSignature()
-{
-    return (CKey::Verify(vchPubKeyFrom, GetSigHash(), vchSig));
-}
-
-bool CProduct::CheckProduct()
-{
-    if (!CheckSignature())
-        return false;
-
-    // Make sure it's a summary product
-    if (!mapDetails.empty() || !vOrderForm.empty())
-        return false;
-
-    // Look up seller's atom count
-    CReviewDB reviewdb("r");
-    CUser user;
-    reviewdb.ReadUser(GetUserHash(), user);
-    nAtoms = user.GetAtomCount();
-    reviewdb.Close();
-
-    ////// delme, this is now done by AdvertInsert
-    //// Store to memory
-    //CRITICAL_BLOCK(cs_mapProducts)
-    //    mapProducts[GetHash()] = *this;
-
-    return true;
-}
market.h
@@ -1,182 +0,0 @@
-// Copyright (c) 2009 Satoshi Nakamoto
-// Distributed under the MIT/X11 software license, see the accompanying
-// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-
-class CUser;
-class CReview;
-class CProduct;
-
-static const unsigned int nFlowthroughRate = 2;
-
-
-
-
-bool AdvertInsert(const CProduct& product);
-void AdvertErase(const CProduct& product);
-bool AddAtomsAndPropagate(uint256 hashUserStart, const vector<unsigned short>& vAtoms, bool fOrigin);
-
-
-
-
-
-
-
-
-class CUser
-{
-public:
-    vector<unsigned short> vAtomsIn;
-    vector<unsigned short> vAtomsNew;
-    vector<unsigned short> vAtomsOut;
-    vector<uint256> vLinksOut;
-
-    CUser()
-    {
-    }
-
-    IMPLEMENT_SERIALIZE
-    (
-        if (!(nType & SER_GETHASH))
-            READWRITE(nVersion);
-        READWRITE(vAtomsIn);
-        READWRITE(vAtomsNew);
-        READWRITE(vAtomsOut);
-        READWRITE(vLinksOut);
-    )
-
-    void SetNull()
-    {
-        vAtomsIn.clear();
-        vAtomsNew.clear();
-        vAtomsOut.clear();
-        vLinksOut.clear();
-    }
-
-    uint256 GetHash() const { return SerializeHash(*this); }
-
-
-    int GetAtomCount() const
-    {
-        return (vAtomsIn.size() + vAtomsNew.size());
-    }
-
-    void AddAtom(unsigned short nAtom, bool fOrigin);
-};
-
-
-
-
-
-
-
-class CReview
-{
-public:
-    int nVersion;
-    uint256 hashTo;
-    map<string, string> mapValue;
-    vector<unsigned char> vchPubKeyFrom;
-    vector<unsigned char> vchSig;
-
-    // memory only
-    unsigned int nTime;
-    int nAtoms;
-
-
-    CReview()
-    {
-        nVersion = 1;
-        hashTo = 0;
-        nTime = 0;
-        nAtoms = 0;
-    }
-
-    IMPLEMENT_SERIALIZE
-    (
-        READWRITE(this->nVersion);
-        nVersion = this->nVersion;
-        if (!(nType & SER_DISK))
-            READWRITE(hashTo);
-        READWRITE(mapValue);
-        READWRITE(vchPubKeyFrom);
-        if (!(nType & SER_GETHASH))
-            READWRITE(vchSig);
-    )
-
-    uint256 GetHash() const { return SerializeHash(*this); }
-    uint256 GetSigHash() const { return SerializeHash(*this, SER_GETHASH|SER_SKIPSIG); }
-    uint256 GetUserHash() const { return Hash(vchPubKeyFrom.begin(), vchPubKeyFrom.end()); }
-
-
-    bool AcceptReview();
-};
-
-
-
-
-
-
-
-class CProduct
-{
-public:
-    int nVersion;
-    CAddress addr;
-    map<string, string> mapValue;
-    map<string, string> mapDetails;
-    vector<pair<string, string> > vOrderForm;
-    unsigned int nSequence;
-    vector<unsigned char> vchPubKeyFrom;
-    vector<unsigned char> vchSig;
-
-    // disk only
-    int nAtoms;
-
-    // memory only
-    set<unsigned int> setSources;
-
-    CProduct()
-    {
-        nVersion = 1;
-        nAtoms = 0;
-        nSequence = 0;
-    }
-
-    IMPLEMENT_SERIALIZE
-    (
-        READWRITE(this->nVersion);
-        nVersion = this->nVersion;
-        READWRITE(addr);
-        READWRITE(mapValue);
-        if (!(nType & SER_GETHASH))
-        {
-            READWRITE(mapDetails);
-            READWRITE(vOrderForm);
-            READWRITE(nSequence);
-        }
-        READWRITE(vchPubKeyFrom);
-        if (!(nType & SER_GETHASH))
-            READWRITE(vchSig);
-        if (nType & SER_DISK)
-            READWRITE(nAtoms);
-    )
-
-    uint256 GetHash() const { return SerializeHash(*this); }
-    uint256 GetSigHash() const { return SerializeHash(*this, SER_GETHASH|SER_SKIPSIG); }
-    uint256 GetUserHash() const { return Hash(vchPubKeyFrom.begin(), vchPubKeyFrom.end()); }
-
-
-    bool CheckSignature();
-    bool CheckProduct();
-};
-
-
-
-
-
-
-
-
-extern map<uint256, CProduct> mapProducts;
-extern CCriticalSection cs_mapProducts;
-extern map<uint256, CProduct> mapMyProducts;
net.cpp
@@ -381,11 +381,6 @@ void CNode::CancelSubscribe(unsigned int nChannel)
             foreach(CNode* pnode, vNodes)
                 if (pnode != this)
                     pnode->PushMessage("sub-cancel", nChannel);
-
-        // Clear memory, no longer subscribed
-        if (nChannel == MSG_PRODUCT)
-            CRITICAL_BLOCK(cs_mapProducts)
-                mapProducts.clear();
     }
 }
 
@@ -497,10 +492,6 @@ void CNode::Cleanup()
     // All of a nodes broadcasts and subscriptions are automatically torn down
     // when it goes down, so a node has to stay up to keep its broadcast going.
 
-    CRITICAL_BLOCK(cs_mapProducts)
-        for (map<uint256, CProduct>::iterator mi = mapProducts.begin(); mi != mapProducts.end();)
-            AdvertRemoveSource(this, MSG_PRODUCT, 0, (*(mi++)).second);
-
     // Cancel subscriptions
     for (unsigned int nChannel = 0; nChannel < vfSubscribe.size(); nChannel++)
         if (vfSubscribe[nChannel])
net.h
@@ -341,9 +341,6 @@ enum
 {
     MSG_TX = 1,
     MSG_BLOCK,
-    MSG_REVIEW,
-    MSG_PRODUCT,
-    MSG_TABLE,
 };
 
 static const char* ppszTypeName[] =
@@ -351,9 +348,6 @@ static const char* ppszTypeName[] =
     "ERROR",
     "tx",
     "block",
-    "review",
-    "product",
-    "table",
 };
 
 class CInv
serialize.h
@@ -20,7 +20,7 @@ class CDataStream;
 class CAutoFile;
 
 static const int VERSION = 201;
-static const char* pszSubVer = ".1";
+static const char* pszSubVer = ".2";
 
 
 
ui.cpp
@@ -7,22 +7,15 @@
 #include <crtdbg.h>
 #endif
 
-void ThreadRequestProductDetails(void* parg);
-void ThreadRandSendTest(void* parg);
 bool GetStartOnSystemStartup();
 void SetStartOnSystemStartup(bool fAutoStart);
 
 
 
 DEFINE_EVENT_TYPE(wxEVT_UITHREADCALL)
-DEFINE_EVENT_TYPE(wxEVT_REPLY1)
-DEFINE_EVENT_TYPE(wxEVT_REPLY2)
-DEFINE_EVENT_TYPE(wxEVT_REPLY3)
 
 CMainFrame* pframeMain = NULL;
 CMyTaskBarIcon* ptaskbaricon = NULL;
-bool fRandSendTest = false;
-void RandSend();
 extern int g_isPainting;
 bool fClosedToTray = false;
 
@@ -210,93 +203,6 @@ int ThreadSafeMessageBox(const string& message, const string& caption, int style
 
 
 
-//////////////////////////////////////////////////////////////////////////////
-//
-// Custom events
-//
-// If this code gets used again, it should be replaced with something like UIThreadCall
-
-set<void*> setCallbackAvailable;
-CCriticalSection cs_setCallbackAvailable;
-
-void AddCallbackAvailable(void* p)
-{
-    CRITICAL_BLOCK(cs_setCallbackAvailable)
-        setCallbackAvailable.insert(p);
-}
-
-void RemoveCallbackAvailable(void* p)
-{
-    CRITICAL_BLOCK(cs_setCallbackAvailable)
-        setCallbackAvailable.erase(p);
-}
-
-bool IsCallbackAvailable(void* p)
-{
-    CRITICAL_BLOCK(cs_setCallbackAvailable)
-        return setCallbackAvailable.count(p);
-    return false;
-}
-
-template<typename T>
-void AddPendingCustomEvent(wxEvtHandler* pevthandler, int nEventID, const T pbeginIn, const T pendIn)
-{
-    // Need to rewrite with something like UIThreadCall
-    // I'm tired of maintaining this hack that's only called by unfinished unused code.
-    assert(("Unimplemented", 0));
-    //if (!pevthandler)
-    //    return;
-    //
-    //const char* pbegin = (pendIn != pbeginIn) ? &pbeginIn[0] : NULL;
-    //const char* pend = pbegin + (pendIn - pbeginIn) * sizeof(pbeginIn[0]);
-    //wxCommandEvent event(nEventID);
-    //wxString strData(wxChar(0), (pend - pbegin) / sizeof(wxChar) + 1);
-    //memcpy(&strData[0], pbegin, pend - pbegin);
-    //event.SetString(strData);
-    //event.SetInt(pend - pbegin);
-    //
-    //pevthandler->AddPendingEvent(event);
-}
-
-template<class T>
-void AddPendingCustomEvent(wxEvtHandler* pevthandler, int nEventID, const T& obj)
-{
-    CDataStream ss;
-    ss << obj;
-    AddPendingCustomEvent(pevthandler, nEventID, ss.begin(), ss.end());
-}
-
-void AddPendingReplyEvent1(void* pevthandler, CDataStream& vRecv)
-{
-    if (IsCallbackAvailable(pevthandler))
-        AddPendingCustomEvent((wxEvtHandler*)pevthandler, wxEVT_REPLY1, vRecv.begin(), vRecv.end());
-}
-
-void AddPendingReplyEvent2(void* pevthandler, CDataStream& vRecv)
-{
-    if (IsCallbackAvailable(pevthandler))
-        AddPendingCustomEvent((wxEvtHandler*)pevthandler, wxEVT_REPLY2, vRecv.begin(), vRecv.end());
-}
-
-void AddPendingReplyEvent3(void* pevthandler, CDataStream& vRecv)
-{
-    if (IsCallbackAvailable(pevthandler))
-        AddPendingCustomEvent((wxEvtHandler*)pevthandler, wxEVT_REPLY3, vRecv.begin(), vRecv.end());
-}
-
-CDataStream GetStreamFromEvent(const wxCommandEvent& event)
-{
-    wxString strData = event.GetString();
-    const char* pszBegin = strData.c_str();
-    return CDataStream(pszBegin, pszBegin + event.GetInt(), SER_NETWORK);
-}
-
-
-
-
-
-
-
 //////////////////////////////////////////////////////////////////////////////
 //
 // CMainFrame
@@ -1180,16 +1086,6 @@ void CMainFrame::OnMouseEventsAddress(wxMouseEvent& event)
     event.Skip();
 }
 
-void CMainFrame::OnButtonCopy(wxCommandEvent& event)
-{
-    // Copy address box to clipboard
-    if (wxTheClipboard->Open())
-    {
-        wxTheClipboard->SetData(new wxTextDataObject(m_textCtrlAddress->GetValue()));
-        wxTheClipboard->Close();
-    }
-}
-
 void CMainFrame::OnButtonChange(wxCommandEvent& event)
 {
     CYourAddressDialog dialog(this, string(m_textCtrlAddress->GetValue()));
@@ -1208,6 +1104,16 @@ void CMainFrame::OnButtonChange(wxCommandEvent& event)
     }
 }
 
+void CMainFrame::OnButtonCopy(wxCommandEvent& event)
+{
+    // Copy address box to clipboard
+    if (wxTheClipboard->Open())
+    {
+        wxTheClipboard->SetData(new wxTextDataObject(m_textCtrlAddress->GetValue()));
+        wxTheClipboard->Close();
+    }
+}
+
 void CMainFrame::OnListItemActivated(wxListEvent& event)
 {
     uint256 hash((string)GetItemText(m_listCtrl, event.GetIndex(), 1));
@@ -1228,28 +1134,6 @@ void CMainFrame::OnListItemActivated(wxListEvent& event)
     //pdialog->Show();
 }
 
-void CMainFrame::OnListItemActivatedProductsSent(wxListEvent& event)
-{
-    CProduct& product = *(CProduct*)event.GetItem().GetData();
-    CEditProductDialog* pdialog = new CEditProductDialog(this);
-    pdialog->SetProduct(product);
-    pdialog->Show();
-}
-
-void CMainFrame::OnListItemActivatedOrdersSent(wxListEvent& event)
-{
-    CWalletTx& order = *(CWalletTx*)event.GetItem().GetData();
-    CViewOrderDialog* pdialog = new CViewOrderDialog(this, order, false);
-    pdialog->Show();
-}
-
-void CMainFrame::OnListItemActivatedOrdersReceived(wxListEvent& event)
-{
-    CWalletTx& order = *(CWalletTx*)event.GetItem().GetData();
-    CViewOrderDialog* pdialog = new CViewOrderDialog(this, order, true);
-    pdialog->Show();
-}
-
 
 
 
@@ -2525,800 +2409,6 @@ void CAddressBookDialog::OnClose(wxCloseEvent& event)
 
 
 
-//////////////////////////////////////////////////////////////////////////////
-//
-// CProductsDialog
-//
-
-bool CompareIntStringPairBestFirst(const pair<int, string>& item1, const pair<int, string>& item2)
-{
-    return (item1.first > item2.first);
-}
-
-CProductsDialog::CProductsDialog(wxWindow* parent) : CProductsDialogBase(parent)
-{
-    // Init column headers
-    m_listCtrl->InsertColumn(0, "Title",  wxLIST_FORMAT_LEFT, 200);
-    m_listCtrl->InsertColumn(1, "Price",  wxLIST_FORMAT_LEFT, 80);
-    m_listCtrl->InsertColumn(2, "Seller", wxLIST_FORMAT_LEFT, 80);
-    m_listCtrl->InsertColumn(3, "Stars",  wxLIST_FORMAT_LEFT, 50);
-    m_listCtrl->InsertColumn(4, "Power",  wxLIST_FORMAT_LEFT, 50);
-
-    // Tally top categories
-    map<string, int> mapTopCategories;
-    CRITICAL_BLOCK(cs_mapProducts)
-        for (map<uint256, CProduct>::iterator mi = mapProducts.begin(); mi != mapProducts.end(); ++mi)
-            mapTopCategories[(*mi).second.mapValue["category"]]++;
-
-    // Sort top categories
-    vector<pair<int, string> > vTopCategories;
-    for (map<string, int>::iterator mi = mapTopCategories.begin(); mi != mapTopCategories.end(); ++mi)
-        vTopCategories.push_back(make_pair((*mi).second, (*mi).first));
-    sort(vTopCategories.begin(), vTopCategories.end(), CompareIntStringPairBestFirst);
-
-    // Fill categories combo box
-    int nLimit = 250;
-    for (vector<pair<int, string> >::iterator it = vTopCategories.begin(); it != vTopCategories.end() && nLimit-- > 0; ++it)
-        m_comboBoxCategory->Append((*it).second);
-
-    // Fill window with initial search
-    //wxCommandEvent event;
-    //OnButtonSearch(event);
-}
-
-void CProductsDialog::OnCombobox(wxCommandEvent& event)
-{
-    OnButtonSearch(event);
-}
-
-bool CompareProductsBestFirst(const CProduct* p1, const CProduct* p2)
-{
-    return (p1->nAtoms > p2->nAtoms);
-}
-
-void CProductsDialog::OnButtonSearch(wxCommandEvent& event)
-{
-    string strCategory = (string)m_comboBoxCategory->GetValue();
-    string strSearch = (string)m_textCtrlSearch->GetValue();
-
-    // Search products
-    vector<CProduct*> vProductsFound;
-    CRITICAL_BLOCK(cs_mapProducts)
-    {
-        for (map<uint256, CProduct>::iterator mi = mapProducts.begin(); mi != mapProducts.end(); ++mi)
-        {
-            CProduct& product = (*mi).second;
-            if (product.mapValue["category"].find(strCategory) != -1)
-            {
-                if (product.mapValue["title"].find(strSearch) != -1 ||
-                    product.mapValue["description"].find(strSearch) != -1 ||
-                    product.mapValue["seller"].find(strSearch) != -1)
-                {
-                    vProductsFound.push_back(&product);
-                }
-            }
-        }
-    }
-
-    // Sort
-    sort(vProductsFound.begin(), vProductsFound.end(), CompareProductsBestFirst);
-
-    // Display
-    foreach(CProduct* pproduct, vProductsFound)
-    {
-        InsertLine(m_listCtrl,
-                   pproduct->mapValue["title"],
-                   pproduct->mapValue["price"],
-                   pproduct->mapValue["seller"],
-                   pproduct->mapValue["stars"],
-                   itostr(pproduct->nAtoms));
-    }
-}
-
-void CProductsDialog::OnListItemActivated(wxListEvent& event)
-{
-    // Doubleclick opens product
-    CViewProductDialog* pdialog = new CViewProductDialog(this, m_vProduct[event.GetIndex()]);
-    pdialog->Show();
-}
-
-
-
-
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// CEditProductDialog
-//
-
-CEditProductDialog::CEditProductDialog(wxWindow* parent) : CEditProductDialogBase(parent)
-{
-    m_textCtrlLabel[0 ] = m_textCtrlLabel0;
-    m_textCtrlLabel[1 ] = m_textCtrlLabel1;
-    m_textCtrlLabel[2 ] = m_textCtrlLabel2;
-    m_textCtrlLabel[3 ] = m_textCtrlLabel3;
-    m_textCtrlLabel[4 ] = m_textCtrlLabel4;
-    m_textCtrlLabel[5 ] = m_textCtrlLabel5;
ui.h
@@ -6,12 +6,6 @@
 
 
 DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1)
-DECLARE_EVENT_TYPE(wxEVT_REPLY1, -1)
-DECLARE_EVENT_TYPE(wxEVT_REPLY2, -1)
-DECLARE_EVENT_TYPE(wxEVT_REPLY3, -1)
-
-
-
 
 extern map<string, string> mapArgs;
 
@@ -57,8 +51,8 @@ protected:
     void OnButtonAddressBook(wxCommandEvent& event);
     void OnSetFocusAddress(wxFocusEvent& event);
     void OnMouseEventsAddress(wxMouseEvent& event);
-    void OnButtonCopy(wxCommandEvent& event);
     void OnButtonChange(wxCommandEvent& event);
+    void OnButtonCopy(wxCommandEvent& event);
     void OnListColBeginDrag(wxListEvent& event);
     void OnListItemActivated(wxListEvent& event);
     void OnListItemActivatedProductsSent(wxListEvent& event);
@@ -263,138 +257,6 @@ public:
 
 
 
-class CProductsDialog : public CProductsDialogBase
-{
-protected:
-    // Event handlers
-    void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
-    void OnCombobox(wxCommandEvent& event);
-    void OnButtonSearch(wxCommandEvent& event);
-    void OnListItemActivated(wxListEvent& event);
-
-public:
-    /** Constructor */
-    CProductsDialog(wxWindow* parent);
-
-    // Custom
-    vector<CProduct> m_vProduct;
-};
-
-
-
-class CEditProductDialog : public CEditProductDialogBase
-{
-protected:
-    // Event handlers
-    void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
-    void OnButtonDel0(wxCommandEvent& event);
-    void OnButtonDel1(wxCommandEvent& event);
-    void OnButtonDel2(wxCommandEvent& event);
-    void OnButtonDel3(wxCommandEvent& event);
-    void OnButtonDel4(wxCommandEvent& event);
-    void OnButtonDel5(wxCommandEvent& event);
-    void OnButtonDel6(wxCommandEvent& event);
-    void OnButtonDel7(wxCommandEvent& event);
-    void OnButtonDel8(wxCommandEvent& event);
-    void OnButtonDel9(wxCommandEvent& event);
-    void OnButtonDel10(wxCommandEvent& event);
-    void OnButtonDel11(wxCommandEvent& event);
-    void OnButtonDel12(wxCommandEvent& event);
-    void OnButtonDel13(wxCommandEvent& event);
-    void OnButtonDel14(wxCommandEvent& event);
-    void OnButtonDel15(wxCommandEvent& event);
-    void OnButtonDel16(wxCommandEvent& event);
-    void OnButtonDel17(wxCommandEvent& event);
-    void OnButtonDel18(wxCommandEvent& event);
-    void OnButtonDel19(wxCommandEvent& event);
-    void OnButtonAddField(wxCommandEvent& event);
-    void OnButtonSend(wxCommandEvent& event);
-    void OnButtonPreview(wxCommandEvent& event);
-    void OnButtonCancel(wxCommandEvent& event);
-
-public:
-    /** Constructor */
-    CEditProductDialog(wxWindow* parent);
-
-    // Custom
-    enum { FIELDS_MAX = 20 };
-    wxTextCtrl* m_textCtrlLabel[FIELDS_MAX];
-    wxTextCtrl* m_textCtrlField[FIELDS_MAX];
-    wxButton*   m_buttonDel[FIELDS_MAX];
-
-    void LayoutAll();
-    void ShowLine(int i, bool fShow=true);
-    void OnButtonDel(wxCommandEvent& event, int n);
-    void SetProduct(const CProduct& productIn);
-    void GetProduct(CProduct& product);
-
-};
-
-
-
-class CViewProductDialog : public CViewProductDialogBase
-{
-protected:
-    // Event handlers
-    void OnButtonSubmitForm(wxCommandEvent& event);
-    void OnButtonCancelForm(wxCommandEvent& event);
-    void OnButtonBack(wxCommandEvent& event);
-    void OnButtonNext(wxCommandEvent& event);
-    void OnButtonCancel(wxCommandEvent& event);
-
-public:
-    /** Constructor */
-    CViewProductDialog(wxWindow* parent, const CProduct& productIn);
-    ~CViewProductDialog();
-
-    // Custom
-    CProduct product;
-    enum { FIELDS_MAX = 20 };
-    wxStaticText* m_staticTextLabel[FIELDS_MAX];
-    wxTextCtrl*   m_textCtrlField[FIELDS_MAX];
-    wxChoice*     m_choiceField[FIELDS_MAX];
-
-    void GetOrder(CWalletTx& order);
-    void UpdateProductDisplay(bool fDetails);
-    void OnReply1(wxCommandEvent& event);
-};
-
-
-
-class CViewOrderDialog : public CViewOrderDialogBase
-{
-protected:
-    // Event handlers
-    void OnButtonOK(wxCommandEvent& event);
-
-public:
-    /** Constructor */
-    CViewOrderDialog(wxWindow* parent, CWalletTx order, bool fReceived);
-
-    // Custom
-    bool fReceived;
-};
-
-
-
-class CEditReviewDialog : public CEditReviewDialogBase
-{
-protected:
-    // Event handlers
-    void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
-    void OnButtonSubmit(wxCommandEvent& event);
-    void OnButtonCancel(wxCommandEvent& event);
-
-public:
-    /** Constructor */
-    CEditReviewDialog(wxWindow* parent);
-
-    // Custom
-    void GetReview(CReview& review);
-};
-
-
-
 class CGetTextFromUserDialog : public CGetTextFromUserDialogBase
 {
 protected:
@@ -430,6 +292,8 @@ public:
             m_textCtrl2->SetValue(strValue2);
             SetSize(wxDefaultCoord, 180);
         }
+        if (!fWindows)
+            SetSize(1.14 * GetSize().GetWidth(), 1.14 * GetSize().GetHeight());
     }
 
     // Custom
uibase.cpp
@@ -27,39 +27,39 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	
 	m_menuFile = new wxMenu();
 	wxMenuItem* m_menuFileExit;
-	m_menuFileExit = new wxMenuItem( m_menuFile, wxID_ANY, wxString( wxT("E&xit") ) , wxEmptyString, wxITEM_NORMAL );
+	m_menuFileExit = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL );
 	m_menuFile->Append( m_menuFileExit );
 	
-	m_menubar->Append( m_menuFile, wxT("&File") );
+	m_menubar->Append( m_menuFile, _("&File") );
 	
 	m_menuView = new wxMenu();
 	wxMenuItem* m_menuViewShowGenerated;
-	m_menuViewShowGenerated = new wxMenuItem( m_menuView, wxID_VIEWSHOWGENERATED, wxString( wxT("&Show Generated Coins") ) , wxEmptyString, wxITEM_CHECK );
+	m_menuViewShowGenerated = new wxMenuItem( m_menuView, wxID_VIEWSHOWGENERATED, wxString( _("&Show Generated Coins") ) , wxEmptyString, wxITEM_CHECK );
 	m_menuView->Append( m_menuViewShowGenerated );
 	
-	m_menubar->Append( m_menuView, wxT("&View") );
+	m_menubar->Append( m_menuView, _("&View") );
 	
 	m_menuOptions = new wxMenu();
 	wxMenuItem* m_menuOptionsGenerateBitcoins;
-	m_menuOptionsGenerateBitcoins = new wxMenuItem( m_menuOptions, wxID_OPTIONSGENERATEBITCOINS, wxString( wxT("&Generate Coins") ) , wxEmptyString, wxITEM_CHECK );
+	m_menuOptionsGenerateBitcoins = new wxMenuItem( m_menuOptions, wxID_OPTIONSGENERATEBITCOINS, wxString( _("&Generate Coins") ) , wxEmptyString, wxITEM_CHECK );
 	m_menuOptions->Append( m_menuOptionsGenerateBitcoins );
 	
 	wxMenuItem* m_menuOptionsChangeYourAddress;
-	m_menuOptionsChangeYourAddress = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( wxT("&Change Your Address...") ) , wxEmptyString, wxITEM_NORMAL );
+	m_menuOptionsChangeYourAddress = new wxMenuItem( m_menuOptions, wxID_ANY, wxString( _("&Change Your Address...") ) , wxEmptyString, wxITEM_NORMAL );
 	m_menuOptions->Append( m_menuOptionsChangeYourAddress );
 	
 	wxMenuItem* m_menuOptionsOptions;
-	m_menuOptionsOptions = new wxMenuItem( m_menuOptions, wxID_MENUOPTIONSOPTIONS, wxString( wxT("&Options...") ) , wxEmptyString, wxITEM_NORMAL );
+	m_menuOptionsOptions = new wxMenuItem( m_menuOptions, wxID_MENUOPTIONSOPTIONS, wxString( _("&Options...") ) , wxEmptyString, wxITEM_NORMAL );
 	m_menuOptions->Append( m_menuOptionsOptions );
 	
-	m_menubar->Append( m_menuOptions, wxT("&Options") );
+	m_menubar->Append( m_menuOptions, _("&Options") );
 	
 	m_menuHelp = new wxMenu();
 	wxMenuItem* m_menuHelpAbout;
-	m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( wxT("&About...") ) , wxEmptyString, wxITEM_NORMAL );
+	m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&About...") ) , wxEmptyString, wxITEM_NORMAL );
 	m_menuHelp->Append( m_menuHelpAbout );
 	
-	m_menubar->Append( m_menuHelp, wxT("&Help") );
+	m_menubar->Append( m_menuHelp, _("&Help") );
 	
 	this->SetMenuBar( m_menubar );
 	
@@ -68,8 +68,8 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	m_toolBar->SetToolSeparation( 1 );
 	m_toolBar->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
 	
-	m_toolBar->AddTool( wxID_BUTTONSEND, wxT("&Send Coins"), wxBitmap( send20_xpm ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString );
-	m_toolBar->AddTool( wxID_BUTTONRECEIVE, wxT("&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();
 	
 	m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
@@ -84,7 +84,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	wxBoxSizer* bSizer85;
 	bSizer85 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_staticText32 = new wxStaticText( this, wxID_ANY, wxT("Your Bitcoin Address:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText32 = new wxStaticText( this, wxID_ANY, _("Your Bitcoin Address:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText32->Wrap( -1 );
 	bSizer85->Add( m_staticText32, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
 	
@@ -93,13 +93,13 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	
 	bSizer85->Add( m_textCtrlAddress, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
 	
-	m_buttonCopy = new wxButton( this, wxID_BUTTONCOPY, wxT(" &Copy to Clipboard "), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
-	bSizer85->Add( m_buttonCopy, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+	m_buttonNew = new wxButton( this, wxID_BUTTONCHANGE, _("&New..."), wxDefaultPosition, wxDefaultSize, 0 );
+	m_buttonNew->Hide();
 	
-	m_button91 = new wxButton( this, wxID_BUTTONCHANGE, wxT("C&hange..."), wxDefaultPosition, wxDefaultSize, 0 );
-	m_button91->Hide();
+	bSizer85->Add( m_buttonNew, 0, wxRIGHT, 5 );
 	
-	bSizer85->Add( m_button91, 0, wxRIGHT, 5 );
+	m_buttonCopy = new wxButton( this, wxID_BUTTONCOPY, _(" &Copy to Clipboard "), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
+	bSizer85->Add( m_buttonCopy, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
 	
 	
 	bSizer85->Add( 0, 0, 0, wxEXPAND, 5 );
@@ -113,7 +113,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	wxBoxSizer* bSizer66;
 	bSizer66 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_staticText41 = new wxStaticText( m_panel14, wxID_ANY, wxT("Balance:"), wxDefaultPosition, wxSize( -1,15 ), 0 );
+	m_staticText41 = new wxStaticText( m_panel14, wxID_ANY, _("Balance:"), wxDefaultPosition, wxSize( -1,15 ), 0 );
 	m_staticText41->Wrap( -1 );
 	bSizer66->Add( m_staticText41, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
 	
@@ -132,7 +132,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	
 	bSizer3->Add( 0, 0, 0, wxEXPAND, 5 );
 	
-	wxString m_choiceFilterChoices[] = { wxT(" All"), wxT(" Sent"), wxT(" Received"), wxT(" In Progress") };
+	wxString m_choiceFilterChoices[] = { _(" All"), _(" Sent"), _(" Received"), _(" In Progress") };
 	int m_choiceFilterNChoices = sizeof( m_choiceFilterChoices ) / sizeof( wxString );
 	m_choiceFilter = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxSize( 110,-1 ), m_choiceFilterNChoices, m_choiceFilterChoices, 0 );
 	m_choiceFilter->SetSelection( 0 );
@@ -191,8 +191,8 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
 	m_textCtrlAddress->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CMainFrameBase::OnMouseEventsAddress ), NULL, this );
 	m_textCtrlAddress->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( CMainFrameBase::OnMouseEventsAddress ), NULL, this );
 	m_textCtrlAddress->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( CMainFrameBase::OnSetFocusAddress ), NULL, this );
+	m_buttonNew->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonChange ), NULL, this );
 	m_buttonCopy->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonCopy ), NULL, this );
-	m_button91->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonChange ), NULL, this );
 	m_listCtrl->Connect( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, wxListEventHandler( CMainFrameBase::OnListColBeginDrag ), NULL, this );
 	m_listCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( CMainFrameBase::OnListItemActivated ), NULL, this );
 	m_listCtrl->Connect( wxEVT_PAINT, wxPaintEventHandler( CMainFrameBase::OnPaintListCtrl ), NULL, this );
@@ -243,8 +243,8 @@ CMainFrameBase::~CMainFrameBase()
 	m_textCtrlAddress->Disconnect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CMainFrameBase::OnMouseEventsAddress ), NULL, this );
 	m_textCtrlAddress->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( CMainFrameBase::OnMouseEventsAddress ), NULL, this );
 	m_textCtrlAddress->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( CMainFrameBase::OnSetFocusAddress ), NULL, this );
+	m_buttonNew->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonChange ), NULL, this );
 	m_buttonCopy->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonCopy ), NULL, this );
-	m_button91->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CMainFrameBase::OnButtonChange ), NULL, this );
 	m_listCtrl->Disconnect( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, wxListEventHandler( CMainFrameBase::OnListColBeginDrag ), NULL, this );
 	m_listCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( CMainFrameBase::OnListItemActivated ), NULL, this );
 	m_listCtrl->Disconnect( wxEVT_PAINT, wxPaintEventHandler( CMainFrameBase::OnPaintListCtrl ), NULL, this );
@@ -268,7 +268,7 @@ CTxDetailsDialogBase::CTxDetailsDialogBase( wxWindow* parent, wxWindowID id, con
 	wxBoxSizer* bSizer65;
 	bSizer65 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_buttonOK = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+	m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
 	bSizer65->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
 	
 	bSizer64->Add( bSizer65, 0, wxALIGN_RIGHT, 5 );
@@ -311,7 +311,7 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	
 	bSizer69->Add( 0, 16, 0, wxEXPAND, 5 );
 	
-	m_staticText32 = new wxStaticText( m_panelMain, wxID_ANY, wxT("Optional transaction fee you give to the nodes that process your transactions."), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText32 = new wxStaticText( m_panelMain, wxID_ANY, _("Optional transaction fee you give to the nodes that process your transactions."), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText32->Wrap( -1 );
 	m_staticText32->Hide();
 	
@@ -320,7 +320,7 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	wxBoxSizer* bSizer56;
 	bSizer56 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_staticText31 = new wxStaticText( m_panelMain, wxID_ANY, wxT("Transaction fee:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText31 = new wxStaticText( m_panelMain, wxID_ANY, _("Transaction fee:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText31->Wrap( -1 );
 	m_staticText31->Hide();
 	
@@ -336,35 +336,35 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	wxBoxSizer* bSizer71;
 	bSizer71 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_checkBoxLimitProcessors = new wxCheckBox( m_panelMain, wxID_ANY, wxT("&Limit coin generation to"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_checkBoxLimitProcessors = new wxCheckBox( m_panelMain, wxID_ANY, _("&Limit coin generation to"), wxDefaultPosition, wxDefaultSize, 0 );
 	
 	bSizer71->Add( m_checkBoxLimitProcessors, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 	
 	m_spinCtrlLimitProcessors = new wxSpinCtrl( m_panelMain, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 48,-1 ), wxSP_ARROW_KEYS, 1, 999, 1 );
 	bSizer71->Add( m_spinCtrlLimitProcessors, 0, wxALIGN_CENTER_VERTICAL, 5 );
 	
-	m_staticText35 = new wxStaticText( m_panelMain, wxID_ANY, wxT("processors"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText35 = new wxStaticText( m_panelMain, wxID_ANY, _("processors"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText35->Wrap( -1 );
 	bSizer71->Add( m_staticText35, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 	
 	bSizer69->Add( bSizer71, 0, 0, 5 );
 	
-	m_checkBoxStartOnSystemStartup = new wxCheckBox( m_panelMain, wxID_ANY, wxT("&Start Bitcoin on system startup"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_checkBoxStartOnSystemStartup = new wxCheckBox( m_panelMain, wxID_ANY, _("&Start Bitcoin on system startup"), wxDefaultPosition, wxDefaultSize, 0 );
 	
 	bSizer69->Add( m_checkBoxStartOnSystemStartup, 0, wxALL, 5 );
 	
-	m_checkBoxMinimizeToTray = new wxCheckBox( m_panelMain, wxID_ANY, wxT("&Minimize to the tray instead of the taskbar"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_checkBoxMinimizeToTray = new wxCheckBox( m_panelMain, wxID_ANY, _("&Minimize to the tray instead of the taskbar"), wxDefaultPosition, wxDefaultSize, 0 );
 	
 	bSizer69->Add( m_checkBoxMinimizeToTray, 0, wxALL, 5 );
 	
-	m_checkBoxMinimizeOnClose = new wxCheckBox( m_panelMain, wxID_ANY, wxT("M&inimize to the tray on close"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_checkBoxMinimizeOnClose = new wxCheckBox( m_panelMain, wxID_ANY, _("M&inimize to the tray on close"), wxDefaultPosition, wxDefaultSize, 0 );
 	
 	bSizer69->Add( m_checkBoxMinimizeOnClose, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
 	
 	wxBoxSizer* bSizer102;
 	bSizer102 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_checkBoxUseProxy = new wxCheckBox( m_panelMain, wxID_ANY, wxT("&Connect through socks4 proxy: "), wxDefaultPosition, wxDefaultSize, 0 );
+	m_checkBoxUseProxy = new wxCheckBox( m_panelMain, wxID_ANY, _("&Connect through socks4 proxy: "), wxDefaultPosition, wxDefaultSize, 0 );
 	
 	bSizer102->Add( m_checkBoxUseProxy, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
 	
@@ -376,7 +376,7 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	
 	bSizer103->Add( 18, 0, 0, 0, 5 );
 	
-	m_staticTextProxyIP = new wxStaticText( m_panelMain, wxID_ANY, wxT("Proxy &IP:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextProxyIP = new wxStaticText( m_panelMain, wxID_ANY, _("Proxy &IP:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextProxyIP->Wrap( -1 );
 	bSizer103->Add( m_staticTextProxyIP, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
 	
@@ -384,7 +384,7 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	m_textCtrlProxyIP->SetMaxLength( 15 ); 
 	bSizer103->Add( m_textCtrlProxyIP, 0, wxALIGN_CENTER_VERTICAL, 5 );
 	
-	m_staticTextProxyPort = new wxStaticText( m_panelMain, wxID_ANY, wxT(" &Port:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextProxyPort = new wxStaticText( m_panelMain, wxID_ANY, _(" &Port:"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextProxyPort->Wrap( -1 );
 	bSizer103->Add( m_staticTextProxyPort, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
 	
@@ -406,19 +406,19 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	
 	bSizer64->Add( 0, 16, 0, wxEXPAND, 5 );
 	
-	m_staticText321 = new wxStaticText( m_panelTest2, wxID_ANY, wxT("Test panel 2 for future expansion"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText321 = new wxStaticText( m_panelTest2, wxID_ANY, _("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, wxT("Let's not start multiple pages until the first page is filled up"), wxDefaultPosition, wxDefaultSize, 0 );
+	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->Wrap( -1 );
 	bSizer64->Add( m_staticText69, 0, wxALL, 5 );
 	
-	m_staticText70 = new wxStaticText( m_panelTest2, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
+	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, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText71 = new wxStaticText( m_panelTest2, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText71->Wrap( -1 );
 	bSizer64->Add( m_staticText71, 0, wxALL, 5 );
 	
@@ -437,13 +437,13 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
 	wxBoxSizer* bSizer58;
 	bSizer58 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_buttonOK = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+	m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
 	bSizer58->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
 	
-	m_buttonCancel = new wxButton( this, wxID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+	m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
 	bSizer58->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
 	
-	m_buttonApply = new wxButton( this, wxID_APPLY, wxT("&Apply"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+	m_buttonApply = new wxButton( this, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
 	bSizer58->Add( m_buttonApply, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
 	
 	bSizer55->Add( bSizer58, 0, wxALIGN_RIGHT, 5 );
@@ -504,13 +504,13 @@ CAboutDialogBase::CAboutDialogBase( wxWindow* parent, wxWindowID id, const wxStr
 	wxBoxSizer* bSizer64;
 	bSizer64 = new wxBoxSizer( wxHORIZONTAL );
 	
-	m_staticText40 = new wxStaticText( this, wxID_ANY, wxT("Bitcoin "), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticText40 = new wxStaticText( this, wxID_ANY, _("Bitcoin "), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticText40->Wrap( -1 );
 	m_staticText40->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
 	
 	bSizer64->Add( m_staticText40, 0, wxALIGN_BOTTOM|wxTOP|wxBOTTOM|wxLEFT, 5 );
 	
-	m_staticTextVersion = new wxStaticText( this, wxID_ANY, wxT("version"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextVersion = new wxStaticText( this, wxID_ANY, _("version"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextVersion->Wrap( -1 );
 	m_staticTextVersion->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
 	
@@ -521,7 +521,7 @@ CAboutDialogBase::CAboutDialogBase( wxWindow* parent, wxWindowID id, const wxStr
 	
 	bSizer631->Add( 0, 4, 0, wxEXPAND, 5 );
 	
-	m_staticTextMain = new wxStaticText( this, wxID_ANY, wxT("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 © 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 );
 	
@@ -538,7 +538,7 @@ CAboutDialogBase::CAboutDialogBase( wxWindow* parent, wxWindowID id, const wxStr
 	
 	bSizer61->Add( 0, 0, 1, wxEXPAND, 5 );
 	
-	m_buttonOK = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+	m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
 	bSizer61->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
 	
 	bSizer60->Add( bSizer61, 0, wxALIGN_RIGHT|wxEXPAND|wxRIGHT, 5 );
@@ -577,7 +577,7 @@ CSendDialogBase::CSendDialogBase( wxWindow* parent, wxWindowID id, const wxStrin
 	
 	fgSizer1->Add( 0, 0, 0, wxEXPAND, 5 );
 	
-	m_staticTextInstructions = new wxStaticText( this, wxID_ANY, wxT("Enter the recipient's IP address (e.g. 123.45.6.7) for online transfer with comments and confirmation, \nor Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) if recipient is not online."), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextInstructions = new wxStaticText( this, wxID_ANY, _("Enter the recipient's IP address (e.g. 123.45.6.7) for online transfer with comments and confirmation, \nor Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) if recipient is not online."), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextInstructions->Wrap( -1 );
 	fgSizer1->Add( m_staticTextInstructions, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
uibase.h
uiproject.fbp