mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
Driver menus: WinNative drivers, newest release per variant, scrolling menus
- WinNative-Emu/Drivers joins Banners-Turnip as a source: WN-Turnip (Android, v1.x line) and WN-Linux-Turnip (Linux, linux-v0.x line), each in its Balanced and Performance builds for every Adreno. - Each source's recent releases are read newest first and every variant is offered from the newest release carrying it. Banners-Turnip stopped publishing its A8xx Linux build after v26.3.0-20260923, so the runtime menu listed no 8xx driver at all; it now offers that last one. The refresh line names each source's newest release and any that could not be reached. - Drop-down menus are capped at the window's height and their entries scroll under the title: a driver menu with its downloads ran off the bottom of the screen, hiding the refresh line and Import.
This commit is contained in:
1 parent
d0b1686a84
commit
39f5478ea9
4 files changed
+119
-64
No files matched your search
@@ -109,7 +109,7 @@ class MainActivity : ComponentActivity() {
|
||||
/** The latest Banners-Turnip release as each driver menu offers it (see [refreshReleaseRows]). */
|
||||
private var linuxDownloads by mutableStateOf<List<com.steamdeck.launcher.ui.DownloadRow>>(emptyList())
|
||||
private var androidDownloads by mutableStateOf<List<com.steamdeck.launcher.ui.DownloadRow>>(emptyList())
|
||||
private var releaseStatus by mutableStateOf("Check for the latest Turnip")
|
||||
private var releaseStatus by mutableStateOf("Check for new drivers (Banners-Turnip, WinNative)")
|
||||
private var releaseChecking = false
|
||||
/** Asset name -> download percent, while it downloads. */
|
||||
private val releaseProgress = HashMap<String, Int>()
|
||||
@@ -737,26 +737,28 @@ class MainActivity : ComponentActivity() {
|
||||
refreshDrivers()
|
||||
}
|
||||
|
||||
/** The download entries and the refresh line, from the release the last check found. */
|
||||
/** The download entries and the refresh line, from what the last check found. */
|
||||
private fun refreshReleaseRows() {
|
||||
val release = TurnipReleases.cached(this)
|
||||
val check = TurnipReleases.cached(this)
|
||||
val lm = LinuxVulkanDriverManager(this)
|
||||
val td = TurnipDriver(this)
|
||||
fun rows(linux: Boolean) = release?.assets.orEmpty()
|
||||
fun rows(linux: Boolean) = check?.assets.orEmpty()
|
||||
.filter { it.linux == linux }
|
||||
.filter { a -> TurnipReleases.installedId(this, a) { id -> if (linux) lm.isInstalled(id) else td.isInstalled(id) } == null }
|
||||
.map { a ->
|
||||
val mb = "%.1f MB".format(a.size / 1_048_576.0)
|
||||
com.steamdeck.launcher.ui.DownloadRow(
|
||||
a.name, "Download Turnip ${release!!.tag}",
|
||||
releaseProgress[a.name]?.let { "${a.gpus} · downloading $it%" } ?: "${a.gpus} · $mb",
|
||||
a.name, "Download ${a.source} ${a.tag}",
|
||||
releaseProgress[a.name]?.let { "${a.label} · downloading $it%" } ?: "${a.label} · $mb",
|
||||
)
|
||||
}
|
||||
linuxDownloads = rows(linux = true)
|
||||
androidDownloads = rows(linux = false)
|
||||
if (!releaseChecking) releaseStatus = when (release) {
|
||||
null -> "Check for the latest Turnip"
|
||||
else -> "Latest: ${release.tag} · checked ${ago(release.checkedAt)} · tap to refresh"
|
||||
if (!releaseChecking) releaseStatus = when (check) {
|
||||
null -> "Check for new drivers (Banners-Turnip, WinNative)"
|
||||
else -> "Latest: " + check.latest.joinToString(" · ") { "${it.first} ${it.second}" } +
|
||||
(if (check.failed.isEmpty()) "" else " · ${check.failed.joinToString()} unreachable") +
|
||||
" · checked ${ago(check.checkedAt)} · tap to refresh"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,7 +776,7 @@ class MainActivity : ComponentActivity() {
|
||||
private fun checkLatestTurnip() {
|
||||
if (releaseChecking) return
|
||||
releaseChecking = true
|
||||
releaseStatus = "Checking Banners-Turnip…"
|
||||
releaseStatus = "Checking Banners-Turnip and WinNative…"
|
||||
Thread({
|
||||
val problem = try { TurnipReleases.refresh(this); null } catch (e: Exception) {
|
||||
Log.w(TAG, "latest Turnip check", e); e.message ?: "check failed"
|
||||
|
||||
Reference in new issue
Block a user