Commit c7ab550e authored by Edric Milaret's avatar Edric Milaret Committed by Stepan Salenikovich

call: add spinner while attempting to call

- Spinner appear until call is current

Refs #75535

Change-Id: I38c9580d49b4a58e0441724d0478acab39ed0929
parent d9ebe238
......@@ -51,6 +51,12 @@ CallWidget::CallWidget(QWidget *parent) :
connect(ui->videoWidget, SIGNAL(setChatVisibility(bool)),
ui->instantMessagingWidget, SLOT(setVisible(bool)));
ui->spinnerLabel->hide();
spinner_ = new QMovie(":/images/spinner.gif");
if (spinner_->isValid()) {
ui->spinnerLabel->setMovie(spinner_);
}
try {
callModel_ = CallModel::instance();
......@@ -107,6 +113,8 @@ CallWidget::CallWidget(QWidget *parent) :
CallWidget::~CallWidget()
{
delete ui;
delete spinner_;
delete menu_;
}
void
......@@ -232,6 +240,7 @@ void
CallWidget::addedCall(Call* call, Call* parent) {
Q_UNUSED(parent);
if (call->direction() == Call::Direction::OUTGOING) {
displaySpinner(true);
setActualCall(call);
}
}
......@@ -243,10 +252,15 @@ CallWidget::callStateChanged(Call* call, Call::State previousState)
if (call == nullptr)
return;
ui->callList->setCurrentIndex(callModel_->getIndex(actualCall_));
if (call->state() == Call::State::OVER || call->state() == Call::State::ERROR) {
if (call->state() == Call::State::OVER
|| call->state() == Call::State::ERROR
|| call->state() == Call::State::FAILURE
|| call->state() == Call::State::ABORTED) {
setActualCall(nullptr);
ui->videoWidget->hide();
displaySpinner(false);
} else if (call->state() == Call::State::CURRENT) {
displaySpinner(false);
ui->videoWidget->show();
}
ui->callStateLabel->setText("Call State : " + call->toHumanStateName());
......@@ -322,3 +336,11 @@ CallWidget::on_sortComboBox_currentIndexChanged(int index)
setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect);
ui->historyList->setModel(CategorizedHistoryModel::SortedProxy::instance()->model());
}
void
CallWidget::displaySpinner(bool display)
{
display ? ui->spinnerLabel->show() : ui->spinnerLabel->hide();
if (ui->spinnerLabel->movie())
display ? ui->spinnerLabel->movie()->start() : ui->spinnerLabel->movie()->stop();
}
......@@ -24,6 +24,7 @@
#include <QString>
#include <QMenu>
#include <QItemSelection>
#include <QMovie>
#include "navwidget.h"
#include "instantmessagingwidget.h"
......@@ -71,9 +72,11 @@ private:
int outputVolume_;
int inputVolume_;
QMenu *menu_;
QMovie *spinner_;
private:
void findRingAccount();
void setActualCall(Call *value);
void displaySpinner(bool display);
};
#endif // CALLWIDGET_H
......@@ -50,6 +50,16 @@
<item>
<widget class="VideoView" name="videoWidget" native="true"/>
</item>
<item>
<widget class="QLabel" name="spinnerLabel">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QWidget" name="callInvite" native="true">
<layout class="QVBoxLayout" name="verticalLayout_4">
......
images/spinner.gif

10.5 KB | W: | H:

images/spinner.gif

29.1 KB | W: | H:

images/spinner.gif
images/spinner.gif
images/spinner.gif
images/spinner.gif
  • 2-up
  • Swipe
  • Onion skin
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