Add "yes to all" to proxydialog.cpp

change
This commit is contained in:
alexmitchell
2019-02-10 15:44:41 +10:30
parent 95ed9617b2
commit 121b4f52ea
+17 -9
View File
@@ -70,6 +70,7 @@ ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Footage *> &footage) :
void ProxyDialog::accept() {
QVector<ProxyInfo> info_list;
bool yesForAll = false;
for (int i=0;i<selected_footage.size();i++) {
// loop through selected footage and send info to the proxy queue
@@ -97,19 +98,26 @@ void ProxyDialog::accept() {
info.path = QDir(custom_location).filePath(base_footage_fn);
}
// if the proposed proxy file already exists
if (QFileInfo::exists(info.path) && QMessageBox::warning(this,
tr("Proxy file exists"),
tr("The file \"%1\" already exists. Do you wish to replace it?").arg(info.path),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
// return to dialog without closing or starting any proxy generation
return;
// if the proposed proxy file already exists & user didn't select YesToAll box
if (QFileInfo::exists(info.path) && !yesForAll){
int rtn = QMessageBox::warning( this,
tr("Proxy file exists"),
tr("The file \"%1\" already exists. Do you wish to replace it?").arg(info.path),
QMessageBox::YesToAll | QMessageBox::Yes | QMessageBox::No);
// return to dialog without closing or starting any proxy generation
switch (rtn){
case QMessageBox::Yes:
break;
case QMessageBox::YesToAll:
yesForAll = true;
break;
case QMessageBox::No:
return;
}
}
// send to proxy generator thread
info_list.append(info);
}
// all proxy info checks out, queue it with the proxy generator
for (int i=0;i<info_list.size();i++) {
info_list.at(i).footage->proxy = true;