File Explorer
The File Explorer is the primary tool for interacting with the Virtual Filesystem (VFS). It allows users to browse directories, manage files, and launch associated applications dynamically.
Core Features
- Navigation: Supports typical browser-style navigation (
NavigateTo,NavigateUp,NavigateBack,NavigateForward). - View Modes: Toggle between Icon Grid, List, and Details views via
EFileExplorerViewMode. - Sorting: Sort items by Name, Size, Type, or Modified Date using
EFileExplorerSortMode. - Selection: Supports single selection, range selection (
SelectRange), and additive selection (SelectItem). - File Operations: Create folders (
CreateFolder), rename files (RenameSelected), and delete items (DeleteSelected). - Dispatch System: Automatically resolves the correct application to open a file (
DispatchFileToApp), which routes toUAppLauncherSubsystem::LaunchAppForFile.
Architecture & Dependencies
The File Explorer backend (UFileExplorerApp) is heavily dependent on the OS layer:
- Virtual Filesystem Subsystem (
UVirtualFilesystemSubsystem): Listens to VFS events (OnVFSNodeCreated,OnVFSNodeModified,OnVFSNodeDeleted) to keep the UI synchronized with the underlying data state. UsesFVFSNoderepresentations. - App Launcher Subsystem (
UAppLauncherSubsystem): Relies on the launcher to open files in their registered external applications.
Operating Modes
The controller uses EFileExplorerMode to determine behavior, allowing it to double as standard dialog windows:
Standard: The full-featured standalone application.OpenFile: A simplified mode used by other apps to pick a file to load.SaveFile: A mode used to specify a destination path and filename for saving (utilizesDefaultFileName).Picker: Used when only a folder selection is required.
Technical Details
- Controller Class:
UFileExplorerApp(Inherits fromUAppBase) - View Target: User must assign a UMG Widget to
ExplorerWidgetClass. - Delegates Exposed to UI:
FOnFileExplorerPathChangedFOnFileExplorerSelectionChangedFOnFileExplorerViewChangedFOnFileExplorerFileSelected(Critical forOpenFile/SaveFiledialog modes)
Extension Tips
To add a new "Quick Access" location to the sidebar:
- Open
UFileExplorerApp::GetSidebarPlaces(). - Add your desired VFS path (e.g.,
/home/username/Pictures). - The UI will automatically populate the sidebar with the new entry.
