mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 22:01:59 +00:00
Fix: add an API compatibility layer for the old file picker and change the new implementation as V2
This commit is contained in:
+34
-31
@@ -24,6 +24,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"FilePickerIndex": {
|
"FilePickerIndex": {
|
||||||
|
"file": {
|
||||||
|
"select": "Select this file"
|
||||||
|
},
|
||||||
"files": {
|
"files": {
|
||||||
"all_files": "All Files",
|
"all_files": "All Files",
|
||||||
"file_type": "File Type",
|
"file_type": "File Type",
|
||||||
@@ -45,12 +48,27 @@
|
|||||||
"show_more": "Show more files"
|
"show_more": "Show more files"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PluginView": {
|
"MultiplePluginsInstallModal": {
|
||||||
"hidden_one": "1 plugin is hidden from this list",
|
"confirm": "Are you sure you want to make the following modifications?",
|
||||||
"hidden_other": "{{count}} plugins are hidden from this list"
|
"description": {
|
||||||
|
"install": "Install {{name}} {{version}}",
|
||||||
|
"reinstall": "Reinstall {{name}} {{version}}",
|
||||||
|
"update": "Update {{name}} to {{version}}"
|
||||||
},
|
},
|
||||||
"PluginListLabel": {
|
"ok_button": {
|
||||||
"hidden": "Hidden from the quick access menu"
|
"idle": "Confirm",
|
||||||
|
"loading": "Working"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"install_one": "Install 1 plugin",
|
||||||
|
"install_other": "Install {{count}} plugins",
|
||||||
|
"mixed_one": "Modify {{count}} plugin",
|
||||||
|
"mixed_other": "Modify {{count}} plugins",
|
||||||
|
"reinstall_one": "Reinstall 1 plugin",
|
||||||
|
"reinstall_other": "Reinstall {{count}} plugins",
|
||||||
|
"update_one": "Update 1 plugin",
|
||||||
|
"update_other": "Update {{count}} plugins"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"PluginCard": {
|
"PluginCard": {
|
||||||
"plugin_full_access": "This plugin has full access to your Steam Deck.",
|
"plugin_full_access": "This plugin has full access to your Steam Deck.",
|
||||||
@@ -79,39 +97,20 @@
|
|||||||
"title": "Update {{artifact}}"
|
"title": "Update {{artifact}}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MultiplePluginsInstallModal": {
|
|
||||||
"title": {
|
|
||||||
"mixed_one": "Modify {{count}} plugin",
|
|
||||||
"mixed_other": "Modify {{count}} plugins",
|
|
||||||
"update_one": "Update 1 plugin",
|
|
||||||
"update_other": "Update {{count}} plugins",
|
|
||||||
"reinstall_one": "Reinstall 1 plugin",
|
|
||||||
"reinstall_other": "Reinstall {{count}} plugins",
|
|
||||||
"install_one": "Install 1 plugin",
|
|
||||||
"install_other": "Install {{count}} plugins"
|
|
||||||
},
|
|
||||||
"ok_button": {
|
|
||||||
"idle": "Confirm",
|
|
||||||
"loading": "Working"
|
|
||||||
},
|
|
||||||
"confirm": "Are you sure you want to make the following modifications?",
|
|
||||||
"description": {
|
|
||||||
"install": "Install {{name}} {{version}}",
|
|
||||||
"update": "Update {{name}} to {{version}}",
|
|
||||||
"reinstall": "Reinstall {{name}} {{version}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"PluginListIndex": {
|
"PluginListIndex": {
|
||||||
|
"hide": "Quick access: Hide",
|
||||||
"no_plugin": "No plugins installed!",
|
"no_plugin": "No plugins installed!",
|
||||||
"plugin_actions": "Plugin Actions",
|
"plugin_actions": "Plugin Actions",
|
||||||
"reinstall": "Reinstall",
|
"reinstall": "Reinstall",
|
||||||
"reload": "Reload",
|
"reload": "Reload",
|
||||||
"uninstall": "Uninstall",
|
|
||||||
"update_to": "Update to {{name}}",
|
|
||||||
"show": "Quick access: Show",
|
"show": "Quick access: Show",
|
||||||
"hide": "Quick access: Hide",
|
"uninstall": "Uninstall",
|
||||||
"update_all_one": "Update 1 plugin",
|
"update_all_one": "Update 1 plugin",
|
||||||
"update_all_other": "Update {{count}} plugins"
|
"update_all_other": "Update {{count}} plugins",
|
||||||
|
"update_to": "Update to {{name}}"
|
||||||
|
},
|
||||||
|
"PluginListLabel": {
|
||||||
|
"hidden": "Hidden from the quick access menu"
|
||||||
},
|
},
|
||||||
"PluginLoader": {
|
"PluginLoader": {
|
||||||
"decky_title": "Decky",
|
"decky_title": "Decky",
|
||||||
@@ -130,6 +129,10 @@
|
|||||||
"plugin_update_one": "Updates available for 1 plugin!",
|
"plugin_update_one": "Updates available for 1 plugin!",
|
||||||
"plugin_update_other": "Updates available for {{count}} plugins!"
|
"plugin_update_other": "Updates available for {{count}} plugins!"
|
||||||
},
|
},
|
||||||
|
"PluginView": {
|
||||||
|
"hidden_one": "1 plugin is hidden from this list",
|
||||||
|
"hidden_other": "{{count}} plugins are hidden from this list"
|
||||||
|
},
|
||||||
"RemoteDebugging": {
|
"RemoteDebugging": {
|
||||||
"remote_cef": {
|
"remote_cef": {
|
||||||
"desc": "Allow unauthenticated access to the CEF debugger to anyone in your network",
|
"desc": "Allow unauthenticated access to the CEF debugger to anyone in your network",
|
||||||
|
|||||||
+45
-42
@@ -24,6 +24,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"FilePickerIndex": {
|
"FilePickerIndex": {
|
||||||
|
"file": {
|
||||||
|
"select": "Seleziona questo file"
|
||||||
|
},
|
||||||
"files": {
|
"files": {
|
||||||
"all_files": "Tutti i file",
|
"all_files": "Tutti i file",
|
||||||
"file_type": "Tipo di file",
|
"file_type": "Tipo di file",
|
||||||
@@ -45,6 +48,32 @@
|
|||||||
"show_more": "Mostra più file"
|
"show_more": "Mostra più file"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"MultiplePluginsInstallModal": {
|
||||||
|
"confirm": "Sei sicuro di voler effettuare le modifiche seguenti?",
|
||||||
|
"description": {
|
||||||
|
"install": "Installa {{name}} {{version}}",
|
||||||
|
"reinstall": "Reinstalla {{name}} {{version}}",
|
||||||
|
"update": "Aggiorna {{name}} alla versione {{version}}"
|
||||||
|
},
|
||||||
|
"ok_button": {
|
||||||
|
"idle": "Conferma",
|
||||||
|
"loading": "Elaboro"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"install_one": "Installa un plugin",
|
||||||
|
"install_many": "Installa {{count}} plugins",
|
||||||
|
"install_other": "Installa {{count}} plugins",
|
||||||
|
"mixed_one": "Modifica un plugin",
|
||||||
|
"mixed_many": "Modifica {{count}} plugins",
|
||||||
|
"mixed_other": "Modifica {{count}} plugins",
|
||||||
|
"reinstall_one": "Reinstalla un plugin",
|
||||||
|
"reinstall_many": "Reinstalla {{count}} plugins",
|
||||||
|
"reinstall_other": "Reinstalla {{count}} plugins",
|
||||||
|
"update_one": "Aggiorna un plugin",
|
||||||
|
"update_many": "Aggiorna {{count}} plugins",
|
||||||
|
"update_other": "Aggiorna {{count}} plugins"
|
||||||
|
}
|
||||||
|
},
|
||||||
"PluginCard": {
|
"PluginCard": {
|
||||||
"plugin_full_access": "Questo plugin ha accesso completo al tuo Steam Deck.",
|
"plugin_full_access": "Questo plugin ha accesso completo al tuo Steam Deck.",
|
||||||
"plugin_install": "Installa",
|
"plugin_install": "Installa",
|
||||||
@@ -73,17 +102,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PluginListIndex": {
|
"PluginListIndex": {
|
||||||
|
"hide": "Accesso rapido: Nascondi",
|
||||||
"no_plugin": "Nessun plugin installato!",
|
"no_plugin": "Nessun plugin installato!",
|
||||||
"plugin_actions": "Operazioni sui plugins",
|
"plugin_actions": "Operazioni sui plugins",
|
||||||
"reinstall": "Reinstalla",
|
"reinstall": "Reinstalla",
|
||||||
"reload": "Ricarica",
|
"reload": "Ricarica",
|
||||||
|
"show": "Accesso rapido: Mostra",
|
||||||
"uninstall": "Rimuovi",
|
"uninstall": "Rimuovi",
|
||||||
"update_to": "Aggiorna a {{name}}",
|
|
||||||
"update_all_one": "Aggiorna un plugin",
|
"update_all_one": "Aggiorna un plugin",
|
||||||
"update_all_many": "Aggiorna {{count}} plugins",
|
"update_all_many": "Aggiorna {{count}} plugins",
|
||||||
"update_all_other": "Aggiorna {{count}} plugins",
|
"update_all_other": "Aggiorna {{count}} plugins",
|
||||||
"show": "Accesso rapido: Mostra",
|
"update_to": "Aggiorna a {{name}}"
|
||||||
"hide": "Accesso rapido: Nascondi"
|
},
|
||||||
|
"PluginListLabel": {
|
||||||
|
"hidden": "Nascosti dal menu di accesso rapido"
|
||||||
},
|
},
|
||||||
"PluginLoader": {
|
"PluginLoader": {
|
||||||
"decky_title": "Decky",
|
"decky_title": "Decky",
|
||||||
@@ -103,6 +135,11 @@
|
|||||||
"plugin_update_many": "Aggiornamenti disponibili per {{count}} plugins!",
|
"plugin_update_many": "Aggiornamenti disponibili per {{count}} plugins!",
|
||||||
"plugin_update_other": "Aggiornamenti disponibili per {{count}} plugins!"
|
"plugin_update_other": "Aggiornamenti disponibili per {{count}} plugins!"
|
||||||
},
|
},
|
||||||
|
"PluginView": {
|
||||||
|
"hidden_one": "Un plugin è nascosto dalla lista",
|
||||||
|
"hidden_many": "Sono nascosti {{count}} plugin dalla lista",
|
||||||
|
"hidden_other": "Sono nascosti {{count}} plugin dalla lista"
|
||||||
|
},
|
||||||
"RemoteDebugging": {
|
"RemoteDebugging": {
|
||||||
"remote_cef": {
|
"remote_cef": {
|
||||||
"desc": "Permetti l'accesso non autenticato al debugger di CEF da tutti gli indirizzi sulla tua rete locale",
|
"desc": "Permetti l'accesso non autenticato al debugger di CEF da tutti gli indirizzi sulla tua rete locale",
|
||||||
@@ -110,6 +147,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"SettingsDeveloperIndex": {
|
"SettingsDeveloperIndex": {
|
||||||
|
"cef_console": {
|
||||||
|
"button": "Apri la console",
|
||||||
|
"desc": "Apri la console di CEF. Utile solamente per ragioni di debug. Questa opzione deve essere usata solo se sei uno sviluppatore di plugin o se uno di questi ti ha chiesto di farlo, visto che questa feature potrebbe essere potenzialmente pericolosa.",
|
||||||
|
"label": "Console CEF"
|
||||||
|
},
|
||||||
"header": "Altro",
|
"header": "Altro",
|
||||||
"react_devtools": {
|
"react_devtools": {
|
||||||
"desc": "Abilita la connessione ad un computer che esegue i DevTools di React. Steam verrà ricaricato se lo stato cambia. Imposta il tuo indirizzo IP prima di abilitarlo.",
|
"desc": "Abilita la connessione ad un computer che esegue i DevTools di React. Steam verrà ricaricato se lo stato cambia. Imposta il tuo indirizzo IP prima di abilitarlo.",
|
||||||
@@ -132,11 +174,6 @@
|
|||||||
"desc1": "Abilita il menu di sviluppo interno di Valve.",
|
"desc1": "Abilita il menu di sviluppo interno di Valve.",
|
||||||
"desc2": "Non toccare nulla in questo menu se non sai quello che fa.",
|
"desc2": "Non toccare nulla in questo menu se non sai quello che fa.",
|
||||||
"label": "Abilita Menu Sviluppatore"
|
"label": "Abilita Menu Sviluppatore"
|
||||||
},
|
|
||||||
"cef_console": {
|
|
||||||
"label": "Console CEF",
|
|
||||||
"button": "Apri la console",
|
|
||||||
"desc": "Apri la console di CEF. Utile solamente per ragioni di debug. Questa opzione deve essere usata solo se sei uno sviluppatore di plugin o se uno di questi ti ha chiesto di farlo, visto che questa feature potrebbe essere potenzialmente pericolosa."
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"SettingsGeneralIndex": {
|
"SettingsGeneralIndex": {
|
||||||
@@ -218,39 +255,5 @@
|
|||||||
"reloading": "Ricaricando",
|
"reloading": "Ricaricando",
|
||||||
"updating": "Aggiornando"
|
"updating": "Aggiornando"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"MultiplePluginsInstallModal": {
|
|
||||||
"title": {
|
|
||||||
"mixed_one": "Modifica un plugin",
|
|
||||||
"mixed_many": "Modifica {{count}} plugins",
|
|
||||||
"mixed_other": "Modifica {{count}} plugins",
|
|
||||||
"update_one": "Aggiorna un plugin",
|
|
||||||
"update_many": "Aggiorna {{count}} plugins",
|
|
||||||
"update_other": "Aggiorna {{count}} plugins",
|
|
||||||
"reinstall_one": "Reinstalla un plugin",
|
|
||||||
"reinstall_many": "Reinstalla {{count}} plugins",
|
|
||||||
"reinstall_other": "Reinstalla {{count}} plugins",
|
|
||||||
"install_one": "Installa un plugin",
|
|
||||||
"install_many": "Installa {{count}} plugins",
|
|
||||||
"install_other": "Installa {{count}} plugins"
|
|
||||||
},
|
|
||||||
"confirm": "Sei sicuro di voler effettuare le modifiche seguenti?",
|
|
||||||
"ok_button": {
|
|
||||||
"idle": "Conferma",
|
|
||||||
"loading": "Elaboro"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"install": "Installa {{name}} {{version}}",
|
|
||||||
"update": "Aggiorna {{name}} alla versione {{version}}",
|
|
||||||
"reinstall": "Reinstalla {{name}} {{version}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"PluginView": {
|
|
||||||
"hidden_one": "Un plugin è nascosto dalla lista",
|
|
||||||
"hidden_many": "Sono nascosti {{count}} plugin dalla lista",
|
|
||||||
"hidden_other": "Sono nascosti {{count}} plugin dalla lista"
|
|
||||||
},
|
|
||||||
"PluginListLabel": {
|
|
||||||
"hidden": "Nascosti dal menu di accesso rapido"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export interface FilePickerProps {
|
|||||||
allowAllFiles?: boolean;
|
allowAllFiles?: boolean;
|
||||||
defaultHidden?: boolean;
|
defaultHidden?: boolean;
|
||||||
max?: number;
|
max?: number;
|
||||||
|
fileSelType?: FileSelectionType;
|
||||||
onSubmit: (val: { path: string; realpath: string }) => void;
|
onSubmit: (val: { path: string; realpath: string }) => void;
|
||||||
closeModal?: () => void;
|
closeModal?: () => void;
|
||||||
}
|
}
|
||||||
@@ -48,6 +49,12 @@ export interface File {
|
|||||||
created: number;
|
created: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum FileSelectionType {
|
||||||
|
FILE,
|
||||||
|
FOLDER,
|
||||||
|
NONE,
|
||||||
|
}
|
||||||
|
|
||||||
interface FileListing {
|
interface FileListing {
|
||||||
realpath: string;
|
realpath: string;
|
||||||
files: File[];
|
files: File[];
|
||||||
@@ -127,6 +134,7 @@ const FilePicker: FunctionComponent<FilePickerProps> = ({
|
|||||||
allowAllFiles = true,
|
allowAllFiles = true,
|
||||||
defaultHidden = false, // false by default makes sense for most users
|
defaultHidden = false, // false by default makes sense for most users
|
||||||
max = 1000,
|
max = 1000,
|
||||||
|
fileSelType = FileSelectionType.NONE,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
closeModal,
|
closeModal,
|
||||||
}) => {
|
}) => {
|
||||||
@@ -327,7 +335,7 @@ const FilePicker: FunctionComponent<FilePickerProps> = ({
|
|||||||
</Focusable>
|
</Focusable>
|
||||||
</DialogControlsSection>
|
</DialogControlsSection>
|
||||||
</DialogBody>
|
</DialogBody>
|
||||||
{!loading && error === FileErrorTypes.None && !includeFiles && (
|
{!loading && error === FileErrorTypes.None && fileSelType !== FileSelectionType.NONE && (
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<DialogButton
|
<DialogButton
|
||||||
className="Primary"
|
className="Primary"
|
||||||
@@ -337,7 +345,9 @@ const FilePicker: FunctionComponent<FilePickerProps> = ({
|
|||||||
closeModal?.();
|
closeModal?.();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('FilePickerIndex.folder.select')}
|
{fileSelType === FileSelectionType.FILE
|
||||||
|
? t('FilePickerIndex.file.select')
|
||||||
|
: t('FilePickerIndex.folder.select')}
|
||||||
</DialogButton>
|
</DialogButton>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { FaExclamationCircle, FaPlug } from 'react-icons/fa';
|
|||||||
|
|
||||||
import { DeckyState, DeckyStateContextProvider, UserInfo, useDeckyState } from './components/DeckyState';
|
import { DeckyState, DeckyStateContextProvider, UserInfo, useDeckyState } from './components/DeckyState';
|
||||||
import LegacyPlugin from './components/LegacyPlugin';
|
import LegacyPlugin from './components/LegacyPlugin';
|
||||||
import { File } from './components/modals/filepicker';
|
import { File, FileSelectionType } from './components/modals/filepicker';
|
||||||
import { deinitFilepickerPatches, initFilepickerPatches } from './components/modals/filepicker/patches';
|
import { deinitFilepickerPatches, initFilepickerPatches } from './components/modals/filepicker/patches';
|
||||||
import MultiplePluginsInstallModal from './components/modals/MultiplePluginsInstallModal';
|
import MultiplePluginsInstallModal from './components/modals/MultiplePluginsInstallModal';
|
||||||
import PluginInstallModal from './components/modals/PluginInstallModal';
|
import PluginInstallModal from './components/modals/PluginInstallModal';
|
||||||
@@ -360,6 +360,38 @@ class PluginLoader extends Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
openFilePicker(
|
openFilePicker(
|
||||||
|
startPath: string,
|
||||||
|
selectFiles?: boolean,
|
||||||
|
regex?: RegExp,
|
||||||
|
): Promise<{ path: string; realpath: string }> {
|
||||||
|
if (selectFiles) {
|
||||||
|
return this.openFilePickerV2(
|
||||||
|
startPath,
|
||||||
|
true,
|
||||||
|
regex,
|
||||||
|
true,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
FileSelectionType.FILE,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return this.openFilePickerV2(
|
||||||
|
startPath,
|
||||||
|
false,
|
||||||
|
regex,
|
||||||
|
true,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
FileSelectionType.FOLDER,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
openFilePickerV2(
|
||||||
startPath: string,
|
startPath: string,
|
||||||
includeFiles?: boolean,
|
includeFiles?: boolean,
|
||||||
filter?: RegExp | ((file: File) => boolean),
|
filter?: RegExp | ((file: File) => boolean),
|
||||||
@@ -368,6 +400,7 @@ class PluginLoader extends Logger {
|
|||||||
showHiddenFiles?: boolean,
|
showHiddenFiles?: boolean,
|
||||||
allowAllFiles?: boolean,
|
allowAllFiles?: boolean,
|
||||||
max?: number,
|
max?: number,
|
||||||
|
select?: FileSelectionType,
|
||||||
): Promise<{ path: string; realpath: string }> {
|
): Promise<{ path: string; realpath: string }> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const Content = ({ closeModal }: { closeModal?: () => void }) => (
|
const Content = ({ closeModal }: { closeModal?: () => void }) => (
|
||||||
@@ -389,6 +422,7 @@ class PluginLoader extends Logger {
|
|||||||
defaultHidden={showHiddenFiles}
|
defaultHidden={showHiddenFiles}
|
||||||
onSubmit={resolve}
|
onSubmit={resolve}
|
||||||
closeModal={closeModal}
|
closeModal={closeModal}
|
||||||
|
fileSelType={select}
|
||||||
max={max}
|
max={max}
|
||||||
/>
|
/>
|
||||||
</WithSuspense>
|
</WithSuspense>
|
||||||
|
|||||||
Reference in New Issue
Block a user