From 72cb1e93dcb4c682177f3ffdfdc8fed88abb3bd1 Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Sun, 28 Feb 2021 11:56:09 +0100 Subject: [PATCH] Update AI Model ComboBox after fetching models.txt --- Code/Form1.cs | 9 ++++++++- Code/OS/Updater.cs | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Code/Form1.cs b/Code/Form1.cs index 21fbec8..76a4e91 100644 --- a/Code/Form1.cs +++ b/Code/Form1.cs @@ -318,12 +318,19 @@ namespace Flowframes { if (string.IsNullOrWhiteSpace(aiCombox.Text) || aiCombox.Text == lastAiComboxStr) return; lastAiComboxStr = aiCombox.Text; - aiModel = UIUtils.FillAiModelsCombox(aiModel, GetAi()); + UpdateAiModelCombox(); + if(initialized) ConfigParser.SaveComboxIndex(aiCombox); + interpFactorCombox_SelectedIndexChanged(null, null); } + public void UpdateAiModelCombox () + { + aiModel = UIUtils.FillAiModelsCombox(aiModel, GetAi()); + } + private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Logger.Log("Closing main form.", true); diff --git a/Code/OS/Updater.cs b/Code/OS/Updater.cs index a8cf937..84f141e 100644 --- a/Code/OS/Updater.cs +++ b/Code/OS/Updater.cs @@ -142,6 +142,7 @@ namespace Flowframes.OS string savePath = Path.Combine(Paths.GetPkgPath(), aiName, "models.txt"); if(File.Exists(savePath)) File.Delete(savePath); client.DownloadFile(url, savePath); + Program.mainForm.UpdateAiModelCombox(); }); } catch (Exception e)