From 16bd6ea7a720d568f94546d442e291aea3e2d4ab Mon Sep 17 00:00:00 2001 From: tombogle Date: Mon, 3 Jul 2023 11:53:05 -0400 Subject: [PATCH 1/2] Fixed a spelling error in an API method for ImageGalleryControl and removed an unused/misspelled public field --- CHANGELOG.md | 4 +++ .../ImageGallery/ImageGalleryControl.cs | 29 +++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 351d0e304..5a2d18509 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,11 +26,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - [SIL.Media] Changed the FrameRate reported in VideoInfo from FrameRate to AvgFrameRate. +- [SIL.Windows.Forms] Fixed spelling error in ImageGalleryControl, renaming SetIntialSearchTerm to SetInitialSearchTerm. ### Fixed - [SIL.Core] Make RetryUtility retry for exceptions that are subclasses of the ones listed to try. For example, by default (IOException) it will now retry for FileNotFoundException. +### Removed +- [SIL.Windows.Forms] ImageGalleryControl.InSomeoneElesesDesignMode (ssemingly unused and misspelled) + ## [12.0.1] - 2023-05-26 ### Fixed diff --git a/SIL.Windows.Forms/ImageToolbox/ImageGallery/ImageGalleryControl.cs b/SIL.Windows.Forms/ImageToolbox/ImageGallery/ImageGalleryControl.cs index 342eb06c1..acc144042 100644 --- a/SIL.Windows.Forms/ImageToolbox/ImageGallery/ImageGalleryControl.cs +++ b/SIL.Windows.Forms/ImageToolbox/ImageGallery/ImageGalleryControl.cs @@ -19,7 +19,6 @@ public partial class ImageGalleryControl : UserControl, IImageToolboxControl { private ImageCollectionManager _imageCollectionManager; private PalasoImage _previousImage; - public bool InSomeoneElesesDesignMode; public ImageGalleryControl() { @@ -55,11 +54,21 @@ public ImageGalleryControl() /// use if the calling app already has some notion of what the user might be looking for (e.g. the definition in a dictionary program) /// /// - public void SetIntialSearchTerm(string searchTerm) + public void SetInitialSearchTerm(string searchTerm) { _searchTermsBox.Text = searchTerm; } + /// + /// use if the calling app already has some notion of what the user might be looking for (e.g. the definition in a dictionary program) + /// + /// + [Obsolete("Use SetInitialSearchTerm (spelling corrected)")] + public void SetIntialSearchTerm(string searchTerm) + { + SetInitialSearchTerm(searchTerm); + } + /// /// Gets or sets the language used in searching for an image by words. /// @@ -99,9 +108,19 @@ private void _searchButton_Click(object sender, EventArgs e) _messageLabel.Visible = false; _downloadInstallerLink.Visible = false; _thumbnailViewer.LoadItems(results); - var fmt = "Found {0} images".Localize("ImageToolbox.MatchingImages", "The {0} will be replaced by the number of matching images"); + var fmt = results.Count == 1 ? + "Found 1 image".Localize("ImageToolbox.MatchingImageSingle") : + "Found {0} images".Localize("ImageToolbox.MatchingImages", "The {0} will be replaced by the number of matching images"); if (!foundExactMatches) - fmt = "Found {0} images with names close to \u201C{1}\u201D".Localize("ImageToolbox.AlmostMatchingImages", "The {0} will be replaced by the number of images found. The {1} will be replaced with the search string."); + { + fmt = results.Count == 1 ? + "Found 1 image with a name close to \u201C{1}\u201D".Localize("ImageToolbox.AlmostMatchingImageSingle", + "The {1} will be replaced with the search string.") : + "Found {0} images with names close to \u201C{1}\u201D".Localize( + "ImageToolbox.AlmostMatchingImages", + "The {0} will be replaced by the number of images found. The {1} will be replaced with the search string."); + } + _searchResultStats.Text = string.Format(fmt, results.Count, _searchTermsBox.Text); _searchResultStats.ForeColor = foundExactMatches ? Color.Black : Color.FromArgb(0x34, 0x65, 0xA4); //#3465A4 _searchResultStats.Font = new Font("Segoe UI", 9F, foundExactMatches ? FontStyle.Regular : FontStyle.Bold); @@ -226,7 +245,7 @@ private void ArtOfReadingChooser_Load(object sender, EventArgs e) _collectionDropDown.Visible = true; _collectionDropDown.Text = "Galleries".Localize("ImageToolbox.Galleries"); - if(ImageToolboxSettings.Default.DisabledImageCollections == null) + if (ImageToolboxSettings.Default.DisabledImageCollections == null) { ImageToolboxSettings.Default.DisabledImageCollections = new StringCollection(); } From 6b41e3a1a3a9e44f2eee9d7acf95387d99ba358d Mon Sep 17 00:00:00 2001 From: tombogle Date: Mon, 3 Jul 2023 14:44:19 -0400 Subject: [PATCH 2/2] +semver: major --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a2d18509..8f00f5bb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [SIL.Core] Make RetryUtility retry for exceptions that are subclasses of the ones listed to try. For example, by default (IOException) it will now retry for FileNotFoundException. ### Removed -- [SIL.Windows.Forms] ImageGalleryControl.InSomeoneElesesDesignMode (ssemingly unused and misspelled) +- [SIL.Windows.Forms] ImageGalleryControl.InSomeoneElesesDesignMode (seemingly unused and misspelled) ## [12.0.1] - 2023-05-26