+ // validate the trim length
+ bool bValidLen = false;
+ uint tmpLen = ui->trimLenLineEdit->text().toUInt(&bValidLen);
+ bValidLen = bValidLen && (tmpLen > 0 && tmpLen <= m_maxTrimLength);
+
+ if (!bValidLen)
+ {
+ QMessageBox::warning(this, tr("Invalid Trim Count"), tr("Please enter a valid nubmer of frames to trim."),
+ QMessageBox::Ok, QMessageBox::Ok);
+ ui->trimLenLineEdit->setFocus();
+ return;
+ }
+
+ // validate the filename
+ QFile file(ui->trimFileLineEdit->text());
+ if (file.exists())
+ {
+ QString message = ui->trimFileLineEdit->text();
+ message += " already exits.\nWould you like to overwrite it?";
+ int ret = QMessageBox::warning(this, tr("File Already Exists"), tr(message.toStdString().c_str()),
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
+
+ if (ret == QMessageBox::No)
+ {
+ // return so that the user can update the path
+ ui->trimFileLineEdit->setFocus();
+ return;
+ }
+ }