Add a warning for unset recording formats

This commit is contained in:
ArsenArsen 2017-07-05 13:01:53 +02:00
parent 7d45d794a6
commit 7d5be857ff

View File

@ -4,6 +4,7 @@
#include "screenshotutil.hpp" #include "screenshotutil.hpp"
#include "settingsdialog.hpp" #include "settingsdialog.hpp"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <colorpicker/colorpickerscene.hpp> #include <colorpicker/colorpickerscene.hpp>
#include <formats.hpp> #include <formats.hpp>
@ -19,7 +20,10 @@ void MainWindow::rec() {
if (controller->isRunning()) return; if (controller->isRunning()) return;
auto f auto f
= static_cast<formats::Recording>(settings::settings().value("recording/format", (int)formats::Recording::None).toInt()); = static_cast<formats::Recording>(settings::settings().value("recording/format", (int)formats::Recording::None).toInt());
if (f >= formats::Recording::None) return; if (f >= formats::Recording::None) {
qWarning() << "Recording format not set in settings. Aborting.";
return;
}
RecordingContext *ctx = new RecordingContext; RecordingContext *ctx = new RecordingContext;
RecordingFormats *format = new RecordingFormats(f); RecordingFormats *format = new RecordingFormats(f);
ctx->consumer = format->getConsumer(); ctx->consumer = format->getConsumer();