Commit 3aeae3ad authored by Edric Milaret's avatar Edric Milaret

settings: auto start preview video

auto start camera preview on show of settings panel

Refs #74545

Change-Id: I26d2bf439481af53290be48f74f5daa5ac3311fa
parent a9f937f6
......@@ -28,6 +28,7 @@
#include "accountmodel.h"
#include "protocolmodel.h"
#include "accountdetails.h"
#include "callmodel.h"
#include "utils.h"
......@@ -48,17 +49,20 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
this, SLOT(deviceIndexChanged(int)));
connect(ui->accountView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(accountSelected(QItemSelection)));
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(accountSelected(QItemSelection)));
ui->accountView->setCurrentIndex(accountModel_->index(0));
ui->accountDetailLayout->addWidget(accountDetails_);
ui->testVideoButton->setCheckable(true);
ui->accountTypeBox->setModel(accountModel_->protocolModel());
ui->startupBox->setChecked(Utils::CheckStartupLink());
}
void ConfigurationWidget::atExit() {
if (CallModel::instance()->getActiveCalls().size() == 0 ) {
ui->videoView->hide();
Video::PreviewManager::instance()->stopPreview();
}
accountModel_->save();
accountDetails_->save();
}
......@@ -117,7 +121,7 @@ ConfigurationWidget::on_sizeBox_currentIndexChanged(int index)
}
ui->rateBox->setCurrentIndex(
device->channelList()[0]->
activeResolution()->activeRate()->relativeIndex());
activeResolution()->activeRate()->relativeIndex());
isLoading_ = false;
}
......@@ -137,14 +141,6 @@ ConfigurationWidget::accountSelected(QItemSelection itemSel) {
ui->accountView->currentIndex()));
}
void
ConfigurationWidget::on_testVideoButton_toggled(bool checked)
{
checked ? ui->videoView->show() : ui->videoView->hide();
checked ? Video::PreviewManager::instance()->startPreview()
: Video::PreviewManager::instance()->stopPreview();
}
void
ConfigurationWidget::on_deleteAccountButton_clicked()
{
......@@ -158,16 +154,27 @@ void
ConfigurationWidget::on_addAccountButton_clicked()
{
auto account = accountModel_->add("New Account",
ui->accountTypeBox->model()->index(
ui->accountTypeBox->currentIndex(), 0));
ui->accountTypeBox->model()->index(
ui->accountTypeBox->currentIndex(), 0));
account->setRingtonePath(Utils::GetRingtonePath());
accountModel_->save();
}
void ConfigurationWidget::on_startupBox_toggled(bool checked)
void
ConfigurationWidget::on_startupBox_toggled(bool checked)
{
if (checked)
Utils::CreateStartupLink();
else
Utils::DeleteStartupLink();
}
void
ConfigurationWidget::showEvent(QShowEvent* event)
{
QWidget::showEvent(event);
if (CallModel::instance()->getActiveCalls().size() == 0 ) {
ui->videoView->show();
Video::PreviewManager::instance()->startPreview();
}
}
......@@ -42,12 +42,15 @@ public:
~ConfigurationWidget();
void atExit();
protected:
void showEvent(QShowEvent *event);
//UI SLOTS
private slots:
void on_deviceBox_currentIndexChanged(int index);
void on_sizeBox_currentIndexChanged(int index);
void on_rateBox_currentIndexChanged(int index);
void on_testVideoButton_toggled(bool checked);
void on_deleteAccountButton_clicked();
void on_addAccountButton_clicked();
void on_startupBox_toggled(bool checked);
......
......@@ -165,19 +165,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="testVideoButton">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
......
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