Commit eb4700b9 authored by Yang Wang's avatar Yang Wang

videooverlay: fix reverse state of no_mic and no_video buttons

Change-Id: I716be72415324018ffbbc7255a60290ecdeeef59
Gitlab: #482
parent c7be1ee8
......@@ -81,5 +81,6 @@
<file>images/icons/baseline-desktop_windows-24px.svg</file>
<file>images/icons/baseline-people-24px.svg</file>
<file>images/icons/round-add_a_photo-24px.svg</file>
<file>images/icons/ic_mic_white_24dp.png</file>
</qresource>
</RCC>
......@@ -688,6 +688,9 @@
<ItemGroup>
<ResourceCompile Include="ico.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="images\icons\ic_mic_white_24dp.png" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />
......
......@@ -787,4 +787,9 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="images\icons\ic_mic_white_24dp.png">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -36,12 +36,10 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
ui->chatButton->setCheckable(true);
setAttribute(Qt::WA_NoSystemBackground);
ui->noMicButton->setCheckable(true);
ui->onHoldLabel->setVisible(false);
setAttribute(Qt::WA_NoSystemBackground);
ui->recButton->setVisible(false);
}
......@@ -146,30 +144,24 @@ VideoOverlay::on_holdButton_clicked()
}
void
VideoOverlay::on_noMicButton_clicked()
VideoOverlay::on_noMicButton_toggled(bool checked)
{
auto selectedConvUid = LRCInstance::getSelectedConvUid();
auto conversation = Utils::getConversationFromUid(selectedConvUid,
*LRCInstance::getCurrentConversationModel());
auto& callId = conversation->callId;
bool btn_status = false;
auto callModel = LRCInstance::getCurrentCallModel();
if (callModel->hasCall(callId)) {
ui->noMicButton->setChecked(callModel->getCall(callId).audioMuted);
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::AUDIO);
if (callModel->hasCall(callId_)) {
callModel->toggleMedia(callId_, lrc::api::NewCallModel::Media::AUDIO);
btn_status = callModel->getCall(callId_).audioMuted;
}
}
void
VideoOverlay::on_noVideoButton_clicked()
VideoOverlay::on_noVideoButton_toggled(bool checked)
{
auto selectedConvUid = LRCInstance::getSelectedConvUid();
auto conversation = Utils::getConversationFromUid(selectedConvUid,
*LRCInstance::getCurrentConversationModel());
auto& callId = conversation->callId;
bool btn_status = false;
auto callModel = LRCInstance::getCurrentCallModel();
if (callModel->hasCall(callId)) {
ui->noVideoButton->setChecked(callModel->getCall(callId).videoMuted);
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::VIDEO);
if (callModel->hasCall(callId_)) {
callModel->toggleMedia(callId_, lrc::api::NewCallModel::Media::VIDEO);
btn_status = callModel->getCall(callId_).videoMuted;
}
}
......
......@@ -50,8 +50,8 @@ private slots:
void on_hangupButton_clicked();
void on_chatButton_toggled(bool checked);
void on_holdButton_clicked();
void on_noMicButton_clicked();
void on_noVideoButton_clicked();
void on_noMicButton_toggled(bool checked);
void on_noVideoButton_toggled(bool checked);
void on_recButton_clicked();
private:
......
......@@ -166,7 +166,10 @@
</property>
<property name="icon">
<iconset resource="ressources.qrc">
<normaloff>:/images/icons/ic_mic_off_white_24dp.png</normaloff>:/images/icons/ic_mic_off_white_24dp.png</iconset>
<normaloff>:/images/icons/ic_mic_white_24dp.png</normaloff>
<normalon>:/images/icons/ic_mic_off_white_24dp.png</normalon>
<disabledoff>:/images/icons/ic_mic_off_white_24dp.png</disabledoff>
<disabledon>:/images/icons/ic_mic_off_white_24dp.png</disabledon>:/images/icons/ic_mic_white_24dp.png</iconset>
</property>
<property name="iconSize">
<size>
......@@ -207,7 +210,10 @@
</property>
<property name="icon">
<iconset resource="ressources.qrc">
<normaloff>:/images/icons/ic_videocam_off_white_24dp.png</normaloff>:/images/icons/ic_videocam_off_white_24dp.png</iconset>
<normaloff>:/images/icons/ic_videocam_white.png</normaloff>
<normalon>:/images/icons/ic_videocam_off_white_24dp.png</normalon>
<disabledoff>:/images/icons/ic_videocam_off_white_24dp.png</disabledoff>
<disabledon>:/images/icons/ic_videocam_off_white_24dp.png</disabledon>:/images/icons/ic_videocam_white.png</iconset>
</property>
<property name="iconSize">
<size>
......
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