mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 15:57:59 +00:00
Improve Linux clipboard support and file handling (#872)
This commit is contained in:
1 parent
f666760415
commit
8fa0c4db01
16 files changed
+343
-166
No files matched your search
@@ -31,6 +31,7 @@ public partial class SelectDirectory : MSGComponentBase
|
||||
protected ILogger<SelectDirectory> Logger { get; init; } = null!;
|
||||
|
||||
private static readonly Dictionary<string, object?> SPELLCHECK_ATTRIBUTES = new();
|
||||
private bool isDirectoryDialogOpen;
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
||||
@@ -51,10 +52,21 @@ public partial class SelectDirectory : MSGComponentBase
|
||||
|
||||
private async Task OpenDirectoryDialog()
|
||||
{
|
||||
var response = await this.RustService.SelectDirectory(this.DirectoryDialogTitle, string.IsNullOrWhiteSpace(this.Directory) ? null : this.Directory);
|
||||
this.Logger.LogInformation($"The user selected the directory '{response.SelectedDirectory}'.");
|
||||
if (this.isDirectoryDialogOpen)
|
||||
return;
|
||||
|
||||
if (!response.UserCancelled)
|
||||
this.InternalDirectoryChanged(response.SelectedDirectory);
|
||||
this.isDirectoryDialogOpen = true;
|
||||
try
|
||||
{
|
||||
var response = await this.RustService.SelectDirectory(this.DirectoryDialogTitle, string.IsNullOrWhiteSpace(this.Directory) ? null : this.Directory);
|
||||
this.Logger.LogInformation("The user selected the directory '{SelectedDirectory}'.", response.SelectedDirectory);
|
||||
|
||||
if (!response.UserCancelled)
|
||||
this.InternalDirectoryChanged(response.SelectedDirectory);
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.isDirectoryDialogOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user