Allow overriding file extension in video converter tool

This commit is contained in:
Jaex 2023-05-06 11:24:11 +03:00
parent f9cab94ac3
commit 99791f7af4
2 changed files with 13 additions and 5 deletions

View file

@ -39,14 +39,20 @@ public string OutputFilePath
{ {
get get
{ {
if (string.IsNullOrEmpty(OutputFolderPath) || string.IsNullOrEmpty(OutputFileName)) string path = "";
if (!string.IsNullOrEmpty(OutputFolderPath) && !string.IsNullOrEmpty(OutputFileName))
{ {
return ""; path = Path.Combine(OutputFolderPath, OutputFileName);
if (!Path.HasExtension(OutputFileName))
{
string extension = GetFileExtension();
path = Path.ChangeExtension(path, extension);
}
} }
string path = Path.Combine(OutputFolderPath, OutputFileName); return path;
string extension = GetFileExtension();
return Path.ChangeExtension(path, extension);
} }
} }

View file

@ -143,6 +143,8 @@ private PinToScreenForm(PinToScreenOptions options)
ImageOpacity = Options.InitialOpacity; ImageOpacity = Options.InitialOpacity;
InitializeComponent(); InitializeComponent();
// TODO: Add options form
tsbOptions.Visible = false;
ShareXResources.ApplyTheme(this); ShareXResources.ApplyTheme(this);
TopMost = Options.TopMost; TopMost = Options.TopMost;
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);