feat(mining): persistent payout error, solo-address explainer, i18n cleanup
- The pool payout-address rule is no longer hover-only: an invalid payout
address now outlines the field in red and shows a short reason below it (a row
is reserved so it doesn't overlap the card beneath). The longer tooltip stays.
- The solo "Mining Addr" row gains a hover explainer and a "None yet" empty-state
(with a tooltip pointing to Receive → New mining address) instead of a blank.
- Replaced hardcoded English in the earnings/stats cards ("(%d txn)", uptime
"N/A"/"%lldm %llds"/"%lldh %lldm") with TR() keys.
Also carries the chat-export confirm strings used by the next commit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -191,18 +191,18 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
|
||||
};
|
||||
|
||||
snprintf(valBuf, sizeof(valBuf), "+%.4f", minedToday);
|
||||
snprintf(subBuf2, sizeof(subBuf2), "(%d txn)", minedTodayCount);
|
||||
snprintf(subBuf2, sizeof(subBuf2), TR("mining_txn_count"), minedTodayCount);
|
||||
char todayVal[64], todaySub[64];
|
||||
strncpy(todayVal, valBuf, sizeof(todayVal));
|
||||
strncpy(todaySub, subBuf2, sizeof(todaySub));
|
||||
|
||||
char yesterdayVal[64], yesterdaySub[64];
|
||||
snprintf(yesterdayVal, sizeof(yesterdayVal), "+%.4f", minedYesterday);
|
||||
snprintf(yesterdaySub, sizeof(yesterdaySub), "(%d txn)", minedYesterdayCount);
|
||||
snprintf(yesterdaySub, sizeof(yesterdaySub), TR("mining_txn_count"), minedYesterdayCount);
|
||||
|
||||
char allVal[64], allSub[64];
|
||||
snprintf(allVal, sizeof(allVal), "+%.4f", minedAllTime);
|
||||
snprintf(allSub, sizeof(allSub), "(%d txn)", minedAllTimeCount);
|
||||
snprintf(allSub, sizeof(allSub), TR("mining_txn_count"), minedAllTimeCount);
|
||||
|
||||
char estVal[64];
|
||||
if (estActive)
|
||||
@@ -324,6 +324,11 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
|
||||
|
||||
// -- Mining Address --
|
||||
dl->AddText(capFont, capFont->LegacySize, ImVec2(col3X, cy), OnSurfaceMedium(), TR("mining_mining_addr"));
|
||||
{
|
||||
ImVec2 lblSz = capFont->CalcTextSizeA(capFont->LegacySize, 10000, 0, TR("mining_mining_addr"));
|
||||
if (material::IsRectHovered(ImVec2(col3X, cy), ImVec2(col3X + lblSz.x, cy + lblSz.y)))
|
||||
material::Tooltip("%s", TR("mining_addr_explainer"));
|
||||
}
|
||||
std::string mining_address = "";
|
||||
for (const auto& addr : state.addresses) {
|
||||
if (addr.type == "transparent" && !addr.address.empty()) {
|
||||
@@ -351,6 +356,12 @@ void RenderMiningEarnings(App* app, const WalletState& state, const MiningInfo&
|
||||
ImVec2(Layout::spacingMd(), 4 * dp))) {
|
||||
Notifications::instance().info(TR("mining_address_copied"));
|
||||
}
|
||||
} else {
|
||||
// No mining (transparent) address yet — explain where rewards go instead of a blank.
|
||||
dl->AddText(capFont, capFont->LegacySize, ImVec2(col3X + valOffX, cy), OnSurfaceMedium(), TR("mining_addr_none"));
|
||||
ImVec2 emSz = capFont->CalcTextSizeA(capFont->LegacySize, 10000, 0, TR("mining_addr_none"));
|
||||
if (material::IsRectHovered(ImVec2(col3X + valOffX, cy), ImVec2(col3X + valOffX + emSz.x, cy + emSz.y)))
|
||||
material::Tooltip("%s", TR("mining_addr_none_tip"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user