feat(market): persist chart range + style across sessions

The chart interval (Live/1H/1D/1W/1M) and the line/candle style were
session-only statics. Persist both like the selected exchange/pair: new
chart_interval / chart_style settings (defaults 1M / candlestick),
loaded into the market view on first show and saved on each interval
click / style toggle.

Verified: writing chart_interval=2, chart_style=0 to settings.json and
launching restores them (not reset to defaults) and re-saves them intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 12:05:36 -05:00
parent 76708e9191
commit e82514f46a
3 changed files with 20 additions and 1 deletions

View File

@@ -370,6 +370,10 @@ public:
void setSelectedExchange(const std::string& v) { selected_exchange_ = v; }
std::string getSelectedPair() const { return selected_pair_; }
void setSelectedPair(const std::string& v) { selected_pair_ = v; }
int getChartInterval() const { return chart_interval_; } // Market chart range 0=Live..4=1M
void setChartInterval(int v) { chart_interval_ = v; }
int getChartStyle() const { return chart_style_; } // 0 = line, 1 = candlestick
void setChartStyle(int v) { chart_style_ = v; }
// Pool mining
std::string getPoolUrl() const { return pool_url_; }
@@ -524,6 +528,8 @@ private:
bool reduce_motion_ = false;
std::string selected_exchange_ = "Nonkyc.io";
std::string selected_pair_ = "DRGX/USDT";
int chart_interval_ = 4; // Market chart range (0=Live 1=1H 2=1D 3=1W 4=1M)
int chart_style_ = 1; // Market chart style (0=line, 1=candlestick)
// Pool mining
std::string pool_url_ = "pool.dragonx.is:3433";