diff --git a/Helpers/ShowMessages.cs b/Helpers/ShowMessages.cs index a77d43a..77cc4c0 100644 --- a/Helpers/ShowMessages.cs +++ b/Helpers/ShowMessages.cs @@ -33,8 +33,7 @@ public static void NoConfigSelected() string title = "No config selected"; string content = "The process has been cancelled." + - "\nPlease upload the configs that will process the files, then select those that will participate in the process. " + - "\nYou can select several at once."; + "\nPlease upload the configs that will process the files, then select those that will participate in the process. "; ShowMessageBox(title, content); } diff --git a/ViewModels/Pages/StatesEditorViewModel.cs b/ViewModels/Pages/StatesEditorViewModel.cs index 97aee01..112e6b2 100644 --- a/ViewModels/Pages/StatesEditorViewModel.cs +++ b/ViewModels/Pages/StatesEditorViewModel.cs @@ -244,6 +244,7 @@ public void ConfigChanged(ConfigItem? config, int index) { Debug.WriteLine("Config nullified."); EnvironmentController.currentConfigFullPath = string.Empty; + lastIndexConfig = -1; return; } Debug.WriteLine($"Config Changed to: {config.FileName} \nPath: {config.FilePath}"); @@ -296,12 +297,16 @@ public async Task OnSaveConfig(CancellationToken cancellation) } else { + if (lastIndexConfig == -1) + { + ShowMessages.NoConfigSelected(); + return; + } ConfigItem selectedItem = BasicListConfigViewItems[lastIndexConfig]; selectedItem.State = ConfigState.Saved; EnvironmentController.dataPixelStorage.SavePixelStorage(fullpath); } - } [RelayCommand]