Skip to content

Commit

Permalink
Install default render presets #220
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 14, 2024
1 parent 777f520 commit 521bb9f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/app/GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,38 @@ void MainWindow::closedRenderQueueWindow()
tr("Queue"));
}

void MainWindow::initRenderPresets()
{
if (!AppSupport::getSettings("settings",
"firstRunRenderPresets",
true).toBool()) { return; }
const QString path = AppSupport::getAppOutputProfilesPath();

QStringList presets;
presets << "001-friction-preset-mp4-h264.conf";
presets << "002-friction-preset-mp4-h264-mp3.conf";
presets << "003-friction-preset-prores-444.conf";
presets << "004-friction-preset-prores-444-aac.conf";
presets << "005-friction-preset-png.conf";
presets << "006-friction-preset-tiff.conf";

for (const auto &preset : presets) {
QString filePath(QString("%1/%2").arg(path, preset));
if (QFile::exists(filePath)) { continue; }
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QFile res(QString(":/presets/render/%1").arg(preset));
if (res.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.write(res.readAll());
res.close();
}
file.close();
}
}

AppSupport::setSettings("settings", "firstRunRenderPresets", false);
}

void MainWindow::openWelcomeDialog()
{
mStackWidget->setCurrentIndex(mStackIndexWelcome);
Expand Down Expand Up @@ -1682,6 +1714,8 @@ void MainWindow::readSettings(const QString &openProject)

updateAutoSaveBackupState();

initRenderPresets();

if (!openProject.isEmpty()) {
QTimer::singleShot(10,
this,
Expand Down
2 changes: 2 additions & 0 deletions src/app/GUI/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ class MainWindow : public QMainWindow
void openRenderQueueWindow();
void closedRenderQueueWindow();

void initRenderPresets();

protected:
void keyPressEvent(QKeyEvent *event);
bool eventFilter(QObject *obj, QEvent *e);
Expand Down

0 comments on commit 521bb9f

Please sign in to comment.