Commit 33bfdecd authored by Andreas Traczyk's avatar Andreas Traczyk

photobooth: don't stop the preview when in a call

Change-Id: I6727e96be5af1a70b5fbedcf25628dacce1e6570
parent 68f1c739
......@@ -76,7 +76,9 @@ void PhotoboothWidget::startBooth()
void PhotoboothWidget::stopBooth()
{
LRCInstance::avModel().stopPreview();
if (!LRCInstance::getActiveCalls().size()) {
LRCInstance::avModel().stopPreview();
}
ui->videoFeed->hide();
ui->avatarLabel->show();
takePhotoState_ = false;
......@@ -86,7 +88,9 @@ void PhotoboothWidget::stopBooth()
void
PhotoboothWidget::on_importButton_clicked()
{
LRCInstance::avModel().stopPreview();
if (!LRCInstance::getActiveCalls().size()) {
LRCInstance::avModel().stopPreview();
}
auto picturesDir = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first();
fileName_ = QFileDialog::getOpenFileName(this, tr("Choose File"),
picturesDir,
......@@ -96,7 +100,6 @@ PhotoboothWidget::on_importButton_clicked()
LRCInstance::avModel().startPreview();
return;
}
LRCInstance::avModel().stopPreview();
auto image = Utils::cropImage(QImage(fileName_));
auto avatar = image.scaled(224, 224, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
avatarPixmap_ = QPixmap::fromImage(avatar);
......
......@@ -155,11 +155,7 @@ void SettingsWidget::leaveSettingsSlot()
toggleAdvancedSIPSettings();
}
QtConcurrent::run(
[this] {
ui->currentAccountAvatar->stopBooth();
LRCInstance::avModel().stopPreview();
});
QtConcurrent::run([this] { ui->currentAccountAvatar->stopBooth(); });
emit NavigationRequested(ScreenEnum::CallScreen);
}
......@@ -178,7 +174,9 @@ void SettingsWidget::setSelected(Button sel)
ui->mediaSettingsButton->setChecked(false);
if (pastButton_ == sel) { return; }
QtConcurrent::run( [this] { LRCInstance::avModel().stopPreview(); });
if (!LRCInstance::getActiveCalls().size()) {
QtConcurrent::run( [this] { LRCInstance::avModel().stopPreview(); });
}
if (LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP) {
ui->stackedWidget->setCurrentWidget(ui->currentSIPAccountSettingsScrollWidget);
......@@ -200,7 +198,9 @@ void SettingsWidget::setSelected(Button sel)
ui->mediaSettingsButton->setChecked(false);
if (pastButton_ == sel) { return; }
QtConcurrent::run([this] { LRCInstance::avModel().stopPreview(); });
if (!LRCInstance::getActiveCalls().size()) {
QtConcurrent::run([this] { LRCInstance::avModel().stopPreview(); });
}
ui->stackedWidget->setCurrentWidget(ui->generalSettings);
populateGeneralSettings();
......@@ -961,7 +961,9 @@ void SettingsWidget::slotDeviceBoxCurrentIndexChanged(int index)
.toString().toStdString();
LRCInstance::avModel().setDefaultDevice(currentDisplayedVideoDevice_);
setFormatListForDevice(currentDisplayedVideoDevice_);
showPreview();
if (!LRCInstance::getActiveCalls().size()) {
showPreview();
}
}
void SettingsWidget::slotFormatBoxCurrentIndexChanged(int index)
......
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