From c2430126d75318508836a24f90d3524320190465 Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Thu, 25 Feb 2010 21:55:27 +0000 Subject: GUI-less build target bitcoind that links to wxBase and shouldn't need GTK, split init and shutdown from ui.cpp into init.cpp, support wxUSE_GUI=0 -- version 0.2.7 git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@71 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- ui.h | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) (limited to 'ui.h') diff --git a/ui.h b/ui.h index acabd5514a..e944eb9339 100644 --- a/ui.h +++ b/ui.h @@ -4,26 +4,61 @@ DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1) +#if wxUSE_GUI +static const bool fGUI=true; +#else +static const bool fGUI=false; +#endif -extern map mapArgs; +inline int MyMessageBox(const wxString& message, const wxString& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1) +{ +#if wxUSE_GUI + 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()); + return wxOK; +} +#define wxMessageBox MyMessageBox -// Settings -extern int fMinimizeToTray; -extern int fMinimizeOnClose; void HandleCtrlA(wxKeyEvent& event); string FormatTxStatus(const CWalletTx& wtx); void UIThreadCall(boost::function0); -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); bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent); +void MainFrameRepaint(); +void CreateMainWindow(); + +#if !wxUSE_GUI +inline int ThreadSafeMessageBox(const string& message, const string& caption, int style, wxWindow* parent, int x, int y) +{ + return MyMessageBox(message, caption, style, parent, x, y); +} + +inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent) +{ + return true; +} + +inline void MainFrameRepaint() +{ +} + +inline void CreateMainWindow() +{ +} +#else // wxUSE_GUI + + + class CMainFrame : public CMainFrameBase @@ -331,3 +366,5 @@ public: DECLARE_EVENT_TABLE() }; + +#endif // wxUSE_GUI -- cgit v1.2.3