Skip to content

Commit

Permalink
+ Added displaying of if a command was canceled or if successfully co…
Browse files Browse the repository at this point in the history
…mpleted, the time elapsed.
  • Loading branch information
DrWhoCares committed Aug 10, 2020
1 parent feffd81 commit 13ee5c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion imgdanke/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,7 @@ private void ProcessingCancelButton_Click(object sender, EventArgs e)

private void ApplyButton_Click(object sender, EventArgs e)
{
Stopwatch stopwatch = Stopwatch.StartNew();
ToggleUI(false);
List<FileInfo> imgFiles = FilesInSourceFolderListBox.SelectedItems.Cast<FileInfoWithSubpath>().Select(f => f.ImageInfo).ToList();

Expand Down Expand Up @@ -1267,8 +1268,18 @@ private void ApplyButton_Click(object sender, EventArgs e)

BuildFilesInSourceFolderList();
ToggleUI(true);
stopwatch.Stop();

if ( ShouldCancelProcessing )
{
StatusMessageLabel.Text = "Command(s) canceled. Some files may have already been processed, or may be in an invalid state.";
}
else
{
StatusMessageLabel.Text = "Command(s) completed. Total time elapsed: " + TimeSpan.FromMilliseconds(stopwatch.ElapsedMilliseconds).ToString(@"hh\:mm\:ss");
}

ShouldCancelProcessing = false;
StatusMessageLabel.Text = "Use %1 as a placeholder for the input filename and %2 for the output filename.";
}

private void ToggleUI(bool isActive)
Expand Down

0 comments on commit 13ee5c6

Please sign in to comment.