Commit ef9b85b8 authored by Edric Milaret's avatar Edric Milaret

fix undesired effect of warning label on preview during call

Change-Id: I1d8b4a16c883e404f4d06c10a9891bf9fa5a8daf
Tuleap: #277
parent b1b00cee
...@@ -95,6 +95,19 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) : ...@@ -95,6 +95,19 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
#endif #endif
} }
void ConfigurationWidget::showPreview()
{
if (ui->tabWidget->currentIndex() == 1
&& CallModel::instance().getActiveCalls().size() == 0) {
ui->previewUnavailable->hide();
ui->videoView->show();
Video::PreviewManager::instance().startPreview();
} else {
ui->previewUnavailable->show();
ui->videoView->hide();
}
}
void void
ConfigurationWidget::showEvent(QShowEvent *event) { ConfigurationWidget::showEvent(QShowEvent *event) {
...@@ -105,15 +118,7 @@ ConfigurationWidget::showEvent(QShowEvent *event) { ...@@ -105,15 +118,7 @@ ConfigurationWidget::showEvent(QShowEvent *event) {
ui->intervalUpdateCheckSpinBox->setValue(win_sparkle_get_update_check_interval() / 86400); ui->intervalUpdateCheckSpinBox->setValue(win_sparkle_get_update_check_interval() / 86400);
#endif #endif
QWidget::showEvent(event); QWidget::showEvent(event);
if (ui->tabWidget->currentIndex() == 1 showPreview();
&& CallModel::instance().getActiveCalls().size() == 0) {
ui->previewUnavailable->hide();
ui->videoView->show();
Video::PreviewManager::instance().startPreview();
} else {
ui->previewUnavailable->show();
ui->videoView->hide();
}
} }
void void
...@@ -260,3 +265,10 @@ ConfigurationWidget::on_intervalUpdateCheckSpinBox_valueChanged(int arg1) ...@@ -260,3 +265,10 @@ ConfigurationWidget::on_intervalUpdateCheckSpinBox_valueChanged(int arg1)
win_sparkle_set_update_check_interval(arg1 * 86400); win_sparkle_set_update_check_interval(arg1 * 86400);
#endif #endif
} }
void
ConfigurationWidget::on_tabWidget_currentChanged(int index)
{
Q_UNUSED(index)
showPreview();
}
...@@ -59,6 +59,7 @@ private slots: ...@@ -59,6 +59,7 @@ private slots:
void on_checkUpdateButton_clicked(); void on_checkUpdateButton_clicked();
void on_autoUpdateCheckBox_toggled(bool checked); void on_autoUpdateCheckBox_toggled(bool checked);
void on_intervalUpdateCheckSpinBox_valueChanged(int arg1); void on_intervalUpdateCheckSpinBox_valueChanged(int arg1);
void on_tabWidget_currentChanged(int index);
private slots: private slots:
void accountSelected(QItemSelection itemSel); void accountSelected(QItemSelection itemSel);
...@@ -73,5 +74,6 @@ private: ...@@ -73,5 +74,6 @@ private:
AccountDetails* accountDetails_; AccountDetails* accountDetails_;
AccountStateDelegate *accountStateDelegate_; AccountStateDelegate *accountStateDelegate_;
QSettings settings_; QSettings settings_;
void showPreview();
}; };
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