From 52430df55f20578817df29638752debb219a4a0d Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 29 Sep 2025 17:51:09 +0200 Subject: [PATCH] Make file dialog API usages read-only (#37779) Requires https://github.com/space-wizards/RobustToolbox/commit/4e7de2f272cafc687c775fceb16b88681fcfd7e3 Fixes #37762 --- Content.Client/Fax/UI/FaxBoundUi.cs | 2 +- Content.Client/Instruments/UI/InstrumentMenu.xaml.cs | 2 +- Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Client/Fax/UI/FaxBoundUi.cs b/Content.Client/Fax/UI/FaxBoundUi.cs index ca2e834b4f..d9265736c3 100644 --- a/Content.Client/Fax/UI/FaxBoundUi.cs +++ b/Content.Client/Fax/UI/FaxBoundUi.cs @@ -40,7 +40,7 @@ public sealed class FaxBoundUi : BoundUserInterface _dialogIsOpen = true; var filters = new FileDialogFilters(new FileDialogFilters.Group("txt")); - await using var file = await _fileDialogManager.OpenFile(filters); + await using var file = await _fileDialogManager.OpenFile(filters, FileAccess.Read); _dialogIsOpen = false; if (_window == null || _window.Disposed || file == null) diff --git a/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs b/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs index 4a29478a9c..16dec590f9 100644 --- a/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs +++ b/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs @@ -129,7 +129,7 @@ namespace Content.Client.Instruments.UI // or focus the previously-opened window. _isMidiFileDialogueWindowOpen = true; - await using var file = await _dialogs.OpenFile(filters); + await using var file = await _dialogs.OpenFile(filters, FileAccess.Read); _isMidiFileDialogueWindowOpen = false; diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index 38bd23e3db..821722ec35 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -1531,7 +1531,7 @@ namespace Content.Client.Lobby.UI return; StartExport(); - await using var file = await _dialogManager.OpenFile(new FileDialogFilters(new FileDialogFilters.Group("yml"))); + await using var file = await _dialogManager.OpenFile(new FileDialogFilters(new FileDialogFilters.Group("yml")), FileAccess.Read); if (file == null) { -- 2.51.2