Skip to content
Snippets Groups Projects
Commit c7ab550e authored by Edric Milaret's avatar Edric Milaret Committed by Stepan Salenikovich
Browse files

call: add spinner while attempting to call

- Spinner appear until call is current

Refs #75535

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

10.5 KiB | W: | H:

images/spinner.gif

29.1 KiB | W: | H:

images/spinner.gif
images/spinner.gif
images/spinner.gif
images/spinner.gif
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment