Commit fb5fc5c5 authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

configuration: fix video display only on video tab

Introcuded by changes 2774

Issue: #80643
Change-Id: I6519ec473a5c290c93b9b03aa90c9024bd2afae1
parent b46f6499
......@@ -73,11 +73,32 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
CategorizedHistoryModel::instance()->historyLimit());
ui->closeOrMinCheckBox->setChecked(settings_.value(
SettingsKey::closeOrMinimized).toBool());
connect(ui->tabWidget, QTabWidget::currentChanged, [](int index) {
if (index == 1
&& CallModel::instance()->getActiveCalls().size() == 0) {
Video::PreviewManager::instance()->startPreview();
} else {
if (CallModel::instance()->getActiveCalls().size() == 0
&& Video::PreviewManager::instance()->isPreviewing()) {
Video::PreviewManager::instance()->stopPreview();
}
}
});
}
void
ConfigurationWidget::showEvent(QShowEvent *event) {
QWidget::showEvent(event);
if (ui->tabWidget->currentIndex() == 1
&& CallModel::instance()->getActiveCalls().size() == 0) {
Video::PreviewManager::instance()->startPreview();
}
}
void ConfigurationWidget::atExit() {
if (CallModel::instance()->getActiveCalls().size() == 0 ) {
ui->videoView->hide();
void
ConfigurationWidget::atExit() {
if (CallModel::instance()->getActiveCalls().size() == 0
&& Video::PreviewManager::instance()->isPreviewing()) {
Video::PreviewManager::instance()->stopPreview();
}
accountModel_->save();
......@@ -190,16 +211,6 @@ ConfigurationWidget::on_startupBox_toggled(bool checked)
Utils::DeleteStartupLink();
}
void
ConfigurationWidget::showEvent(QShowEvent* event)
{
QWidget::showEvent(event);
if (CallModel::instance()->getActiveCalls().size() == 0 ) {
ui->videoView->show();
Video::PreviewManager::instance()->startPreview();
}
}
void
ConfigurationWidget::on_clearHistoryButton_clicked()
{
......
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