mirror of
https://github.com/vanilla-wiiu/vanilla.git
synced 2025-01-22 08:11:47 -05:00
retry if save failed
This commit is contained in:
parent
c30798680d
commit
4776e10a76
1 changed files with 13 additions and 3 deletions
|
@ -424,14 +424,24 @@ void MainWindow::recordingError(int err)
|
|||
|
||||
void MainWindow::recordingFinished(const QString &filename)
|
||||
{
|
||||
QString s = QFileDialog::getSaveFileName(this, tr("Save Screenshot"), QString(), tr("MPEG-4 Video (*.mp4)"));
|
||||
if (!s.isEmpty()) {
|
||||
while (1) {
|
||||
QString s = QFileDialog::getSaveFileName(this, tr("Save Screenshot"), QString(), tr("MPEG-4 Video (*.mp4)"));
|
||||
if (s.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
|
||||
QString ext = QStringLiteral(".mp4");
|
||||
if (!s.endsWith(ext, Qt::CaseInsensitive)) {
|
||||
s = s.append(ext);
|
||||
}
|
||||
|
||||
QFile::copy(filename, s);
|
||||
if ((!QFile::exists(s) || QFile::remove(s)) && QFile::copy(filename, s)) {
|
||||
// Copied file successfully
|
||||
break;
|
||||
}
|
||||
|
||||
// Failed to write file
|
||||
QMessageBox::warning(this, tr("Save Failed"), tr("Failed to save to location '%0'. Please try another location.").arg(s));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue