From 86cb3344201c4440250e894f62ad5b09665a7acf Mon Sep 17 00:00:00 2001 From: DasSkelett Date: Sat, 5 Sep 2020 20:55:47 +0200 Subject: [PATCH] Escape '&' in mod list --- GUI/Controls/ManageMods.Designer.cs | 12 ++++++------ GUI/Model/GUIConfiguration.cs | 2 +- GUI/Model/ModList.cs | 16 ++++++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/GUI/Controls/ManageMods.Designer.cs b/GUI/Controls/ManageMods.Designer.cs index ab3400e937..9c7e8de8ce 100644 --- a/GUI/Controls/ManageMods.Designer.cs +++ b/GUI/Controls/ManageMods.Designer.cs @@ -232,16 +232,16 @@ private void InitializeComponent() this.FilterAllButton.Size = new System.Drawing.Size(307, 30); this.FilterAllButton.Click += new System.EventHandler(this.FilterAllButton_Click); resources.ApplyResources(this.FilterAllButton, "FilterAllButton"); - // + // // FilterTagsToolButton - // + // this.FilterTagsToolButton.Name = "FilterTagsToolButton"; this.FilterTagsToolButton.Size = new System.Drawing.Size(179, 22); resources.ApplyResources(this.FilterTagsToolButton, "FilterTagsToolButton"); this.FilterTagsToolButton.DropDown.Opening += new System.ComponentModel.CancelEventHandler(FilterTagsToolButton_DropDown_Opening); - // + // // FilterLabelsToolButton - // + // this.FilterLabelsToolButton.Name = "FilterLabelsToolButton"; this.FilterLabelsToolButton.Size = new System.Drawing.Size(179, 22); resources.ApplyResources(this.FilterLabelsToolButton, "FilterLabelsToolButton"); @@ -264,9 +264,9 @@ private void InitializeComponent() this.NavForwardToolButton.Size = new System.Drawing.Size(44, 56); this.NavForwardToolButton.Click += new System.EventHandler(this.NavForwardToolButton_Click); resources.ApplyResources(this.NavForwardToolButton, "NavForwardToolButton"); - // + // // EditModSearch - // + // this.EditModSearch.Dock = System.Windows.Forms.DockStyle.Bottom; this.EditModSearch.ApplySearch += EditModSearch_ApplySearch; this.EditModSearch.SurrenderFocus += EditModSearch_SurrenderFocus; diff --git a/GUI/Model/GUIConfiguration.cs b/GUI/Model/GUIConfiguration.cs index 8496a9e7bc..6f38197e31 100644 --- a/GUI/Model/GUIConfiguration.cs +++ b/GUI/Model/GUIConfiguration.cs @@ -152,7 +152,7 @@ private static GUIConfiguration LoadConfiguration(string path) var fi = new FileInfo(path); string message = string.Format( Properties.Resources.ConfigurationParseError, - path, additionalErrorData, fi.Name, fi.DirectoryName); + fi.FullName, additionalErrorData, fi.Name, fi.DirectoryName); throw new Kraken(message); } } diff --git a/GUI/Model/ModList.cs b/GUI/Model/ModList.cs index 0882eb933a..dbad2310ac 100644 --- a/GUI/Model/ModList.cs +++ b/GUI/Model/ModList.cs @@ -312,8 +312,8 @@ private DataGridViewRow MakeRow(GUIMod mod, List changes, string inst Value = "-" }; - var name = new DataGridViewTextBoxCell() {Value = mod.Name}; - var author = new DataGridViewTextBoxCell() {Value = mod.Authors}; + var name = new DataGridViewTextBoxCell { Value = mod.Name .Replace("&", "&&") }; + var author = new DataGridViewTextBoxCell { Value = mod.Authors.Replace("&", "&&") }; var installVersion = new DataGridViewTextBoxCell() { @@ -336,12 +336,12 @@ private DataGridViewRow MakeRow(GUIMod mod, List changes, string inst : mod.LatestVersion) }; - var downloadCount = new DataGridViewTextBoxCell() { Value = String.Format("{0:N0}", mod.DownloadCount) }; - var compat = new DataGridViewTextBoxCell() { Value = mod.KSPCompatibility }; - var size = new DataGridViewTextBoxCell() { Value = mod.DownloadSize }; - var releaseDate = new DataGridViewTextBoxCell() { Value = mod.ToModule().release_date }; - var installDate = new DataGridViewTextBoxCell() { Value = mod.InstallDate }; - var desc = new DataGridViewTextBoxCell() { Value = mod.Abstract }; + var downloadCount = new DataGridViewTextBoxCell { Value = $"{mod.DownloadCount:N0}" }; + var compat = new DataGridViewTextBoxCell { Value = mod.KSPCompatibility }; + var size = new DataGridViewTextBoxCell { Value = mod.DownloadSize }; + var releaseDate = new DataGridViewTextBoxCell { Value = mod.ToModule().release_date }; + var installDate = new DataGridViewTextBoxCell { Value = mod.InstallDate }; + var desc = new DataGridViewTextBoxCell { Value = mod.Abstract.Replace("&", "&&") }; item.Cells.AddRange(selecting, autoInstalled, updating, replacing, name, author, installVersion, latestVersion, compat, size, releaseDate, installDate, downloadCount, desc);