Added AVI overwrite warning dialog to Qt GUI.

This commit is contained in:
mjbudd77 2021-08-11 21:26:02 -04:00
parent a571677cdb
commit 136ae9a336
1 changed files with 25 additions and 0 deletions

View File

@ -30,6 +30,9 @@
#include <vfw.h> #include <vfw.h>
#endif #endif
#include <QObject>
#include <QMessageBox>
#include "driver.h" #include "driver.h"
#include "common/os_utils.h" #include "common/os_utils.h"
@ -490,6 +493,28 @@ int aviRecordOpenFile( const char *filepath )
} }
} }
if ( fileName[0] != 0 )
{
QFile file(fileName);
if ( file.exists() )
{
int ret;
std::string msg;
msg = "Pre-existing AVI file will be overwritten:\n\n" +
std::string(fileName) + "\n\nReplace file?";
ret = QMessageBox::warning( consoleWindow, QObject::tr("Overwrite Warning"),
QString::fromStdString(msg), QMessageBox::Yes | QMessageBox::No );
if ( ret == QMessageBox::No )
{
return -1;
}
}
}
if ( gwavi != NULL ) if ( gwavi != NULL )
{ {
delete gwavi; gwavi = NULL; delete gwavi; gwavi = NULL;