aboutsummaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-02-25 21:55:27 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-02-25 21:55:27 +0000
commitc2430126d75318508836a24f90d3524320190465 (patch)
treea583b1254b26f49572fb48c52523977b75beabd2 /ui.h
parentcb420a1dfc23d3c11c5281ed8f7ae003c2f61594 (diff)
downloadbitcoin-c2430126d75318508836a24f90d3524320190465.tar.xz
GUI-less build target bitcoind that links to wxBase and shouldn't need GTK,v0.2.7
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
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h49
1 files changed, 43 insertions, 6 deletions
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<string, string> 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>);
-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