upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/ui.h
diff options
context:
space:
mode:
authorVictorio Nascimento <155357371+Vic-Nas@users.noreply.github.com>2026-07-27 16:45:28 -0400
committerGitHub <noreply@github.com>2026-07-27 17:45:28 -0300
commit6ca1a1d6799474f8ca977b93ab630af7ace879c2 (patch)
treea0312ebc10fc6a56742d0e5caa85c31eb6d3eaa7 /src/ui.h
parent56df9830d5a002ff9ce3fac47e497673f8159e39 (diff)
Add Linux GUI installer via Wine (#3)
* Add Linux GUI installer via Wine * Fix launcher creation and add BTF_RELAY env var support * Pool server, Linux GUI, unified binary, README update * Root Makefile: make linux / make windows, cleaner README * Remove headless.cpp * Fix XPM color count mismatch causing toolbar image errors on Linux * XPM icons: same code on Windows and Linux, no ifdefs around image loading * Fix GTK icon crash and Linux printf format * btfrv: 10s socket timeout on relay connects * Faster peer discovery: more dials per pass, shorter backoff and sleep * Parallel btf peer connections * Fix GetMyExternalIP - was disabled, now uses modern IP echo services * Fix tunnel disconnect on idle and restore external IP detection * Filter stale Nostr descriptors * Sort peers by freshness, fresh first * Pool: add .btf Stratum listener — miners connect via rendezvous, no port forwarding needed * btf pool: self-replacing listeners, one per relay, no queuing between miners * Mining modes: solo/operator/participant — pool server on-demand, participant Stratum client * Status bar: show external IP and .btf address * README: clean rewrite, concept-first, minimal * make linux produces AppImage * make linux produces AppImage * Pool dashboard: connect instructions, tabs, share bars * Perf fixes: GetMyExternalIP threaded, btf listener counted * Perf fixes: GetMyExternalIP threaded, btf listener counted * Fix pool payouts: defer until coinbase maturity * Pool: clean mode switching, IP warning * Pool: clean mode switching * Fix gPoolRunning: remove static * AppImage: use real icon from bitcoin.ico * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Windows build: use mingw32-make * Windows build: simpler make invocation * Add deps-windows target * Windows build fixes * Windows build fixes * Windows makefile: fix obj dir * Windows: output to repo root * Windows: bundle DLLs into zip * Replace wxWidgets with ImGui+GLFW: same build on Linux and Windows * Fix %I64d that slipped back through rebase (main.h, net.h) * MinGW: add _mkdir shim for non-MSVC Windows; fix %I64d * Fix gPoolRunning extern outside ifndef _WIN32 * Remove -lboost_system: boost is header-only in this codebase * Status bar: copy buttons for IP and .btf address * Windows: add app icon via windres, strip wx stuff from rc file * Clean GUI: single Options menu item, bigger font, better spacing, cleaner options dialog; update README * GUI: embed Roboto font at 16px for clear readability on all platforms * Windows: windres depends on obj dir target * Fix balance hidden off-screen: put on own line below address bar * Windows: inline mkdir in every rule, remove dir target that confused make * Windows: move all target to top so it's the default rule * Fix pool server not starting: always start when operator selected, re-sync dialog state on open * Write debug.log to data directory (AppData/Roaming/Bitflash on Windows) * Participant miner: use wallet address as username so payouts go to wallet * Add .gitattributes to lock LF line endings, prevent CRLF drift * Refactor pool mining to btf-only transport * Persist pool settings and startup wiring * Prune stale peers and expose pool queries * Fix build regressions and add CLI mode/arg parity * Fix rpc miner stats declaration order * Centralize pool runtime extern declarations * Separate operator/participant dashboards and restore peer stats * Add live telemetry strip and clearer per-mode runtime metrics * Reduce mining dashboard clutter and remove manual pool entry * Count only authorized pool miners * Seed initial pool job on startup * Use a real share target for pool work * Switch pool accounting to round-based shares * Fix nostr pool announcer stats call sites * Fix pool stats definition order * Improve pool worker status display * Add mutex include for participant status * Replace ImClamp in dashboard layout * Clarify participant work status * Log participant status transitions * Reduce peer discovery log noise * Add participant status badge * Track participant auth acknowledgements * Log and validate pool job delivery --------- Co-authored-by: Bitflash Pool Dev <pool@bitflash>
Diffstat (limited to 'src/ui.h')
-rw-r--r--src/ui.h417
1 files changed, 0 insertions, 417 deletions
diff --git a/src/ui.h b/src/ui.h
deleted file mode 100644
index 2efeace..0000000
--- a/src/ui.h
+++ /dev/null
@@ -1,417 +0,0 @@
1// Copyright (c) 2009 Satoshi Nakamoto
2// Distributed under the MIT/X11 software license, see the accompanying
3// file license.txt or http://www.opensource.org/licenses/mit-license.php.
4
5
6
7
8DECLARE_EVENT_TYPE(wxEVT_CROSSTHREADCALL, -1)
9DECLARE_EVENT_TYPE(wxEVT_REPLY1, -1)
10DECLARE_EVENT_TYPE(wxEVT_REPLY2, -1)
11DECLARE_EVENT_TYPE(wxEVT_REPLY3, -1)
12DECLARE_EVENT_TYPE(wxEVT_TABLEADDED, -1)
13DECLARE_EVENT_TYPE(wxEVT_TABLEUPDATED, -1)
14DECLARE_EVENT_TYPE(wxEVT_TABLEDELETED, -1)
15
16enum
17{
18 UICALL_ADDORDER = 1,
19 UICALL_UPDATEORDER,
20};
21
22
23
24extern void HandleCtrlA(wxKeyEvent& event);
25extern string DateTimeStr(int64 nTime);
26extern string FormatTxStatus(const CWalletTx& wtx);
27extern void CrossThreadCall(int nID, void* pdata);
28extern void MainFrameRepaint();
29
30
31
32
33
34
35class CMainFrame : public CMainFrameBase
36{
37protected:
38 // Event handlers
39 void OnClose(wxCloseEvent& event);
40 void OnMouseEvents(wxMouseEvent& event);
41 void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
42 void OnIdle(wxIdleEvent& event);
43 void OnPaint(wxPaintEvent& event);
44 void OnPaintListCtrl(wxPaintEvent& event);
45 void OnMenuFileExit(wxCommandEvent& event);
46 void OnMenuOptionsGenerate(wxCommandEvent& event);
47 void OnMenuOptionsOptions(wxCommandEvent& event);
48 void OnMenuHelpAbout(wxCommandEvent& event);
49 void OnButtonSend(wxCommandEvent& event);
50 void OnButtonAddressBook(wxCommandEvent& event);
51 void OnSetFocusAddress(wxFocusEvent& event);
52 void OnMouseEventsAddress(wxMouseEvent& event);
53 void OnButtonCopy(wxCommandEvent& event);
54 void OnButtonChange(wxCommandEvent& event);
55 void OnListColBeginDrag(wxListEvent& event);
56 void OnListItemActivatedAllTransactions(wxListEvent& event);
57 void OnListItemActivatedProductsSent(wxListEvent& event);
58 void OnListItemActivatedOrdersSent(wxListEvent& event);
59 void OnListItemActivatedOrdersReceived(wxListEvent& event);
60
61public:
62 /** Constructor */
63 CMainFrame(wxWindow* parent);
64 ~CMainFrame();
65
66 // Custom
67 bool fRefreshListCtrl;
68 bool fRefreshListCtrlRunning;
69 bool fOnSetFocusAddress;
70 CBlockIndex* pindexBestLast;
71 set<uint256> setUnmaturedDisplayed;
72
73 void OnCrossThreadCall(wxCommandEvent& event);
74 void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
75 void InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1);
76 void RefreshListCtrl();
77 void RefreshStatus();
78};
79
80
81
82
83class CTxDetailsDialog : public CTxDetailsDialogBase
84{
85protected:
86 // Event handlers
87 void OnButtonOK(wxCommandEvent& event);
88
89public:
90 /** Constructor */
91 CTxDetailsDialog(wxWindow* parent, CWalletTx wtx);
92
93 // State
94 CWalletTx wtx;
95};
96
97
98
99class COptionsDialog : public COptionsDialogBase
100{
101protected:
102 // Event handlers
103 void OnKillFocusTransactionFee(wxFocusEvent& event);
104 void OnButtonOK(wxCommandEvent& event);
105 void OnButtonCancel(wxCommandEvent& event);
106
107public:
108 /** Constructor */
109 COptionsDialog(wxWindow* parent);
110};
111
112
113
114class CAboutDialog : public CAboutDialogBase
115{
116protected:
117 // Event handlers
118 void OnButtonOK(wxCommandEvent& event);
119
120public:
121 /** Constructor */
122 CAboutDialog(wxWindow* parent);
123};
124
125
126
127class CSendDialog : public CSendDialogBase
128{
129protected:
130 // Event handlers
131 void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
132 void OnTextAddress(wxCommandEvent& event);
133 void OnKillFocusAmount(wxFocusEvent& event);
134 void OnButtonAddressBook(wxCommandEvent& event);
135 void OnButtonPaste(wxCommandEvent& event);
136 void OnButtonSend(wxCommandEvent& event);
137 void OnButtonCancel(wxCommandEvent& event);
138
139public:
140 /** Constructor */
141 CSendDialog(wxWindow* parent, const wxString& strAddress="");
142};
143
144
145
146class CSendingDialog : public CSendingDialogBase
147{
148public:
149 // Event handlers
150 void OnClose(wxCloseEvent& event);
151 void OnButtonOK(wxCommandEvent& event);
152 void OnButtonCancel(wxCommandEvent& event);
153 void OnPaint(wxPaintEvent& event);
154
155public:
156 /** Constructor */
157 CSendingDialog(wxWindow* parent, const CAddress& addrIn, int64 nPriceIn, const CWalletTx& wtxIn);
158 ~CSendingDialog();
159
160 // State
161 CAddress addr;
162 int64 nPrice;
163 CWalletTx wtx;
164 wxDateTime start;
165 string strStatus;
166 bool fCanCancel;
167 bool fAbort;
168 bool fSuccess;
169 bool fUIDone;
170 bool fWorkDone;
171
172 void Close();
173 void Repaint();
174 bool Status();
175 bool Status(const string& str);
176 bool Error(const string& str);
177 void StartTransfer();
178 void OnReply2(CDataStream& vRecv);
179 void OnReply3(CDataStream& vRecv);
180};
181
182void SendingDialogStartTransfer(void* parg);
183void SendingDialogOnReply2(void* parg, CDataStream& vRecv);
184void SendingDialogOnReply3(void* parg, CDataStream& vRecv);
185
186
187
188class CYourAddressDialog : public CYourAddressDialogBase
189{
190protected:
191 // Event handlers
192 void OnListEndLabelEdit(wxListEvent& event);
193 void OnListItemSelected(wxListEvent& event);
194 void OnListItemActivated(wxListEvent& event);
195 void OnButtonRename(wxCommandEvent& event);
196 void OnButtonNew(wxCommandEvent& event);
197 void OnButtonCopy(wxCommandEvent& event);
198 void OnButtonOK(wxCommandEvent& event);
199 void OnButtonCancel(wxCommandEvent& event);
200 void OnClose(wxCloseEvent& event);
201
202public:
203 /** Constructor */
204 CYourAddressDialog(wxWindow* parent);
205 CYourAddressDialog(wxWindow* parent, const string& strInitSelected);
206
207 // Custom
208 wxString GetAddress();
209};
210
211
212
213class CAddressBookDialog : public CAddressBookDialogBase
214{
215protected:
216 // Event handlers
217 void OnListEndLabelEdit(wxListEvent& event);
218 void OnListItemSelected(wxListEvent& event);
219 void OnListItemActivated(wxListEvent& event);
220 void OnButtonEdit(wxCommandEvent& event);
221 void OnButtonDelete(wxCommandEvent& event);
222 void OnButtonNew(wxCommandEvent& event);
223 void OnButtonCopy(wxCommandEvent& event);
224 void OnButtonOK(wxCommandEvent& event);
225 void OnButtonCancel(wxCommandEvent& event);
226 void OnClose(wxCloseEvent& event);
227
228public:
229 /** Constructor */
230 CAddressBookDialog(wxWindow* parent, const wxString& strInitSelected, bool fSendingIn);
231
232 // Custom
233 bool fSending;
234 wxString GetAddress();
235};
236
237
238
239class CProductsDialog : public CProductsDialogBase
240{
241protected:
242 // Event handlers
243 void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
244 void OnCombobox(wxCommandEvent& event);
245 void OnButtonSearch(wxCommandEvent& event);
246 void OnListItemActivated(wxListEvent& event);
247
248public:
249 /** Constructor */
250 CProductsDialog(wxWindow* parent);
251
252 // Custom
253 vector<CProduct> m_vProduct;
254};
255
256
257
258class CEditProductDialog : public CEditProductDialogBase
259{
260protected:
261 // Event handlers
262 void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
263 void OnButtonDel0(wxCommandEvent& event);
264 void OnButtonDel1(wxCommandEvent& event);
265 void OnButtonDel2(wxCommandEvent& event);
266 void OnButtonDel3(wxCommandEvent& event);
267 void OnButtonDel4(wxCommandEvent& event);
268 void OnButtonDel5(wxCommandEvent& event);
269 void OnButtonDel6(wxCommandEvent& event);
270 void OnButtonDel7(wxCommandEvent& event);
271 void OnButtonDel8(wxCommandEvent& event);
272 void OnButtonDel9(wxCommandEvent& event);
273 void OnButtonDel10(wxCommandEvent& event);
274 void OnButtonDel11(wxCommandEvent& event);
275 void OnButtonDel12(wxCommandEvent& event);
276 void OnButtonDel13(wxCommandEvent& event);
277 void OnButtonDel14(wxCommandEvent& event);
278 void OnButtonDel15(wxCommandEvent& event);
279 void OnButtonDel16(wxCommandEvent& event);
280 void OnButtonDel17(wxCommandEvent& event);
281 void OnButtonDel18(wxCommandEvent& event);
282 void OnButtonDel19(wxCommandEvent& event);
283 void OnButtonAddField(wxCommandEvent& event);
284 void OnButtonSend(wxCommandEvent& event);
285 void OnButtonPreview(wxCommandEvent& event);
286 void OnButtonCancel(wxCommandEvent& event);
287
288public:
289 /** Constructor */
290 CEditProductDialog(wxWindow* parent);
291
292 // Custom
293 enum { FIELDS_MAX = 20 };
294 wxTextCtrl* m_textCtrlLabel[FIELDS_MAX];
295 wxTextCtrl* m_textCtrlField[FIELDS_MAX];
296 wxButton* m_buttonDel[FIELDS_MAX];
297
298 void LayoutAll();
299 void ShowLine(int i, bool fShow=true);
300 void OnButtonDel(wxCommandEvent& event, int n);
301 void SetProduct(const CProduct& productIn);
302 void GetProduct(CProduct& product);
303
304};
305
306
307
308class CViewProductDialog : public CViewProductDialogBase
309{
310protected:
311 // Event handlers
312 void OnButtonSubmitForm(wxCommandEvent& event);
313 void OnButtonCancelForm(wxCommandEvent& event);
314 void OnButtonBack(wxCommandEvent& event);
315 void OnButtonNext(wxCommandEvent& event);
316 void OnButtonCancel(wxCommandEvent& event);
317
318public:
319 /** Constructor */
320 CViewProductDialog(wxWindow* parent, const CProduct& productIn);
321 ~CViewProductDialog();
322
323 // Custom
324 CProduct product;
325 enum { FIELDS_MAX = 20 };
326 wxStaticText* m_staticTextLabel[FIELDS_MAX];
327 wxTextCtrl* m_textCtrlField[FIELDS_MAX];
328 wxChoice* m_choiceField[FIELDS_MAX];
329
330 void GetOrder(CWalletTx& order);
331 void UpdateProductDisplay(bool fDetails);
332 void OnReply1(wxCommandEvent& event);
333};
334
335
336
337class CViewOrderDialog : public CViewOrderDialogBase
338{
339protected:
340 // Event handlers
341 void OnButtonOK(wxCommandEvent& event);
342
343public:
344 /** Constructor */
345 CViewOrderDialog(wxWindow* parent, CWalletTx order, bool fReceived);
346
347 // Custom
348 bool fReceived;
349};
350
351
352
353class CEditReviewDialog : public CEditReviewDialogBase
354{
355protected:
356 // Event handlers
357 void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
358 void OnButtonSubmit(wxCommandEvent& event);
359 void OnButtonCancel(wxCommandEvent& event);
360
361public:
362 /** Constructor */
363 CEditReviewDialog(wxWindow* parent);
364
365 // Custom
366 void GetReview(CReview& review);
367};
368
369
370
371class CGetTextFromUserDialog : public CGetTextFromUserDialogBase
372{
373protected:
374 // Event handlers
375 void OnButtonOK(wxCommandEvent& event) { EndModal(true); }
376 void OnButtonCancel(wxCommandEvent& event) { EndModal(false); }
377 void OnClose(wxCloseEvent& event) { EndModal(false); }
378
379 void OnKeyDown(wxKeyEvent& event)
380 {
381 if (event.GetKeyCode() == '\r' || event.GetKeyCode() == WXK_NUMPAD_ENTER)
382 EndModal(true);
383 else
384 HandleCtrlA(event);
385 }
386
387public:
388 /** Constructor */
389 CGetTextFromUserDialog(wxWindow* parent,
390 const string& strCaption,
391 const string& strMessage1,
392 const string& strValue1="",
393 const string& strMessage2="",
394 const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption)
395 {
396 m_staticTextMessage1->SetLabel(strMessage1);
397 m_textCtrl1->SetValue(strValue1);
398 if (!strMessage2.empty())
399 {
400 m_staticTextMessage2->Show(true);
401 m_staticTextMessage2->SetLabel(strMessage2);
402 m_textCtrl2->Show(true);
403 m_textCtrl2->SetValue(strValue2);
404 SetSize(wxDefaultCoord, 180);
405 }
406 }
407
408 // Custom
409 string GetValue() { return (string)m_textCtrl1->GetValue(); }
410 string GetValue1() { return (string)m_textCtrl1->GetValue(); }
411 string GetValue2() { return (string)m_textCtrl2->GetValue(); }
412};
413
414
415
416
417