From ba909fed728f5c001d2132599ad6460e84d7c4ad Mon Sep 17 00:00:00 2001 From: Luca Auer Date: Fri, 25 May 2018 00:36:38 +0200 Subject: [PATCH] Added informations about the progress in sorting and added a litle margin for clarity --- Image sort.Logic/FolderSelector.cs | 9 +++++++++ Image sort.Logic/ImageSelectorQuery.cs | 9 +++++++++ Image sort.UI/MainWindow.xaml | 28 +++++++++++++++++++------- Image sort.UI/MainWindow.xaml.cs | 6 +++++- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/Image sort.Logic/FolderSelector.cs b/Image sort.Logic/FolderSelector.cs index 21c936c9..0d41db17 100644 --- a/Image sort.Logic/FolderSelector.cs +++ b/Image sort.Logic/FolderSelector.cs @@ -255,6 +255,15 @@ public void GoBackImages(int amount = 2) { imageSelectorQuery.GoBackImages(amount); } + + /// + /// Returns the current progress in the pool + /// + /// (currentImage, maxImages) + public (int, int) GetCurrentProgress() + { + return imageSelectorQuery.GetCurrentProgress(); + } #endregion } } diff --git a/Image sort.Logic/ImageSelectorQuery.cs b/Image sort.Logic/ImageSelectorQuery.cs index 2bc55b6b..f4b5aebd 100644 --- a/Image sort.Logic/ImageSelectorQuery.cs +++ b/Image sort.Logic/ImageSelectorQuery.cs @@ -422,6 +422,15 @@ public void AppendNewLocation(string newPath) if (newPath.Length > 0 && File.Exists(newPath)) imagePathPool[currentIndex - 2] += $"*{newPath}"; } + + /// + /// Returns the current progress in the pool + /// + /// (currentImage, maxImages) + public (int, int) GetCurrentProgress() + { + return (currentIndex, imagePathPool.Count); + } #endregion } } diff --git a/Image sort.UI/MainWindow.xaml b/Image sort.UI/MainWindow.xaml index e88cb5b9..b3371bdc 100644 --- a/Image sort.UI/MainWindow.xaml +++ b/Image sort.UI/MainWindow.xaml @@ -129,15 +129,29 @@ - - - - - + + + + + + + + + + + + + + + Open Image in File Explorer - - + + + + + + diff --git a/Image sort.UI/MainWindow.xaml.cs b/Image sort.UI/MainWindow.xaml.cs index 11ad6eb8..e3727e45 100644 --- a/Image sort.UI/MainWindow.xaml.cs +++ b/Image sort.UI/MainWindow.xaml.cs @@ -470,7 +470,7 @@ private void LoadImage(BitmapImage image) { PreviewImage.Source = image; - // if an image was given, fill in the informations + // if an image was given, fill in the information (meta-data) if (image != null) { string pathToImage = folderSelector.GetImagePath(); @@ -485,6 +485,9 @@ private void LoadImage(BitmapImage image) // Fill in the links destination and make it visible OpenInExplorerLink.NavigateUri = new Uri(pathToImage); OpenInExplorerLinkHost.Visibility = Visibility.Visible; + + (int current, int max) = folderSelector.GetCurrentProgress(); + ProgressIndicatorText.Text = $"Progress: {current}/{max}"; } // if that is not the case, remove the old information. else @@ -492,6 +495,7 @@ private void LoadImage(BitmapImage image) FileNameInfo.Text = ""; FileTypeInfo.Text = ""; FileSizeInfo.Text = ""; + ProgressIndicatorText.Text = ""; OpenInExplorerLink.NavigateUri = null; // Collapse link again to prevent accidental clicking. OpenInExplorerLinkHost.Visibility = Visibility.Collapsed;