Commit fd5a1f23 authored by Edric Milaret's avatar Edric Milaret

settings: add recording settings

Change-Id: I7bc3309e546f49c949aca0b868f7afe83a8946c0
Tuleap: #355
parent a5fe70f1
......@@ -20,6 +20,9 @@
#include "ui_configurationwidget.h"
#include <QMessageBox>
#include <QDir>
#include <QStandardPaths>
#include <QFileDialog>
#include "video/devicemodel.h"
#include "video/channel.h"
......@@ -27,6 +30,8 @@
#include "video/rate.h"
#include "video/previewmanager.h"
#include "media/recordingmodel.h"
#include "accountserializationadapter.h"
#include "accountstatedelegate.h"
#include "settingskey.h"
......@@ -87,6 +92,19 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
});
ui->videoView->setIsFullPreview(true);
auto recordPath = Media::RecordingModel::instance().recordPath();
if (recordPath.isEmpty()) {
recordPath = QDir::toNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
Media::RecordingModel::instance().setRecordPath(recordPath);
}
ui->recordPath->setText(Media::RecordingModel::instance().recordPath());
ui->alwaysRecordCheckBox->setChecked(Media::RecordingModel::instance().isAlwaysRecording());
connect(ui->alwaysRecordCheckBox, &QCheckBox::clicked, [](bool checked){
Media::RecordingModel::instance().setAlwaysRecording(checked);
});
#ifndef ENABLE_AUTOUPDATE
ui->checkUpdateButton->hide();
ui->intervalUpdateCheckSpinBox->hide();
......@@ -272,3 +290,16 @@ ConfigurationWidget::on_tabWidget_currentChanged(int index)
Q_UNUSED(index)
showPreview();
}
void
ConfigurationWidget::on_recordPath_clicked()
{
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose Directory"),
Media::RecordingModel::instance().recordPath(),
QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks);
if (not dir.isEmpty()) {
Media::RecordingModel::instance().setRecordPath(dir);
ui->recordPath->setText(dir);
}
}
......@@ -60,6 +60,7 @@ private slots:
void on_autoUpdateCheckBox_toggled(bool checked);
void on_intervalUpdateCheckSpinBox_valueChanged(int arg1);
void on_tabWidget_currentChanged(int index);
void on_recordPath_clicked();
private slots:
void accountSelected(QItemSelection itemSel);
......
......@@ -107,6 +107,73 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Record Settings</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Save in :</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="recordPath">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ressources.qrc">
<normaloff>:/images/folder-download.png</normaloff>:/images/folder-download.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="alwaysRecordCheckBox">
<property name="text">
<string>Always Record</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="font">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment