X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fui.h;h=1784af77b3f16982465660971cae50c5812279b6;hb=ee1d6e4ed0a931defc6f6273cc67a0a3e980940f;hp=aff1f1e0eace13d6545d91bdf9bfa17ca57f2fdc;hpb=b17be7e14b4a62b7935c75fe7e7645e736fd68d2;p=novacoin.git diff --git a/src/ui.h b/src/ui.h index aff1f1e..1784af7 100644 --- a/src/ui.h +++ b/src/ui.h @@ -1,6 +1,12 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. +#ifndef BITCOIN_UI_H +#define BITCOIN_UI_H + +#include +#include "wallet.h" DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1) @@ -12,13 +18,15 @@ extern wxLocale g_locale; void HandleCtrlA(wxKeyEvent& event); void UIThreadCall(boost::function0); -int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); -bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent); -void CalledSetStatusBar(const string& strText, int nField); +int ThreadSafeMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); +bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent); +void CalledSetStatusBar(const std::string& strText, int nField); void MainFrameRepaint(); void CreateMainWindow(); void SetStartOnSystemStartup(bool fAutoStart); - +inline void InitMessage(const std::string &message) +{ +} @@ -28,8 +36,8 @@ inline int MyMessageBox(const wxString& message, const wxString& caption="Messag if (!fDaemon) return wxMessageBox(message, caption, style, parent, x, y); #endif - printf("wxMessageBox %s: %s\n", string(caption).c_str(), string(message).c_str()); - fprintf(stderr, "%s: %s\n", string(caption).c_str(), string(message).c_str()); + printf("wxMessageBox %s: %s\n", std::string(caption).c_str(), std::string(message).c_str()); + fprintf(stderr, "%s: %s\n", std::string(caption).c_str(), std::string(message).c_str()); return wxOK; } #define wxMessageBox MyMessageBox @@ -54,6 +62,8 @@ protected: void OnMenuFileExit(wxCommandEvent& event); void OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event); void OnMenuOptionsChangeYourAddress(wxCommandEvent& event); + void OnMenuOptionsEncryptWallet(wxCommandEvent& event); + void OnMenuOptionsChangeWalletPassphrase(wxCommandEvent& event); void OnMenuOptionsOptions(wxCommandEvent& event); void OnMenuHelpAbout(wxCommandEvent& event); void OnButtonSend(wxCommandEvent& event); @@ -93,8 +103,8 @@ public: bool fRefresh; void OnUIThreadCall(wxCommandEvent& event); - int GetSortIndex(const string& strSort); - void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5); + int GetSortIndex(const std::string& strSort); + void InsertLine(bool fNew, int nIndex, uint256 hashKey, std::string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5); bool DeleteLine(uint256 hashKey); bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1); void RefreshListCtrl(); @@ -176,8 +186,8 @@ public: // Custom bool fEnabledPrev; - string strFromSave; - string strMessageSave; + std::string strFromSave; + std::string strMessageSave; }; @@ -211,8 +221,8 @@ public: void Close(); void Repaint(); bool Status(); - bool Status(const string& str); - bool Error(const string& str); + bool Status(const std::string& str); + bool Error(const std::string& str); void StartTransfer(); void OnReply2(CDataStream& vRecv); void OnReply3(CDataStream& vRecv); @@ -257,7 +267,7 @@ public: wxString GetSelectedAddress(); wxString GetSelectedSendingAddress(); wxString GetSelectedReceivingAddress(); - bool CheckIfMine(const string& strAddress, const string& strTitle); + bool CheckIfMine(const std::string& strAddress, const std::string& strTitle); }; @@ -281,11 +291,11 @@ protected: public: /** Constructor */ CGetTextFromUserDialog(wxWindow* parent, - const string& strCaption, - const string& strMessage1, - const string& strValue1="", - const string& strMessage2="", - const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption) + const std::string& strCaption, + const std::string& strMessage1, + const std::string& strValue1="", + const std::string& strMessage2="", + const std::string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption) { int x = GetSize().GetWidth(); int y = GetSize().GetHeight(); @@ -308,9 +318,9 @@ public: } // Custom - string GetValue() { return (string)m_textCtrl1->GetValue(); } - string GetValue1() { return (string)m_textCtrl1->GetValue(); } - string GetValue2() { return (string)m_textCtrl2->GetValue(); } + std::string GetValue() { return (std::string)m_textCtrl1->GetValue(); } + std::string GetValue1() { return (std::string)m_textCtrl1->GetValue(); } + std::string GetValue2() { return (std::string)m_textCtrl2->GetValue(); } }; @@ -341,3 +351,5 @@ public: DECLARE_EVENT_TABLE() }; + +#endif