Mac OS build fixes by laszlo
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>
Wed, 19 May 2010 00:26:56 +0000 (00:26 +0000)
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>
Wed, 19 May 2010 00:26:56 +0000 (00:26 +0000)
-- version 0.2.8

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@76 1a98c847-1fd6-4fd8-948a-caf3550aa51b

12 files changed:
init.cpp
main.cpp
net.cpp
net.h
rpc.cpp
serialize.h
ui.cpp
uibase.cpp
uibase.h
uiproject.fbp
util.cpp
util.h

index 06d8f4c..db8886e 100644 (file)
--- a/init.cpp
+++ b/init.cpp
@@ -284,6 +284,10 @@ bool CMyApp::OnInit2()
     _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);\r
     _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));\r
 #endif\r
+#if _MSC_VER >= 1400\r
+    // Disable confusing "helpful" text message on abort, ctrl-c\r
+    _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);\r
+#endif\r
 #if defined(__WXMSW__) && defined(__WXDEBUG__) && wxUSE_GUI\r
     // Disable malfunctioning wxWidgets debug assertion\r
     g_isPainting = 10000;\r
@@ -291,10 +295,12 @@ bool CMyApp::OnInit2()
 #if wxUSE_GUI\r
     wxImage::AddHandler(new wxPNGHandler);\r
 #endif\r
-#ifdef __WXMSW__\r
+#if defined(__WXMSW__ ) || defined(__WXMAC__)\r
     SetAppName("Bitcoin");\r
 #else\r
     SetAppName("bitcoin");\r
+#endif\r
+#ifndef __WXMSW__\r
     umask(077);\r
 #endif\r
 #ifdef __WXMSW__\r
index f741623..ad0208a 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1338,7 +1338,7 @@ bool CBlock::AcceptBlock()
 \r
     // Don't relay old inventory during initial block download.\r
     // Please keep this number updated to a few thousand below current block count.\r
-    if (hashBestChain == hash && nBestHeight > 40000)\r
+    if (hashBestChain == hash && nBestHeight > 55000)\r
         RelayInventory(CInv(MSG_BLOCK, hash));\r
 \r
     // // Add atoms to user reviews for coins created\r
@@ -2255,9 +2255,9 @@ bool SendMessages(CNode* pto)
         // Delay tx inv messages to protect privacy,\r
         // trickle them out to a few nodes at a time.\r
         bool fSendTxInv = false;\r
-        if (GetTimeMillis() - pto->nLastSentTxInv > 1800 + GetRand(200))\r
+        if (GetTimeMillis() > pto->nNextSendTxInv)\r
         {\r
-            pto->nLastSentTxInv = GetTimeMillis();\r
+            pto->nNextSendTxInv = GetTimeMillis() + 3000 + GetRand(2000);\r
             fSendTxInv = true;\r
         }\r
 \r
diff --git a/net.cpp b/net.cpp
index 8e8127d..fbfa746 100644 (file)
--- a/net.cpp
+++ b/net.cpp
@@ -927,9 +927,7 @@ void ThreadOpenConnections2(void* parg)
                     continue;\r
 \r
                 // Only try the old stuff if we don't have enough connections\r
-                if (vNodes.size() >= 2 && nSinceLastSeen > 7 * 24 * 60 * 60)\r
-                    continue;\r
-                if (vNodes.size() >= 5 && nSinceLastSeen > 24 * 60 * 60)\r
+                if (vNodes.size() >= 8 && nSinceLastSeen > 24 * 60 * 60)\r
                     continue;\r
 \r
                 // If multiple addresses are ready, prioritize by time since\r
diff --git a/net.h b/net.h
index c7d1546..1593a97 100644 (file)
--- a/net.h
+++ b/net.h
@@ -45,6 +45,7 @@ bool StopNode();
 //  (4) message start\r
 //  (12) command\r
 //  (4) size\r
+//  (4) checksum\r
 \r
 // The message start string is designed to be unlikely to occur in normal data.\r
 // The characters are rarely used upper ascii, not valid as UTF-8, and produce\r
@@ -58,6 +59,7 @@ public:
     char pchMessageStart[sizeof(::pchMessageStart)];\r
     char pchCommand[COMMAND_SIZE];\r
     unsigned int nMessageSize;\r
+    //unsigned int nChecksum;\r
 \r
     CMessageHeader()\r
     {\r
@@ -65,6 +67,7 @@ public:
         memset(pchCommand, 0, sizeof(pchCommand));\r
         pchCommand[1] = 1;\r
         nMessageSize = -1;\r
+        //nChecksum = 0;\r
     }\r
 \r
     CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn)\r
@@ -79,6 +82,8 @@ public:
         READWRITE(FLATDATA(pchMessageStart));\r
         READWRITE(FLATDATA(pchCommand));\r
         READWRITE(nMessageSize);\r
+        //if (nVersion >= 209 && GetCommand() != "version")\r
+        //    READWRITE(nChecksum);\r
     )\r
 \r
     string GetCommand()\r
@@ -484,7 +489,8 @@ public:
     int64 nLastRecv;\r
     int64 nLastSendEmpty;\r
     int64 nTimeConnected;\r
-    unsigned int nPushPos;\r
+    unsigned int nHeaderStart;\r
+    unsigned int nMessageStart;\r
     CAddress addr;\r
     int nVersion;\r
     bool fClient;\r
@@ -512,7 +518,7 @@ public:
     vector<CInv> vInventoryToSend;\r
     CCriticalSection cs_inventory;\r
     multimap<int64, CInv> mapAskFor;\r
-    int64 nLastSentTxInv;\r
+    int64 nNextSendTxInv;\r
 \r
     // publish and subscription\r
     vector<char> vfSubscribe;\r
@@ -528,7 +534,8 @@ public:
         nLastRecv = 0;\r
         nLastSendEmpty = GetTime();\r
         nTimeConnected = GetTime();\r
-        nPushPos = -1;\r
+        nHeaderStart = -1;\r
+        nMessageStart = -1;\r
         addr = addrIn;\r
         nVersion = 0;\r
         fClient = false; // set by version message\r
@@ -542,6 +549,7 @@ public:
         pindexLastGetBlocksBegin = 0;\r
         hashLastGetBlocksEnd = 0;\r
         fGetAddr = false;\r
+        nNextSendTxInv = 0;\r
         vfSubscribe.assign(256, false);\r
 \r
         // Push a version message\r
@@ -639,10 +647,11 @@ public:
     void BeginMessage(const char* pszCommand)\r
     {\r
         cs_vSend.Enter();\r
-        if (nPushPos != -1)\r
+        if (nHeaderStart != -1)\r
             AbortMessage();\r
-        nPushPos = vSend.size();\r
+        nHeaderStart = vSend.size();\r
         vSend << CMessageHeader(pszCommand, 0);\r
+        nMessageStart = vSend.size();\r
         if (fDebug)\r
             printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());\r
         printf("sending: %s ", pszCommand);\r
@@ -650,10 +659,11 @@ public:
 \r
     void AbortMessage()\r
     {\r
-        if (nPushPos == -1)\r
+        if (nHeaderStart == -1)\r
             return;\r
-        vSend.resize(nPushPos);\r
-        nPushPos = -1;\r
+        vSend.resize(nHeaderStart);\r
+        nHeaderStart = -1;\r
+        nMessageStart = -1;\r
         cs_vSend.Leave();\r
         printf("(aborted)\n");\r
     }\r
@@ -667,25 +677,26 @@ public:
             return;\r
         }\r
 \r
-        if (nPushPos == -1)\r
+        if (nHeaderStart == -1)\r
             return;\r
 \r
         // Patch in the size\r
-        unsigned int nSize = vSend.size() - nPushPos - sizeof(CMessageHeader);\r
-        memcpy((char*)&vSend[nPushPos] + offsetof(CMessageHeader, nMessageSize), &nSize, sizeof(nSize));\r
+        unsigned int nSize = vSend.size() - nMessageStart;\r
+        memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nMessageSize), &nSize, sizeof(nSize));\r
 \r
         printf("(%d bytes) ", nSize);\r
         printf("\n");\r
 \r
-        nPushPos = -1;\r
+        nHeaderStart = -1;\r
+        nMessageStart = -1;\r
         cs_vSend.Leave();\r
     }\r
 \r
     void EndMessageAbortIfEmpty()\r
     {\r
-        if (nPushPos == -1)\r
+        if (nHeaderStart == -1)\r
             return;\r
-        int nSize = vSend.size() - nPushPos - sizeof(CMessageHeader);\r
+        int nSize = vSend.size() - nMessageStart;\r
         if (nSize > 0)\r
             EndMessage();\r
         else\r
@@ -694,9 +705,9 @@ public:
 \r
     const char* GetMessageCommand() const\r
     {\r
-        if (nPushPos == -1)\r
+        if (nHeaderStart == -1)\r
             return "";\r
-        return &vSend[nPushPos] + offsetof(CMessageHeader, pchCommand);\r
+        return &vSend[nHeaderStart] + offsetof(CMessageHeader, pchCommand);\r
     }\r
 \r
 \r
diff --git a/rpc.cpp b/rpc.cpp
index f298137..c56ce26 100644 (file)
--- a/rpc.cpp
+++ b/rpc.cpp
@@ -77,24 +77,28 @@ Value getconnectioncount(const Array& params)
 }\r
 \r
 \r
-Value getdifficulty(const Array& params)\r
+double GetDifficulty()\r
 {\r
-    if (params.size() != 0)\r
-        throw runtime_error(\r
-            "getdifficulty (no parameters)\n"\r
-            "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.");\r
-\r
-    if (pindexBest == NULL)\r
-        throw runtime_error("block chain not loaded");\r
-\r
     // Floating point number that is a multiple of the minimum difficulty,\r
     // minimum difficulty = 1.0.\r
+    if (pindexBest == NULL)\r
+        return 1.0;\r
     int nShift = 256 - 32 - 31; // to fit in a uint\r
     double dMinimum = (CBigNum().SetCompact(bnProofOfWorkLimit.GetCompact()) >> nShift).getuint();\r
     double dCurrently = (CBigNum().SetCompact(pindexBest->nBits) >> nShift).getuint();\r
     return dMinimum / dCurrently;\r
 }\r
 \r
+Value getdifficulty(const Array& params)\r
+{\r
+    if (params.size() != 0)\r
+        throw runtime_error(\r
+            "getdifficulty (no parameters)\n"\r
+            "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.");\r
+\r
+    return GetDifficulty();\r
+}\r
+\r
 \r
 Value getbalance(const Array& params)\r
 {\r
@@ -157,6 +161,7 @@ Value getinfo(const Array& params)
     obj.push_back(Pair("proxy",         (fUseProxy ? addrProxy.ToStringIPPort() : string())));\r
     obj.push_back(Pair("generate",      (bool)fGenerateBitcoins));\r
     obj.push_back(Pair("genproclimit",  (int)(fLimitProcessors ? nLimitProcessors : -1)));\r
+    obj.push_back(Pair("difficulty",    (double)GetDifficulty()));\r
     return obj;\r
 }\r
 \r
index 77dfa95..c47dddc 100644 (file)
@@ -19,8 +19,8 @@ class CScript;
 class CDataStream;\r
 class CAutoFile;\r
 \r
-static const int VERSION = 207;\r
-static const char* pszSubVer = ".1";\r
+static const int VERSION = 208;\r
+static const char* pszSubVer = ".0";\r
 \r
 \r
 \r
diff --git a/ui.cpp b/ui.cpp
index efb0538..5c7311f 100644 (file)
--- a/ui.cpp
+++ b/ui.cpp
@@ -256,11 +256,20 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
     m_staticTextBalance->SetLabel(FormatMoney(GetBalance()) + "  ");\r
     m_listCtrl->SetFocus();\r
     ptaskbaricon = new CMyTaskBarIcon();\r
+#ifdef __WXMAC__\r
+    // Mac automatically moves wxID_EXIT, wxID_PREFERENCES and wxID_ABOUT\r
+    // to their standard places, leaving these menus empty.\r
+    GetMenuBar()->Remove(2); // remove Help menu\r
+    GetMenuBar()->Remove(0); // remove File menu\r
+#endif\r
 \r
     // Init column headers\r
     int nDateWidth = DateTimeStr(1229413914).size() * 6 + 8;\r
     if (!strstr(DateTimeStr(1229413914).c_str(), "2008"))\r
         nDateWidth += 12;\r
+#ifdef __WXMAC__\r
+    nDateWidth += 2;\r
+#endif\r
     wxListCtrl* pplistCtrl[] = {m_listCtrlAll, m_listCtrlSentReceived, m_listCtrlSent, m_listCtrlReceived};\r
     foreach(wxListCtrl* p, pplistCtrl)\r
     {\r
@@ -274,7 +283,7 @@ CMainFrame::CMainFrame(wxWindow* parent) : CMainFrameBase(parent)
     }\r
 \r
     // Init status bar\r
-    int pnWidths[3] = { -100, 88, 290 };\r
+    int pnWidths[3] = { -100, 88, 300 };\r
 #ifndef __WXMSW__\r
     pnWidths[1] = pnWidths[1] * 1.1 * dResize;\r
     pnWidths[2] = pnWidths[2] * 1.1 * dResize;\r
@@ -2157,7 +2166,7 @@ CAddressBookDialog::CAddressBookDialog(wxWindow* parent, const wxString& strInit
             bool fMine = (AddressToHash160(strAddress, hash160) && mapPubKeys.count(hash160));\r
             wxListCtrl* plistCtrl = fMine ? m_listCtrlReceiving : m_listCtrlSending;\r
             int nIndex = InsertLine(plistCtrl, strName, strAddress);\r
-            if (strAddress == (fMine ? strDefaultReceiving : strInitSelected))\r
+            if (strAddress == (fMine ? strDefaultReceiving : string(strInitSelected)))\r
                 plistCtrl->SetItemState(nIndex, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED|wxLIST_STATE_FOCUSED);\r
         }\r
     }\r
@@ -2444,7 +2453,7 @@ void CMyTaskBarIcon::OnMenuRestore(wxCommandEvent& event)
 void CMyTaskBarIcon::OnMenuOptions(wxCommandEvent& event)\r
 {\r
     // Since it's modal, get the main window to do it\r
-    wxCommandEvent event2(wxEVT_COMMAND_MENU_SELECTED, wxID_MENUOPTIONSOPTIONS);\r
+    wxCommandEvent event2(wxEVT_COMMAND_MENU_SELECTED, wxID_PREFERENCES);\r
     pframeMain->GetEventHandler()->AddPendingEvent(event2);\r
 }\r
 \r
index 03ca13d..5fd83ee 100644 (file)
@@ -24,7 +24,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        \r
        m_menuFile = new wxMenu();\r
        wxMenuItem* m_menuFileExit;\r
-       m_menuFileExit = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL );\r
+       m_menuFileExit = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL );\r
        m_menuFile->Append( m_menuFileExit );\r
        \r
        m_menubar->Append( m_menuFile, _("&File") );\r
@@ -39,14 +39,14 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        m_menuOptions->Append( m_menuOptionsChangeYourAddress );\r
        \r
        wxMenuItem* m_menuOptionsOptions;\r
-       m_menuOptionsOptions = new wxMenuItem( m_menuOptions, wxID_MENUOPTIONSOPTIONS, wxString( _("&Options...") ) , wxEmptyString, wxITEM_NORMAL );\r
+       m_menuOptionsOptions = new wxMenuItem( m_menuOptions, wxID_PREFERENCES, wxString( _("&Options...") ) , wxEmptyString, wxITEM_NORMAL );\r
        m_menuOptions->Append( m_menuOptionsOptions );\r
        \r
        m_menubar->Append( m_menuOptions, _("&Settings") );\r
        \r
        m_menuHelp = new wxMenu();\r
        wxMenuItem* m_menuHelpAbout;\r
-       m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&About...") ) , wxEmptyString, wxITEM_NORMAL );\r
+       m_menuHelpAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About...") ) , wxEmptyString, wxITEM_NORMAL );\r
        m_menuHelp->Append( m_menuHelpAbout );\r
        \r
        m_menubar->Append( m_menuHelp, _("&Help") );\r
@@ -133,7 +133,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        wxBoxSizer* bSizer11;\r
        bSizer11 = new wxBoxSizer( wxVERTICAL );\r
        \r
-       m_listCtrlAll = new wxListCtrl( m_panel9, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING|wxVSCROLL );\r
+       m_listCtrlAll = new wxListCtrl( m_panel9, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING );\r
        bSizer11->Add( m_listCtrlAll, 1, wxEXPAND, 5 );\r
        \r
        m_panel9->SetSizer( bSizer11 );\r
@@ -144,7 +144,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        wxBoxSizer* bSizer111;\r
        bSizer111 = new wxBoxSizer( wxVERTICAL );\r
        \r
-       m_listCtrlSentReceived = new wxListCtrl( m_panel91, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING|wxVSCROLL );\r
+       m_listCtrlSentReceived = new wxListCtrl( m_panel91, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING );\r
        bSizer111->Add( m_listCtrlSentReceived, 1, wxEXPAND, 5 );\r
        \r
        m_panel91->SetSizer( bSizer111 );\r
@@ -155,7 +155,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        wxBoxSizer* bSizer112;\r
        bSizer112 = new wxBoxSizer( wxVERTICAL );\r
        \r
-       m_listCtrlSent = new wxListCtrl( m_panel92, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING|wxVSCROLL );\r
+       m_listCtrlSent = new wxListCtrl( m_panel92, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING );\r
        bSizer112->Add( m_listCtrlSent, 1, wxEXPAND, 5 );\r
        \r
        m_panel92->SetSizer( bSizer112 );\r
@@ -166,7 +166,7 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
        wxBoxSizer* bSizer113;\r
        bSizer113 = new wxBoxSizer( wxVERTICAL );\r
        \r
-       m_listCtrlReceived = new wxListCtrl( m_panel93, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING|wxVSCROLL );\r
+       m_listCtrlReceived = new wxListCtrl( m_panel93, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SORT_DESCENDING );\r
        bSizer113->Add( m_listCtrlReceived, 1, wxEXPAND, 5 );\r
        \r
        m_panel93->SetSizer( bSizer113 );\r
index 1686cbf..e2f0a1c 100644 (file)
--- a/uibase.h
+++ b/uibase.h
 \r
 #define wxID_MAINFRAME 1000\r
 #define wxID_OPTIONSGENERATEBITCOINS 1001\r
-#define wxID_MENUOPTIONSOPTIONS 1002\r
-#define wxID_BUTTONSEND 1003\r
-#define wxID_BUTTONRECEIVE 1004\r
-#define wxID_TEXTCTRLADDRESS 1005\r
-#define wxID_BUTTONNEW 1006\r
-#define wxID_BUTTONCOPY 1007\r
-#define wxID_TRANSACTIONFEE 1008\r
-#define wxID_PROXYIP 1009\r
-#define wxID_PROXYPORT 1010\r
-#define wxID_TEXTCTRLPAYTO 1011\r
-#define wxID_BUTTONPASTE 1012\r
-#define wxID_BUTTONADDRESSBOOK 1013\r
-#define wxID_TEXTCTRLAMOUNT 1014\r
-#define wxID_CHOICETRANSFERTYPE 1015\r
-#define wxID_LISTCTRL 1016\r
-#define wxID_BUTTONRENAME 1017\r
-#define wxID_PANELSENDING 1018\r
-#define wxID_LISTCTRLSENDING 1019\r
-#define wxID_PANELRECEIVING 1020\r
-#define wxID_LISTCTRLRECEIVING 1021\r
-#define wxID_BUTTONDELETE 1022\r
-#define wxID_BUTTONEDIT 1023\r
-#define wxID_TEXTCTRL 1024\r
+#define wxID_BUTTONSEND 1002\r
+#define wxID_BUTTONRECEIVE 1003\r
+#define wxID_TEXTCTRLADDRESS 1004\r
+#define wxID_BUTTONNEW 1005\r
+#define wxID_BUTTONCOPY 1006\r
+#define wxID_TRANSACTIONFEE 1007\r
+#define wxID_PROXYIP 1008\r
+#define wxID_PROXYPORT 1009\r
+#define wxID_TEXTCTRLPAYTO 1010\r
+#define wxID_BUTTONPASTE 1011\r
+#define wxID_BUTTONADDRESSBOOK 1012\r
+#define wxID_TEXTCTRLAMOUNT 1013\r
+#define wxID_CHOICETRANSFERTYPE 1014\r
+#define wxID_LISTCTRL 1015\r
+#define wxID_BUTTONRENAME 1016\r
+#define wxID_PANELSENDING 1017\r
+#define wxID_LISTCTRLSENDING 1018\r
+#define wxID_PANELRECEIVING 1019\r
+#define wxID_LISTCTRLRECEIVING 1020\r
+#define wxID_BUTTONDELETE 1021\r
+#define wxID_BUTTONEDIT 1022\r
+#define wxID_TEXTCTRL 1023\r
 \r
 ///////////////////////////////////////////////////////////////////////////////\r
 /// Class CMainFrameBase\r
index 8643fba..990af52 100644 (file)
                         <property name="checked">0</property>\r
                         <property name="enabled">1</property>\r
                         <property name="help"></property>\r
-                        <property name="id">wxID_ANY</property>\r
+                        <property name="id">wxID_EXIT</property>\r
                         <property name="kind">wxITEM_NORMAL</property>\r
                         <property name="label">E&amp;xit</property>\r
                         <property name="name">m_menuFileExit</property>\r
                         <property name="checked">0</property>\r
                         <property name="enabled">1</property>\r
                         <property name="help"></property>\r
-                        <property name="id">wxID_MENUOPTIONSOPTIONS</property>\r
+                        <property name="id">wxID_PREFERENCES</property>\r
                         <property name="kind">wxITEM_NORMAL</property>\r
                         <property name="label">&amp;Options...</property>\r
                         <property name="name">m_menuOptionsOptions</property>\r
                         <property name="checked">0</property>\r
                         <property name="enabled">1</property>\r
                         <property name="help"></property>\r
-                        <property name="id">wxID_ANY</property>\r
+                        <property name="id">wxID_ABOUT</property>\r
                         <property name="kind">wxITEM_NORMAL</property>\r
                         <property name="label">&amp;About...</property>\r
                         <property name="name">m_menuHelpAbout</property>\r
                                             <property name="tooltip"></property>\r
                                             <property name="window_extra_style"></property>\r
                                             <property name="window_name"></property>\r
-                                            <property name="window_style">wxVSCROLL</property>\r
+                                            <property name="window_style"></property>\r
                                             <event name="OnChar"></event>\r
                                             <event name="OnEnterWindow"></event>\r
                                             <event name="OnEraseBackground"></event>\r
                                             <property name="tooltip"></property>\r
                                             <property name="window_extra_style"></property>\r
                                             <property name="window_name"></property>\r
-                                            <property name="window_style">wxVSCROLL</property>\r
+                                            <property name="window_style"></property>\r
                                             <event name="OnChar"></event>\r
                                             <event name="OnEnterWindow"></event>\r
                                             <event name="OnEraseBackground"></event>\r
                                             <property name="tooltip"></property>\r
                                             <property name="window_extra_style"></property>\r
                                             <property name="window_name"></property>\r
-                                            <property name="window_style">wxVSCROLL</property>\r
+                                            <property name="window_style"></property>\r
                                             <event name="OnChar"></event>\r
                                             <event name="OnEnterWindow"></event>\r
                                             <event name="OnEraseBackground"></event>\r
                                             <property name="tooltip"></property>\r
                                             <property name="window_extra_style"></property>\r
                                             <property name="window_name"></property>\r
-                                            <property name="window_style">wxVSCROLL</property>\r
+                                            <property name="window_style"></property>\r
                                             <event name="OnChar"></event>\r
                                             <event name="OnEnterWindow"></event>\r
                                             <event name="OnEraseBackground"></event>\r
index acfbcd6..8f6bf38 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -314,6 +314,12 @@ string FormatMoney(int64 n, bool fPlus)
     return str;\r
 }\r
 \r
+\r
+bool ParseMoney(const string& str, int64& nRet)\r
+{\r
+    return ParseMoney(str.c_str(), nRet);\r
+}\r
+\r
 bool ParseMoney(const char* pszIn, int64& nRet)\r
 {\r
     string strWhole;\r
diff --git a/util.h b/util.h
index 75f0956..1a25c7d 100644 (file)
--- a/util.h
+++ b/util.h
@@ -133,6 +133,7 @@ void PrintException(std::exception* pex, const char* pszThread);
 void LogException(std::exception* pex, const char* pszThread);\r
 void ParseString(const string& str, char c, vector<string>& v);\r
 string FormatMoney(int64 n, bool fPlus=false);\r
+bool ParseMoney(const string& str, int64& nRet);\r
 bool ParseMoney(const char* pszIn, int64& nRet);\r
 vector<unsigned char> ParseHex(const char* psz);\r
 vector<unsigned char> ParseHex(const std::string& str);\r