Commit ea6d71b1 authored by Olivier SOLDANO's avatar Olivier SOLDANO

ui: patch to correct behaviour of smartlist when switching calls

Corrects the absence of focus when switching automatically to a
call on hold when closing another call

Change-Id: I0084dae844936e15e118a68f0ff443cd9e18868c
Tuleap: #1314
parent 703caba4
......@@ -177,6 +177,17 @@ CallWidget::CallWidget(QWidget* parent) :
this,
SLOT(smartListCurrentChanged(QModelIndex,QModelIndex)));
connect(RecentModel::instance().selectionModel(), &QItemSelectionModel::selectionChanged, [=](const QItemSelection &selected, const QItemSelection &deselected) {
// lambda used to focus on the correct smartList element when switching automatically between two calls
Q_UNUSED(deselected)
if (selected.size()) {
auto idx = selected.indexes().first();
auto realIdx = RecentModel::instance().peopleProxy()->mapFromSource(idx);
ui->smartList->selectionModel()->setCurrentIndex(realIdx, QItemSelectionModel::ClearAndSelect);
} else
ui->smartList->clearSelection();
});
connect(&NameDirectory::instance(), SIGNAL(registeredNameFound(const Account*,NameDirectory::LookupStatus,const QString&,const QString&)),
this, SLOT(contactLineEdit_registeredNameFound(const Account*,NameDirectory::LookupStatus,const QString&,const QString&)));
......@@ -455,11 +466,13 @@ CallWidget::callStateChanged(Call* call, Call::State previousState)
|| call != actualCall_)
return;
callStateToView(call);
if (call->state() == Call::State::OVER) {
setActualCall(nullptr);
ui->smartList->clearSelection();
RecentModel::instance().selectionModel()->clear();
}
callStateToView(call);
}
void
......@@ -527,6 +540,7 @@ void CallWidget::callStateToView(Call* value)
ui->stackedWidget->setCurrentWidget(ui->videoPage);
break;
case Call::State::OVER:
ui->stackedWidget->setCurrentWidget(ui->welcomePage);
break;
case Call::State::FAILURE:
case Call::State::ERROR:
......
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