mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
File manager: the Linux system's root under Storage
A "Linux system" entry in the file manager's Storage list (the rail and the drive menu) opens the root of the Linux system the sessions run in - the app's files/linuxfs, the desktop's / - so its files can be browsed, copied in and out without the desktop. Shown once the runtime is installed; Back stops at that root like a drive's, and the drive label reads Linux system anywhere under it. The label is translated in all nine languages.
This commit is contained in:
1 parent
2a9cb977cf
commit
a84e9cdc08
11 files changed
+30
No files matched your search
@@ -99,5 +99,10 @@ fun describeLocation(file: File): FavLocation {
|
||||
}
|
||||
}
|
||||
|
||||
// The Linux system's root (the app's files/linuxfs, the sessions' /) and anything under it.
|
||||
if (Regex("/files/linuxfs(/|$)").containsMatchIn(abs)) {
|
||||
return FavLocation(FavStorage.OTHER, R.string.fm_drive_linux, abs)
|
||||
}
|
||||
|
||||
return FavLocation(FavStorage.OTHER, R.string.fm_drive_storage, abs)
|
||||
}
|
||||
@@ -42,6 +42,7 @@ import androidx.compose.material.icons.filled.ViewList
|
||||
import androidx.compose.material.icons.filled.StarBorder
|
||||
import androidx.compose.material.icons.filled.Storage
|
||||
import androidx.compose.material.icons.filled.Smartphone
|
||||
import androidx.compose.material.icons.filled.Terminal
|
||||
import androidx.compose.material.icons.filled.Download
|
||||
import androidx.compose.material.icons.filled.Description
|
||||
import androidx.compose.material.icons.filled.Image
|
||||
@@ -430,6 +431,9 @@ fun FileManagerScreen(
|
||||
onDispose { lifecycleOwner.lifecycle.removeObserver(observer) }
|
||||
}
|
||||
val drives = remember(storageTick) { StorageRoots.list(context) }
|
||||
val linuxRoot = remember(storageTick) {
|
||||
com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context).takeIf { File(it, "usr").isDirectory }
|
||||
}
|
||||
|
||||
// ── Dialogs ──
|
||||
|
||||
@@ -690,6 +694,16 @@ fun FileManagerScreen(
|
||||
},
|
||||
)
|
||||
}
|
||||
linuxRoot?.let { root ->
|
||||
MenuItemDivider()
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.fm_drive_linux)) },
|
||||
leadingIcon = {
|
||||
Icon(Icons.Filled.Terminal, null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(18.dp))
|
||||
},
|
||||
onClick = { showDriveMenu = false; openDrive(root) },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -998,6 +1012,8 @@ fun FileManagerScreen(
|
||||
showFavorites = false; if (d.readable) openDrive(d.dir)
|
||||
})
|
||||
}
|
||||
// The Linux system the sessions run in: its own / (the desktop's root), once installed.
|
||||
linuxRoot?.let { add(locItem(stringResource(R.string.fm_drive_linux), Icons.Filled.Terminal, it)) }
|
||||
}
|
||||
val quickItems = buildList {
|
||||
File("/storage/emulated/0/Download").takeIf { it.isDirectory }?.let { add(locItem(stringResource(R.string.fm_rail_downloads), Icons.Filled.Download, it, stringResource(R.string.fm_rail_downloads_short))) }
|
||||
|
||||
@@ -1401,6 +1401,7 @@
|
||||
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">Interno</string>
|
||||
<string name="fm_drive_linux">Sistema Linux</string>
|
||||
<string name="fm_drive_sd">Tarjeta SD</string>
|
||||
<string name="fm_drive_storage">Almacenamiento</string>
|
||||
<string name="fm_select">Seleccionar</string>
|
||||
|
||||
@@ -947,4 +947,5 @@
|
||||
<string name="game_file_exported">Fichiers du jeu enregistrés dans %1$s</string>
|
||||
<string name="game_frontend_files">Fichiers frontaux</string>
|
||||
<string name="fm_up_one_level">Remonter d\'un niveau</string>
|
||||
<string name="fm_drive_linux">Système Linux</string>
|
||||
</resources>
|
||||
@@ -1377,6 +1377,7 @@
|
||||
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">内部</string>
|
||||
<string name="fm_drive_linux">Linux システム</string>
|
||||
<string name="fm_drive_sd">SDカード</string>
|
||||
<string name="fm_drive_storage">ストレージ</string>
|
||||
<string name="fm_select">選択</string>
|
||||
|
||||
@@ -1377,6 +1377,7 @@
|
||||
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">내부</string>
|
||||
<string name="fm_drive_linux">Linux 시스템</string>
|
||||
<string name="fm_drive_sd">SD 카드</string>
|
||||
<string name="fm_drive_storage">저장소</string>
|
||||
<string name="fm_select">선택</string>
|
||||
|
||||
@@ -955,4 +955,5 @@
|
||||
<string name="game_file_exported">Файлы игры сохранены в %1$s</string>
|
||||
<string name="game_frontend_files">Файлы фронтенда</string>
|
||||
<string name="fm_up_one_level">На уровень вверх</string>
|
||||
<string name="fm_drive_linux">Система Linux</string>
|
||||
</resources>
|
||||
@@ -1377,6 +1377,7 @@
|
||||
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">内部存储</string>
|
||||
<string name="fm_drive_linux">Linux 系统</string>
|
||||
<string name="fm_drive_sd">SD 卡</string>
|
||||
<string name="fm_drive_storage">存储</string>
|
||||
<string name="fm_select">选择</string>
|
||||
|
||||
@@ -1377,6 +1377,7 @@
|
||||
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">內部</string>
|
||||
<string name="fm_drive_linux">Linux 系統</string>
|
||||
<string name="fm_drive_sd">SD 卡</string>
|
||||
<string name="fm_drive_storage">儲存空間</string>
|
||||
<string name="fm_select">選取</string>
|
||||
|
||||
@@ -1377,6 +1377,7 @@
|
||||
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">內部</string>
|
||||
<string name="fm_drive_linux">Linux 系統</string>
|
||||
<string name="fm_drive_sd">SD 卡</string>
|
||||
<string name="fm_drive_storage">儲存空間</string>
|
||||
<string name="fm_select">選取</string>
|
||||
|
||||
@@ -1345,6 +1345,7 @@
|
||||
<string name="content_system_many">Many systems</string>
|
||||
<!-- File manager -->
|
||||
<string name="fm_drive_internal">Internal</string>
|
||||
<string name="fm_drive_linux">Linux system</string>
|
||||
<string name="fm_drive_sd">SD card</string>
|
||||
<string name="fm_drive_storage">Storage</string>
|
||||
<string name="fm_select">Select</string>
|
||||
|
||||
Reference in new issue
Block a user