diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-25 21:55:27 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-25 21:55:27 +0000 |
commit | 5eede9d4d9932969cd75a47dc0d6fd4c090f0342 (patch) | |
tree | a583b1254b26f49572fb48c52523977b75beabd2 /ui.h | |
parent | 30158c77e99a099cbdd556bacbac18b431c3870c (diff) | |
download | bitcoin-5eede9d4d9932969cd75a47dc0d6fd4c090f0342.tar.xz |
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
Diffstat (limited to 'ui.h')
-rw-r--r-- | ui.h | 49 |
1 files changed, 43 insertions, 6 deletions
@@ -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
|