Commit 19193410 authored by Olivier SOLDANO's avatar Olivier SOLDANO Committed by Anthony Léonard

add active hint of call process on outgoing call

add a cycling gif to the outbound call page of callwidget
to show that the process of the call is ongoing and has not
froze.

Change-Id: I0014b0716b095b526bd4a7cb7bf8ea9632a4d156
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent a9826411
......@@ -173,6 +173,10 @@ CallWidget::CallWidget(QWidget* parent) :
connect(ui->videoWidget, &VideoView::videoSettingsClicked, this, &CallWidget::settingsButtonClicked);
connect(ui->videoWidget, &VideoView::videoBackClicked, [=]{setActualCall(nullptr);
backToWelcomePage();});
// setup searchingfor mini spinner
miniSpinner_ = new QMovie(":/images/waiting.gif");
ui->spinnerLabel->setMovie(miniSpinner_);
ui->spinnerLabel->hide();
} catch (const std::exception& e) {
qDebug() << "INIT ERROR" << e.what();
......@@ -458,6 +462,7 @@ CallWidget::callStateToView(Call* value)
case Call::State::CONFERENCE:
case Call::State::HOLD:
ui->stackedWidget->setCurrentWidget(ui->videoPage);
hideMiniSpinner();
break;
case Call::State::OVER:
ui->stackedWidget->setCurrentWidget(ui->welcomePage);
......@@ -465,10 +470,13 @@ CallWidget::callStateToView(Call* value)
case Call::State::FAILURE:
case Call::State::ERROR:
on_cancelButton_clicked();
hideMiniSpinner();
break;
case Call::State::INITIALIZATION:
case Call::State::CONNECTED:
case Call::State::RINGING:
miniSpinner_->start();
ui->spinnerLabel->show();
ui->stackedWidget->setCurrentWidget(ui->outboundCallPage);
break;
default:
......@@ -862,6 +870,14 @@ CallWidget::backToWelcomePage()
disconnect(imConnection_);
}
void CallWidget::hideMiniSpinner()
{
if(ui->spinnerLabel->isVisible()){
miniSpinner_->stop();
ui->spinnerLabel->hide();
}
}
void
CallWidget::on_imBackButton_clicked()
{
......
......@@ -115,6 +115,7 @@ private:
QMetaObject::Connection crListSelectionConnection_;
QPropertyAnimation* pageAnim_;
QMenu* shareMenu_;
QMovie* miniSpinner_;
constexpr static int animDuration_ = 200; //msecs
constexpr static int qrSize_ = 200;
......@@ -132,4 +133,5 @@ private:
void processContactLineEdit();
static Account* getSelectedAccount();
void backToWelcomePage();
void hideMiniSpinner();
};
......@@ -1602,6 +1602,25 @@
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="spinnerLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QPushButton" name="cancelButton">
<property name="sizePolicy">
......
......@@ -43,5 +43,6 @@
<file>images/FontAwesome.otf</file>
<file>images/icons/ic_chat_black_24dp_2x.png</file>
<file>images/icons/ic_person_add_black_24dp_2x.png</file>
<file>images/waiting.gif</file>
</qresource>
</RCC>
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