This commit is contained in:
EugeneTes
2026-03-19 09:03:37 +01:00
parent 14fe822962
commit 83597b8763
55 changed files with 2136 additions and 32 deletions

View File

@@ -43,7 +43,7 @@ public class PluginLoader:IVisionBuilderModule
if (!File.Exists(enabledPluginsPath))
{
Log.Warning("Enabled plugins file not found: {EnabledPluginsPath}. All discovered plugins will be disabled by default.", enabledPluginsPath);
File.WriteAllText(enabledPluginsPath, "");
File.WriteAllText(enabledPluginsPath, "");
}
List<string> enabledPlugins = File.ReadAllLines(enabledPluginsPath).ToList();

View File

@@ -2,5 +2,5 @@
public interface IPasswordInputService
{
string GetPassword();
Task<string?> GetPasswordAsync();
}

View File

@@ -117,11 +117,11 @@ public partial class ErrorPreviewVM:ObservableObject
}
[RelayCommand(CanExecute = nameof(LearnButtonVisible))]
public void Learn()
public async Task Learn()
{
if (!string.IsNullOrEmpty(_uiConfiguration.AdminPassword))
{
var passwordOk= _passwordInputService.GetPassword()==_uiConfiguration.AdminPassword;
var passwordOk = await _passwordInputService.GetPasswordAsync() == _uiConfiguration.AdminPassword;
if (!passwordOk) return;
}
_learningTool.Learn(_errorData.RecipeName, _errorData.ImageOriginal);

View File

@@ -28,13 +28,13 @@ public class ErrorsVM:IEventHandler<ImageProcessedEvent>, IEventHandler<SessionS
public ObservableCollection<ErrorData> Errors { get; set; } = new ObservableCollection<ErrorData>();
public void ShowImage(ErrorData errorData)
public async Task ShowImage(ErrorData errorData)
{
if (errorData == null) return;
var vm = new ErrorPreviewVM(this, errorData, errorData.RecipeName, _uiConfiguration, _learningTool, _passwordInputService);
_imagePreviewService.ShowImagePreview(vm);
await _imagePreviewService.ShowImagePreviewAsync(vm);
}

View File

@@ -4,6 +4,6 @@ namespace VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
public interface IImagePreviewService
{
void ShowImagePreview(ErrorPreviewVM errorPreviewVm);
Task ShowImagePreviewAsync(ErrorPreviewVM errorPreviewVm);
}

View File

@@ -2,5 +2,5 @@
public interface IRecipeSelectionDialogService
{
bool SelectRecipe(RecipeSelectionVM recipeSelectionVm);
Task<bool> SelectRecipeAsync(RecipeSelectionVM recipeSelectionVm);
}

View File

@@ -2,5 +2,5 @@
public interface ISettingsService
{
void ShowSettingsDialog();
Task ShowSettingsDialogAsync();
}

View File

@@ -27,9 +27,9 @@ public partial class MainWindowVM:ObservableObject
[RelayCommand]
public void Settings()
public async Task Settings()
{
_settingsService.ShowSettingsDialog();
await _settingsService.ShowSettingsDialogAsync();
}
[RelayCommand]

View File

@@ -118,10 +118,10 @@ namespace VisionBuilder.UI.Common
[RelayCommand(CanExecute = nameof(IsNotRunning))]
public void SelectRecipe()
public async Task SelectRecipe()
{
var vm = GetRecipeSelectionVm();
if (!_recipeSelectionDialogService.SelectRecipe(vm))return;
if (!await _recipeSelectionDialogService.SelectRecipeAsync(vm))return;
ProcessRecipeSelectionVm(vm);
}