mirror of https://github.com/PCSX2/pcsx2.git
GSdx-Capture: Append a missing .avi extension
Filenames of zero length do not allow OK to be pressed.
This commit is contained in:
parent
e8b16bb145
commit
bd91a571a6
|
@ -417,11 +417,24 @@ bool GSCapture::BeginCapture(float fps, GSVector2i recommendedResolution, float
|
||||||
|
|
||||||
GSCaptureDlg dlg;
|
GSCaptureDlg dlg;
|
||||||
|
|
||||||
if(IDOK != dlg.DoModal()) return false;
|
if (IDOK != dlg.DoModal())
|
||||||
|
return false;
|
||||||
|
|
||||||
m_size.x = (dlg.m_width + 7) & ~7;
|
m_size.x = (dlg.m_width + 7) & ~7;
|
||||||
m_size.y = (dlg.m_height + 7) & ~7;
|
m_size.y = (dlg.m_height + 7) & ~7;
|
||||||
|
|
||||||
|
{
|
||||||
|
int start = dlg.m_filename.length() - 4;
|
||||||
|
if (start > 0)
|
||||||
|
{
|
||||||
|
std::string test = dlg.m_filename.substr(start);
|
||||||
|
std::transform(test.begin(), test.end(), test.begin(), tolower);
|
||||||
|
if (test.compare(".avi") != 0)
|
||||||
|
dlg.m_filename += ".avi";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dlg.m_filename += ".avi";
|
||||||
|
}
|
||||||
std::wstring fn{dlg.m_filename.begin(), dlg.m_filename.end()};
|
std::wstring fn{dlg.m_filename.begin(), dlg.m_filename.end()};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -155,6 +155,11 @@ bool GSCaptureDlg::OnCommand(HWND hWnd, UINT id, UINT code)
|
||||||
{
|
{
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
case IDC_FILENAME:
|
||||||
|
{
|
||||||
|
EnableWindow(GetDlgItem(m_hWnd, IDOK), GetText(IDC_FILENAME).length() != 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
case IDC_BROWSE:
|
case IDC_BROWSE:
|
||||||
{
|
{
|
||||||
if (code == BN_CLICKED)
|
if (code == BN_CLICKED)
|
||||||
|
|
Loading…
Reference in New Issue