2026-01-09 14:49:44 +00:00
|
|
|
using AIStudio.Provider;
|
|
|
|
|
using AIStudio.Settings;
|
2025-01-05 14:11:15 +00:00
|
|
|
using AIStudio.Settings.DataModel;
|
|
|
|
|
|
|
|
|
|
namespace AIStudio.Components.Settings;
|
|
|
|
|
|
|
|
|
|
public partial class SettingsPanelApp : SettingsPanelBase
|
|
|
|
|
{
|
2026-02-07 21:59:41 +00:00
|
|
|
private async Task GenerateEncryptionSecret()
|
|
|
|
|
{
|
|
|
|
|
var secret = EnterpriseEncryption.GenerateSecret();
|
|
|
|
|
await this.RustService.CopyText2Clipboard(this.Snackbar, secret);
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-09 14:49:44 +00:00
|
|
|
private IEnumerable<ConfigurationSelectData<string>> GetFilteredTranscriptionProviders()
|
|
|
|
|
{
|
|
|
|
|
yield return new(T("Disable dictation and transcription"), string.Empty);
|
|
|
|
|
|
|
|
|
|
var minimumLevel = this.SettingsManager.GetMinimumConfidenceLevel(Tools.Components.APP_SETTINGS);
|
|
|
|
|
foreach (var provider in this.SettingsManager.ConfigurationData.TranscriptionProviders)
|
|
|
|
|
{
|
|
|
|
|
if (provider.UsedLLMProvider.GetConfidence(this.SettingsManager).Level >= minimumLevel)
|
|
|
|
|
yield return new(provider.Name, provider.Id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-05 14:11:15 +00:00
|
|
|
private void UpdatePreviewFeatures(PreviewVisibility previewVisibility)
|
|
|
|
|
{
|
|
|
|
|
this.SettingsManager.ConfigurationData.App.PreviewVisibility = previewVisibility;
|
|
|
|
|
this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = previewVisibility.FilterPreviewFeatures(this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures);
|
|
|
|
|
}
|
2025-05-02 09:50:14 +00:00
|
|
|
|
|
|
|
|
private async Task UpdateLangBehaviour(LangBehavior behavior)
|
|
|
|
|
{
|
|
|
|
|
this.SettingsManager.ConfigurationData.App.LanguageBehavior = behavior;
|
|
|
|
|
await this.MessageBus.SendMessage<bool>(this, Event.PLUGINS_RELOADED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task UpdateManuallySelectedLanguage(Guid pluginId)
|
|
|
|
|
{
|
|
|
|
|
this.SettingsManager.ConfigurationData.App.LanguagePluginId = pluginId;
|
|
|
|
|
await this.MessageBus.SendMessage<bool>(this, Event.PLUGINS_RELOADED);
|
|
|
|
|
}
|
2025-01-05 14:11:15 +00:00
|
|
|
}
|