Improve Linux clipboard support and file handling (#872)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-07-19 19:56:30 +02:00
1 parent f666760415
commit 8fa0c4db01
16 files changed
+343 -166

No files matched your search

@@ -49,6 +49,7 @@ public partial class ConfigurationFile : ConfigurationBaseCore
private RustService RustService { get; init; } = null!;
private string internalText = string.Empty;
private bool isFileDialogOpen;
private readonly Timer timer = new(TimeSpan.FromMilliseconds(500))
{
AutoReset = false
@@ -90,13 +91,24 @@ public partial class ConfigurationFile : ConfigurationBaseCore
private async Task OpenFileDialog()
{
var response = await this.RustService.SelectFile(this.FileDialogTitle, this.Filter, string.IsNullOrWhiteSpace(this.internalText) ? null : this.internalText);
if (response.UserCancelled)
if (this.isFileDialogOpen)
return;
this.timer.Stop();
this.internalText = response.SelectedFilePath;
await this.OptionChanged(response.SelectedFilePath);
this.isFileDialogOpen = true;
try
{
var response = await this.RustService.SelectFile(this.FileDialogTitle, this.Filter, string.IsNullOrWhiteSpace(this.internalText) ? null : this.internalText);
if (response.UserCancelled)
return;
this.timer.Stop();
this.internalText = response.SelectedFilePath;
await this.OptionChanged(response.SelectedFilePath);
}
finally
{
this.isFileDialogOpen = false;
}
}
private async Task OptionChanged(string updatedText)