Add mine-when-idle, default banlist, and console parsing improvements

Mine-when-idle:
- Auto-start/stop mining based on system idle time detection
- Platform::getSystemIdleSeconds() via XScreenSaver (Linux) / GetLastInputInfo (Win)
- Settings: mine_when_idle toggle + configurable delay (30s–10m)
- Settings page UI with checkbox and delay combo

Console tab:
- Shell-like argument parsing with quote and JSON bracket support
- Pass JSON objects/arrays directly as RPC params
- Fix selection indices when lines are evicted from buffer

Connection & status bar:
- Reduce RPC connect timeout to 1s for localhost fast-fail
- Fast retry timer on daemon startup and external daemon detection
- Show pool mining hashrate in status bar; sidebar badge reflects pool state

UI polish:
- Add logo to About card in settings; expose logo dimensions on App
- Header title offset-y support; adjust content-area margins
- Fix banned peers row cursor position (rawRowPosB.x)

Branding:
- Update copyright to "DragonX Developers" in RC and About section
- Replace logo/icon assets with updated versions

Misc:
- setup.sh: checkout dragonx branch before pulling
- Remove stale prebuilt-binaries/xmrig/.gitkeep
This commit is contained in:
2026-03-07 13:42:31 -06:00
parent b3a0ce29ed
commit f416ff3d09
22 changed files with 431 additions and 41 deletions

View File

@@ -292,6 +292,9 @@ void App::update()
checkAutoLock();
}
// Mine-when-idle check (runs every frame, internally rate-limited by idle detection)
checkIdleMining();
// P8: Dedup rebuildAddressList — only rebuild once per frame
if (address_list_dirty_) {
address_list_dirty_ = false;
@@ -715,13 +718,14 @@ void App::render()
const float brandPadX = hdrF("pad-x", mainPadX / hdp);
const float brandPadY = hdrF("pad-y", 8.0f);
const float logoGap = hdrF("logo-gap", 8.0f);
const float brandOffY = hdrF("offset-y", 0.0f);
const float hdrOpacity = (hdrElem.opacity >= 0.0f) ? hdrElem.opacity : 0.7f;
// Logo
float logoSize = mainPadTop - brandPadY * 2.0f; // fit within header
if (logoSize < 16.0f * hdp) logoSize = 16.0f * hdp;
float logoX = winPos.x + brandPadX;
float logoY = winPos.y + brandPadY;
float logoY = winPos.y + brandPadY + brandOffY;
if (logo_tex_ != 0) {
float aspect = (logo_h_ > 0) ? (float)logo_w_ / (float)logo_h_ : 1.0f;
float logoW = logoSize * aspect;
@@ -740,7 +744,7 @@ void App::render()
? hdrElem.size * hdp
: titleFont->LegacySize;
if (titleFont) {
float textY = winPos.y + (mainPadTop - titleFontSize) * 0.5f;
float textY = winPos.y + (mainPadTop - titleFontSize) * 0.5f + brandOffY;
ImU32 textCol = ui::material::OnSurface();
// Apply header text opacity
int a = (int)((float)((textCol >> 24) & 0xFF) * hdrOpacity);
@@ -803,7 +807,7 @@ void App::render()
// Build sidebar status for badges + footer
ui::SidebarStatus sbStatus;
sbStatus.peerCount = static_cast<int>(state_.peers.size());
sbStatus.miningActive = state_.mining.generate;
sbStatus.miningActive = state_.mining.generate || state_.pool_mining.xmrig_running;
// Load logo texture lazily on first frame (or after theme change)
// Also reload when dark↔light mode changes so the correct variant shows
@@ -1370,8 +1374,9 @@ void App::renderStatusBar()
}
}
// Mining indicator (if mining)
if (state_.mining.generate) {
// Mining indicator (if mining — solo or pool)
const bool anyMining = state_.mining.generate || state_.pool_mining.xmrig_running;
if (anyMining) {
ImGui::SameLine(0, sbSectionGap);
ImGui::TextDisabled("|");
ImGui::SameLine(0, sbSeparatorGap);
@@ -1379,8 +1384,11 @@ void App::renderStatusBar()
ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), ICON_MD_CONSTRUCTION);
ImGui::PopFont();
ImGui::SameLine(0, sbIconTextGap);
double displayHashrate = state_.pool_mining.xmrig_running
? state_.pool_mining.hashrate_10s
: state_.mining.localHashrate;
ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%.1f H/s",
state_.mining.localHashrate);
displayHashrate);
}
// Decrypt-import background task indicator