feat(qt): Settings > Storage — every on-disk cache in one section

Offline downloads, the artwork cache, the lyrics cache, the Plex mirror and
the playback cache (memory profile + storage folder) move to a new Storage
section, each row keeping the bridge verb it had. Offline keeps the mode
rows, Playback keeps the behaviour rows, Plex keeps Disconnect.

cc
This commit is contained in:
vicrodh committed 2026-09-13 09:09:30 -06:00
1 parent 903952cacb
commit 29710342a2
15 files changed
+551 -368

No files matched your search

+3 -76
View File
@@ -9,12 +9,10 @@
// snapshot).
//
// "Check now" IS shipped (`offline-recheck`); so is the live tri-state status
// line (QbzSession.offlineMode / captivePortal) and the lyrics-cache row.
// line (QbzSession.offlineMode / captivePortal).
//
// Still missing: the whole OFFLINE CACHE group (Open manager / Open folder /
// Clear all). What blocks it is the MANAGER VIEW, which has no Qt counterpart
// yet — not the engine: `offline_cache_qt.rs` already runs the downloads from
// the album page and the track row.
// The on-disk half (offline downloads, artwork, lyrics) lives in Settings >
// Storage (StorageSettings.qml) since 2026-09-13, next to every other cache.
import QtQuick
import com.blitzfc.qbz
@@ -100,75 +98,4 @@ Column {
onClicked: QbzBridge.settingsString("offline-recheck", "")
}
}
SettingsSpacer { }
SettingsDivider { }
SettingsSpacer { }
// ========================== OFFLINE CACHE ============================
// The downloads half: the manager view plus the two whole-cache actions.
// All three ride QbzOffline, the same bridge the manager view uses —
// "Open folder" and "Clear all" are the manager's own stats-bar buttons,
// offered here too exactly as the reference offers them
// (OfflineSettings.slint:135-167).
GroupHeader { kioskHost: root.kioskHost; text: QbzSession.tr("OFFLINE CACHE", QbzSession.trRev) }
SettingRow { kioskHost: root.kioskHost;
label: QbzSession.tr("Manage offline cache", QbzSession.trRev)
description: QbzSession.tr("Browse and manage your downloaded tracks and albums.", QbzSession.trRev)
SettingsButton { kioskHost: root.kioskHost;
text: QbzSession.tr("Open manager", QbzSession.trRev)
onClicked: QbzOffline.openManager()
}
}
SettingRow { kioskHost: root.kioskHost;
label: QbzSession.tr("Cache folder", QbzSession.trRev)
description: QbzSession.tr("Open the folder where offline tracks are stored on disk.", QbzSession.trRev)
SettingsButton { kioskHost: root.kioskHost;
text: QbzSession.tr("Open folder", QbzSession.trRev)
onClicked: QbzOffline.openFolder()
}
}
SettingRow { kioskHost: root.kioskHost;
label: QbzSession.tr("Clear cache", QbzSession.trRev)
description: QbzSession.tr("Frees up cached data. Your downloaded albums are kept — remove those from the offline manager above.", QbzSession.trRev)
SettingsButton { kioskHost: root.kioskHost;
danger: true
text: QbzSession.tr("Clear all", QbzSession.trRev)
// ONE prompt before the purge. The reference fires straight from
// the button; this port confirms every destructive settings row,
// and undoing this one means re-downloading the whole cache.
onClicked: {
if (!root.confirmHost) {
QbzOffline.clearAll()
return
}
root.confirmHost.ask(
QbzSession.tr("Clear cache", QbzSession.trRev),
QbzSession.tr("Frees up cached data. Your downloaded albums are kept — remove those from the offline manager above.", QbzSession.trRev),
QbzSession.tr("Clear all", QbzSession.trRev),
function () { QbzOffline.clearAll() })
}
}
}
SettingsSpacer { }
SettingsDivider { }
SettingsSpacer { }
// ============================= LYRICS ================================
GroupHeader { kioskHost: root.kioskHost; text: QbzSession.tr("LYRICS", QbzSession.trRev) }
SettingRow { kioskHost: root.kioskHost;
label: QbzSession.tr("Clear lyrics cache", QbzSession.trRev)
// "{} entries using {}" — the real per-user lyrics.db stats.
description: root.off.lyricsLoaded === true
? QbzSession.tr("{} entries using {}", QbzSession.trRev)
.replace("{}", root.off.lyricsEntries)
.replace("{}", root.off.lyricsSize)
: ""
SettingsButton { kioskHost: root.kioskHost;
danger: true
text: QbzSession.tr("Clear", QbzSession.trRev)
onClicked: QbzBridge.settingsString("lyrics-cache-clear", "")
}
}
}