Added: filename in title

This commit is contained in:
Ray 2021-11-03 00:31:50 +00:00
parent d127549a5f
commit b6fc9beb86
3 changed files with 18 additions and 0 deletions

View File

@ -60,6 +60,15 @@ namespace VideoPreview {
}
}
/// <summary>
/// Looks up a localized string similar to Video Preview.
/// </summary>
internal static string AppName {
get {
return ResourceManager.GetString("AppName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AppName" xml:space="preserve">
<value>Video Preview</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="loading_block" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\loading-block.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

View File

@ -99,6 +99,9 @@ namespace VideoPreview
/// <param name="e"></param>
private async void button3_MouseClick(object sender, MouseEventArgs e)
{
if (this.IsBusy) return;
if (string.IsNullOrWhiteSpace(textBox1.Text)) return;
await ReadVideoFile(textBox1.Text);
}
@ -166,6 +169,7 @@ namespace VideoPreview
videoFilename = null;
videoDuration = TimeSpan.FromSeconds(0);
ThreadControl.SetText(this, AppResource.AppName);
textBox1.Text = string.Empty;
ThreadControl.SetText(label5, "-");
ThreadControl.SetText(label7, "-");
@ -279,6 +283,8 @@ namespace VideoPreview
videoFilename = filename;
videoDuration = inputFile.Metadata.Duration;
ThreadControl.SetText(this, Path.GetFileName(filename) + " - " + AppResource.AppName);
textBox1.Text = videoFilename;
ThreadControl.SetText(label5, inputFile.Metadata.VideoData.Format ?? string.Empty);
ThreadControl.SetText(label7, (inputFile.Metadata.VideoData.FrameSize ?? string.Empty) + " @ " + inputFile.Metadata.VideoData.Fps.ToString() + "FPS");