upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui.cpp30
-rw-r--r--src/headers_core.h5
2 files changed, 32 insertions, 3 deletions
diff --git a/src/gui.cpp b/src/gui.cpp
index 296d20c..2a7f350 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -11,7 +11,9 @@
11#include <ctime> 11#include <ctime>
12#include <cstdio> 12#include <cstdio>
13#include <sstream> 13#include <sstream>
14#ifndef _WIN32 14#ifdef _WIN32
15#include <shellapi.h> // ShellExecuteA, to open the website in the browser
16#else
15#include <unistd.h> 17#include <unistd.h>
16#endif 18#endif
17#include <iomanip> 19#include <iomanip>
@@ -1376,16 +1378,38 @@ static void DrawDiagnosticsDialog()
1376 ImGui::End(); 1378 ImGui::End();
1377} 1379}
1378 1380
1381static void OpenURL(const char* pszUrl)
1382{
1383#ifdef _WIN32
1384 ShellExecuteA(NULL, "open", pszUrl, NULL, NULL, SW_SHOWNORMAL);
1385#else
1386 std::string cmd = std::string("xdg-open '") + pszUrl + "' >/dev/null 2>&1 &";
1387 int r = system(cmd.c_str());
1388 (void)r;
1389#endif
1390}
1391
1379static void DrawAboutDialog() 1392static void DrawAboutDialog()
1380{ 1393{
1381 if (!g_showAbout) return; 1394 if (!g_showAbout) return;
1382 ImGui::SetNextWindowSize(ImVec2(380.0f, 170.0f), ImGuiCond_Always); 1395 ImGui::SetNextWindowSize(ImVec2(380.0f, 205.0f), ImGuiCond_Always);
1383 ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), 1396 ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(),
1384 ImGuiCond_Always, ImVec2(0.5f, 0.5f)); 1397 ImGuiCond_Always, ImVec2(0.5f, 0.5f));
1385 if (ImGui::Begin("About Bitflash", &g_showAbout, 1398 if (ImGui::Begin("About Bitflash", &g_showAbout,
1386 ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) 1399 ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse))
1387 { 1400 {
1388 ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), "Bitflash BTF v1.1.0"); 1401 ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f),
1402 "Bitflash BTF v" BITFLASH_VERSION_STRING);
1403 ImGui::Spacing();
1404 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.40f, 0.70f, 1.0f, 1.0f));
1405 ImGui::TextUnformatted("https://bitflash.network");
1406 ImGui::PopStyleColor();
1407 if (ImGui::IsItemHovered())
1408 {
1409 ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
1410 if (ImGui::IsMouseClicked(0))
1411 OpenURL("https://bitflash.network");
1412 }
1389 ImGui::Spacing(); 1413 ImGui::Spacing();
1390 ImGui::TextWrapped( 1414 ImGui::TextWrapped(
1391 "CPU-only cryptocurrency. RandomX proof of work. " 1415 "CPU-only cryptocurrency. RandomX proof of work. "
diff --git a/src/headers_core.h b/src/headers_core.h
index 6c0c602..f890c2f 100644
--- a/src/headers_core.h
+++ b/src/headers_core.h
@@ -1,6 +1,11 @@
1// Core node headers -- no GUI framework dependency. 1// Core node headers -- no GUI framework dependency.
2// Included by gui.cpp and all non-GUI source files. 2// Included by gui.cpp and all non-GUI source files.
3 3
4// The one place the human-readable release version lives -- bump it at release.
5// It is what the About dialog shows. Protocol and transaction versions elsewhere
6// (nVersion fields) are unrelated and must not be changed for a release.
7#define BITFLASH_VERSION_STRING "1.2.20"
8
4#ifdef _MSC_VER 9#ifdef _MSC_VER
5#pragma warning(disable:4786) 10#pragma warning(disable:4786)
6#endif 11#endif