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

@@ -63,7 +63,7 @@
<MudMenuItem Icon="@Icons.Material.Filled.Link" OnClick="@(() => this.ExportChatTemplateWithSharedAttachmentPaths(context))">
@T("Use shared attachment paths")
</MudMenuItem>
<MudMenuItem Icon="@Icons.Material.Filled.Folder" OnClick="@(() => this.ExportChatTemplateWithPackagedAttachments(context))">
<MudMenuItem Icon="@Icons.Material.Filled.Folder" Disabled="@this.isPluginDirectoryDialogOpen" OnClick="@(() => this.ExportChatTemplateWithPackagedAttachments(context))">
@T("Copy attachments into plugin")
</MudMenuItem>
</MudMenu>
@@ -6,6 +6,8 @@ namespace AIStudio.Dialogs.Settings;
public partial class SettingsDialogChatTemplate : SettingsDialogBase
{
private bool isPluginDirectoryDialogOpen;
[Parameter]
public bool CreateTemplateFromExistingChatThread { get; set; }
@@ -131,7 +133,7 @@ public partial class SettingsDialogChatTemplate : SettingsDialogBase
private async Task ExportChatTemplateWithPackagedAttachments(ChatTemplate chatTemplate)
{
if (!this.SettingsManager.ConfigurationData.App.ShowAdminSettings)
if (!this.SettingsManager.ConfigurationData.App.ShowAdminSettings || this.isPluginDirectoryDialogOpen)
return;
if (chatTemplate == ChatTemplate.NO_CHAT_TEMPLATE || chatTemplate.IsEnterpriseConfiguration)
@@ -143,11 +145,19 @@ public partial class SettingsDialogChatTemplate : SettingsDialogBase
return;
}
var pluginDirectoryResponse = await this.RustService.SelectDirectory(T("Select configuration plugin folder"));
if (pluginDirectoryResponse.UserCancelled)
return;
this.isPluginDirectoryDialogOpen = true;
try
{
var pluginDirectoryResponse = await this.RustService.SelectDirectory(T("Select configuration plugin folder"));
if (pluginDirectoryResponse.UserCancelled)
return;
await this.CopyPackagedChatTemplateLuaToClipboard(chatTemplate, pluginDirectoryResponse.SelectedDirectory);
await this.CopyPackagedChatTemplateLuaToClipboard(chatTemplate, pluginDirectoryResponse.SelectedDirectory);
}
finally
{
this.isPluginDirectoryDialogOpen = false;
}
}
private async Task CopyChatTemplateLuaToClipboard(ChatTemplate chatTemplate)