mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 22:06:17 +00:00
Merge pull request #1563 from hydralauncher/feat/unzip-behavior-option
feat: add setting to extract by default
This commit is contained in:
@@ -356,7 +356,8 @@
|
||||
"common_redist_description": "Common redistributables are required to run some games. Installing them is recommended to avoid issues.",
|
||||
"install_common_redist": "Install",
|
||||
"installing_common_redist": "Installing…",
|
||||
"show_download_speed_in_megabytes": "Show download speed in megabytes per second"
|
||||
"show_download_speed_in_megabytes": "Show download speed in megabytes per second",
|
||||
"extract_files_by_default": "Extract files by default after download"
|
||||
},
|
||||
"notifications": {
|
||||
"download_complete": "Download complete",
|
||||
|
||||
@@ -343,7 +343,8 @@
|
||||
"common_redist_description": "Componentes recomendados são necessários para executar alguns jogos. A instalação deles é recomendada para evitar problemas.",
|
||||
"install_common_redist": "Instalar",
|
||||
"installing_common_redist": "Instalando…",
|
||||
"show_download_speed_in_megabytes": "Exibir taxas de download em megabytes por segundo"
|
||||
"show_download_speed_in_megabytes": "Exibir taxas de download em megabytes por segundo",
|
||||
"extract_files_by_default": "Extrair arquivos automaticamente após o download"
|
||||
},
|
||||
"notifications": {
|
||||
"download_complete": "Download concluído",
|
||||
|
||||
@@ -34,13 +34,18 @@ export function DownloadSettingsModal({
|
||||
}: Readonly<DownloadSettingsModalProps>) {
|
||||
const { t } = useTranslation("game_details");
|
||||
|
||||
const userPreferences = useAppSelector(
|
||||
(state) => state.userPreferences.value
|
||||
);
|
||||
|
||||
const { showErrorToast } = useToast();
|
||||
|
||||
const [diskFreeSpace, setDiskFreeSpace] = useState<number | null>(null);
|
||||
const [selectedPath, setSelectedPath] = useState("");
|
||||
const [downloadStarting, setDownloadStarting] = useState(false);
|
||||
const [automaticExtractionEnabled, setAutomaticExtractionEnabled] =
|
||||
useState(true);
|
||||
const [automaticExtractionEnabled, setAutomaticExtractionEnabled] = useState(
|
||||
userPreferences?.extractFilesByDefault ?? true
|
||||
);
|
||||
const [selectedDownloader, setSelectedDownloader] =
|
||||
useState<Downloader | null>(null);
|
||||
const [hasWritePermission, setHasWritePermission] = useState<boolean | null>(
|
||||
@@ -49,10 +54,6 @@ export function DownloadSettingsModal({
|
||||
|
||||
const { isFeatureEnabled, Feature } = useFeature();
|
||||
|
||||
const userPreferences = useAppSelector(
|
||||
(state) => state.userPreferences.value
|
||||
);
|
||||
|
||||
const getDiskFreeSpace = async (path: string) => {
|
||||
const result = await window.electron.getDiskFreeSpace(path);
|
||||
setDiskFreeSpace(result.free);
|
||||
|
||||
@@ -24,6 +24,7 @@ export function SettingsBehavior() {
|
||||
seedAfterDownloadComplete: false,
|
||||
showHiddenAchievementsDescription: false,
|
||||
showDownloadSpeedInMegabytes: false,
|
||||
extractFilesByDefault: true,
|
||||
});
|
||||
|
||||
const { t } = useTranslation("settings");
|
||||
@@ -43,6 +44,7 @@ export function SettingsBehavior() {
|
||||
userPreferences.showHiddenAchievementsDescription ?? false,
|
||||
showDownloadSpeedInMegabytes:
|
||||
userPreferences.showDownloadSpeedInMegabytes ?? false,
|
||||
extractFilesByDefault: userPreferences.extractFilesByDefault ?? true,
|
||||
});
|
||||
}
|
||||
}, [userPreferences]);
|
||||
@@ -152,6 +154,16 @@ export function SettingsBehavior() {
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
<CheckboxField
|
||||
label={t("extract_files_by_default")}
|
||||
checked={form.extractFilesByDefault}
|
||||
onChange={() =>
|
||||
handleChange({
|
||||
extractFilesByDefault: !form.extractFilesByDefault,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ export interface UserPreferences {
|
||||
achievementNotificationsEnabled?: boolean;
|
||||
friendRequestNotificationsEnabled?: boolean;
|
||||
showDownloadSpeedInMegabytes?: boolean;
|
||||
extractFilesByDefault?: boolean;
|
||||
}
|
||||
|
||||
export interface ScreenState {
|
||||
|
||||
Reference in New Issue
Block a user