Commit d8528fa2 authored by Edric Milaret's avatar Edric Milaret

call: add cancel button for dialing call

Refs #76414

Change-Id: I5d9c160f64c93205be275ad09a3e08b055de0380
parent 4f63084e
......@@ -49,7 +49,7 @@ CallWidget::CallWidget(QWidget *parent) :
connect(ui->videoWidget, SIGNAL(setChatVisibility(bool)),
ui->instantMessagingWidget, SLOT(setVisible(bool)));
ui->spinnerLabel->hide();
ui->spinnerWidget->hide();
spinner_ = new QMovie(":/images/spinner.gif");
if (spinner_->isValid()) {
ui->spinnerLabel->setMovie(spinner_);
......@@ -262,7 +262,7 @@ CallWidget::callStateChanged(Call* call, Call::State previousState)
ui->videoWidget->hide();
displaySpinner(false);
auto onHoldCall = callModel_->getActiveCalls().first();
if (onHoldCall != nullptr) {
if (onHoldCall != nullptr && onHoldCall->state() == Call::State::HOLD) {
setActualCall(onHoldCall);
onHoldCall->performAction(Call::Action::HOLD);
}
......@@ -349,7 +349,13 @@ CallWidget::on_sortComboBox_currentIndexChanged(int index)
void
CallWidget::displaySpinner(bool display)
{
display ? ui->spinnerLabel->show() : ui->spinnerLabel->hide();
display ? ui->spinnerWidget->show() : ui->spinnerWidget->hide();
if (ui->spinnerLabel->movie())
display ? ui->spinnerLabel->movie()->start() : ui->spinnerLabel->movie()->stop();
}
void CallWidget::on_cancelButton_clicked()
{
if (actualCall_)
actualCall_->performAction(Call::Action::REFUSE);
}
......@@ -66,6 +66,8 @@ private slots:
void findRingAccount(QModelIndex idx1, QModelIndex idx2, QVector<int> vec);
void checkRegistrationState(Account* account,Account::RegistrationState state);
void on_cancelButton_clicked();
private:
Ui::CallWidget *ui;
Call* actualCall_;
......
......@@ -51,13 +51,32 @@
<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 class="QWidget" name="spinnerWidget" native="true">
<layout class="QVBoxLayout" name="spinnerLayout">
<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">
<widget class="QPushButton" name="cancelButton">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
......
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