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
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>images/icons/outline-info-24px.svg</file> <file>images/icons/outline-info-24px.svg</file>
<file>images/icons/baseline-camera_alt-24px.svg</file> <file>images/icons/baseline-camera_alt-24px.svg</file>
<file>images/icons/baseline-refresh-24px.svg</file> <file>images/icons/baseline-refresh-24px.svg</file>
<file>images/jami_rolling_spinner.gif</file> <file>images/jami_rolling_spinner.gif</file>
<file>images/icons/baseline-close-24px.svg</file> <file>images/icons/baseline-close-24px.svg</file>
<file>images/icons/baseline-done-24px.svg</file> <file>images/icons/baseline-done-24px.svg</file>
<file>images/icons/baseline-error_outline-24px.svg</file> <file>images/icons/baseline-error_outline-24px.svg</file>
<file>stylesheet.css</file> <file>stylesheet.css</file>
<file>images/ajax-loader.gif</file> <file>images/ajax-loader.gif</file>
<file>images/default_avatar_overlay.svg</file> <file>images/default_avatar_overlay.svg</file>
<file>images/FontAwesome.otf</file> <file>images/FontAwesome.otf</file>
<file>images/logo-jami-standard-coul.png</file> <file>images/logo-jami-standard-coul.png</file>
<file>images/qrcode.png</file> <file>images/qrcode.png</file>
<file>images/jami.ico</file> <file>images/jami.ico</file>
<file>images/jami.png</file> <file>images/jami.png</file>
<file>images/waiting.gif</file> <file>images/waiting.gif</file>
<file>images/icons/ic_add_black_18dp_2x.png</file> <file>images/icons/ic_add_black_18dp_2x.png</file>
<file>images/icons/ic_arrow_back_24px.svg</file> <file>images/icons/ic_arrow_back_24px.svg</file>
<file>images/icons/ic_arrow_back_white_24dp.png</file> <file>images/icons/ic_arrow_back_white_24dp.png</file>
<file>images/icons/ic_arrow_drop_down_black_9dp_2x.png</file> <file>images/icons/ic_arrow_drop_down_black_9dp_2x.png</file>
<file>images/icons/ic_arrow_drop_down_black_18dp_2x.png</file> <file>images/icons/ic_arrow_drop_down_black_18dp_2x.png</file>
<file>images/icons/ic_arrow_drop_up_black_9dp_2x.png</file> <file>images/icons/ic_arrow_drop_up_black_9dp_2x.png</file>
<file>images/icons/ic_arrow_drop_up_black_18dp_2x.png</file> <file>images/icons/ic_arrow_drop_up_black_18dp_2x.png</file>
<file>images/icons/ic_arrow_forward_white_48dp_2x.png</file> <file>images/icons/ic_arrow_forward_white_48dp_2x.png</file>
<file>images/icons/ic_arrow_tab_next_black_9dp_2x.png</file> <file>images/icons/ic_arrow_tab_next_black_9dp_2x.png</file>
<file>images/icons/ic_arrow_tab_previous_black_9dp_2x.png</file> <file>images/icons/ic_arrow_tab_previous_black_9dp_2x.png</file>
<file>images/icons/ic_block_24px.svg</file> <file>images/icons/ic_block_24px.svg</file>
<file>images/icons/ic_call_transfer_white_24px.png</file> <file>images/icons/ic_call_transfer_white_24px.png</file>
<file>images/icons/ic_chat_black_24dp_2x.png</file> <file>images/icons/ic_chat_black_24dp_2x.png</file>
<file>images/icons/ic_chat_white_24dp.png</file> <file>images/icons/ic_chat_white_24dp.png</file>
<file>images/icons/ic_check_white_18dp_2x.png</file> <file>images/icons/ic_check_white_18dp_2x.png</file>
<file>images/icons/ic_clear_24px.svg</file> <file>images/icons/ic_clear_24px.svg</file>
<file>images/icons/ic_close_white_24dp.png</file> <file>images/icons/ic_close_white_24dp.png</file>
<file>images/icons/ic_content_copy_white_24dp.png</file> <file>images/icons/ic_content_copy_white_24dp.png</file>
<file>images/icons/ic_delete_black_18dp_2x.png</file> <file>images/icons/ic_delete_black_18dp_2x.png</file>
<file>images/icons/ic_done_white_24dp.png</file> <file>images/icons/ic_done_white_24dp.png</file>
<file>images/icons/ic_folder_black_18dp_2x.png</file> <file>images/icons/ic_folder_black_18dp_2x.png</file>
<file>images/icons/ic_group_add_white_24dp.png</file> <file>images/icons/ic_group_add_white_24dp.png</file>
<file>images/icons/ic_high_quality_white_24dp.png</file> <file>images/icons/ic_high_quality_white_24dp.png</file>
<file>images/icons/ic_mic_off_white_24dp.png</file> <file>images/icons/ic_mic_off_white_24dp.png</file>
<file>images/icons/ic_pause_white_24dp.png</file> <file>images/icons/ic_pause_white_24dp.png</file>
<file>images/icons/ic_pause_white_100px.png</file> <file>images/icons/ic_pause_white_100px.png</file>
<file>images/icons/ic_person_add_black_24dp_2x.png</file> <file>images/icons/ic_person_add_black_24dp_2x.png</file>
<file>images/icons/ic_person_add_white_24dp.png</file> <file>images/icons/ic_person_add_white_24dp.png</file>
<file>images/icons/ic_phone_24px.svg</file> <file>images/icons/ic_phone_24px.svg</file>
<file>images/icons/ic_photo_camera_white_24dp_2x.png</file> <file>images/icons/ic_photo_camera_white_24dp_2x.png</file>
<file>images/icons/ic_search_black_18dp_2x.png</file> <file>images/icons/ic_search_black_18dp_2x.png</file>
<file>images/icons/ic_send_24px.svg</file> <file>images/icons/ic_send_24px.svg</file>
<file>images/icons/ic_send_white_24dp.png</file> <file>images/icons/ic_send_white_24dp.png</file>
<file>images/icons/ic_settings_white_48dp_2x.png</file> <file>images/icons/ic_settings_white_48dp_2x.png</file>
<file>images/icons/ic_share_black_48dp_2x.png</file> <file>images/icons/ic_share_black_48dp_2x.png</file>
<file>images/icons/ic_video_call_24px.svg</file> <file>images/icons/ic_video_call_24px.svg</file>
<file>images/icons/ic_videocam_off_white_24dp.png</file> <file>images/icons/ic_videocam_off_white_24dp.png</file>
<file>images/icons/ic_videocam_white.png</file> <file>images/icons/ic_videocam_white.png</file>
<file>images/icons/ic_voicemail_white_24dp_2x.png</file> <file>images/icons/ic_voicemail_white_24dp_2x.png</file>
<file>images/icons/round-add-24px.svg</file> <file>images/icons/round-add-24px.svg</file>
<file>images/icons/round-arrow_drop_down-24px.svg</file> <file>images/icons/round-arrow_drop_down-24px.svg</file>
<file>images/icons/round-arrow_drop_up-24px.svg</file> <file>images/icons/round-arrow_drop_up-24px.svg</file>
<file>images/icons/round-arrow_right-24px.svg</file> <file>images/icons/round-arrow_right-24px.svg</file>
<file>images/icons/round-close-24px.svg</file> <file>images/icons/round-close-24px.svg</file>
<file>images/icons/round-edit-24px.svg</file> <file>images/icons/round-edit-24px.svg</file>
<file>images/icons/round-folder-24px.svg</file> <file>images/icons/round-folder-24px.svg</file>
<file>images/icons/round-remove_circle-24px.svg</file> <file>images/icons/round-remove_circle-24px.svg</file>
<file>images/icons/round-settings-24px.svg</file> <file>images/icons/round-settings-24px.svg</file>
<file>images/icons/round-undo-24px.svg</file> <file>images/icons/round-undo-24px.svg</file>
<file>web/chatview.css</file> <file>web/chatview.css</file>
<file>web/chatview.html</file> <file>web/chatview.html</file>
<file>web/chatview.js</file> <file>web/chatview.js</file>
<file>web/linkify.js</file> <file>web/linkify.js</file>
<file>web/linkify-html.js</file> <file>web/linkify-html.js</file>
<file>web/linkify-string.js</file> <file>web/linkify-string.js</file>
<file>web/qwebchannel.js</file> <file>web/qwebchannel.js</file>
<file>images/icons/round-check_circle-24px.svg</file> <file>images/icons/round-check_circle-24px.svg</file>
<file>images/icons/round-error-24px.svg</file> <file>images/icons/round-error-24px.svg</file>
<file>images/icons/round-save_alt-24px.svg</file> <file>images/icons/round-save_alt-24px.svg</file>
<file>images/jami_eclipse_spinner.gif</file> <file>images/jami_eclipse_spinner.gif</file>
<file>images/icons/ic_hide_password.png</file> <file>images/icons/ic_hide_password.png</file>
<file>images/icons/ic_show_password.png</file> <file>images/icons/ic_show_password.png</file>
<file>images/icons/baseline-desktop_windows-24px.svg</file> <file>images/icons/baseline-desktop_windows-24px.svg</file>
<file>images/icons/baseline-people-24px.svg</file> <file>images/icons/baseline-people-24px.svg</file>
<file>images/icons/round-add_a_photo-24px.svg</file> <file>images/icons/round-add_a_photo-24px.svg</file>
</qresource> <file>images/icons/ic_mic_white_24dp.png</file>
</qresource>
</RCC> </RCC>
...@@ -688,6 +688,9 @@ ...@@ -688,6 +688,9 @@
<ItemGroup> <ItemGroup>
<ResourceCompile Include="ico.rc" /> <ResourceCompile Include="ico.rc" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="images\icons\ic_mic_white_24dp.png" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')"> <ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" /> <Import Project="$(QtMsBuild)\qt.targets" />
......
...@@ -787,4 +787,9 @@ ...@@ -787,4 +787,9 @@
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="images\icons\ic_mic_white_24dp.png">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -36,12 +36,10 @@ VideoOverlay::VideoOverlay(QWidget* parent) : ...@@ -36,12 +36,10 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
ui->chatButton->setCheckable(true); ui->chatButton->setCheckable(true);
setAttribute(Qt::WA_NoSystemBackground);
ui->noMicButton->setCheckable(true);
ui->onHoldLabel->setVisible(false); ui->onHoldLabel->setVisible(false);
setAttribute(Qt::WA_NoSystemBackground);
ui->recButton->setVisible(false); ui->recButton->setVisible(false);
} }
...@@ -146,30 +144,24 @@ VideoOverlay::on_holdButton_clicked() ...@@ -146,30 +144,24 @@ VideoOverlay::on_holdButton_clicked()
} }
void void
VideoOverlay::on_noMicButton_clicked() VideoOverlay::on_noMicButton_toggled(bool checked)
{ {
auto selectedConvUid = LRCInstance::getSelectedConvUid(); bool btn_status = false;
auto conversation = Utils::getConversationFromUid(selectedConvUid,
*LRCInstance::getCurrentConversationModel());
auto& callId = conversation->callId;
auto callModel = LRCInstance::getCurrentCallModel(); auto callModel = LRCInstance::getCurrentCallModel();
if (callModel->hasCall(callId)) { if (callModel->hasCall(callId_)) {
ui->noMicButton->setChecked(callModel->getCall(callId).audioMuted); callModel->toggleMedia(callId_, lrc::api::NewCallModel::Media::AUDIO);
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::AUDIO); btn_status = callModel->getCall(callId_).audioMuted;
} }
} }
void void
VideoOverlay::on_noVideoButton_clicked() VideoOverlay::on_noVideoButton_toggled(bool checked)
{ {
auto selectedConvUid = LRCInstance::getSelectedConvUid(); bool btn_status = false;
auto conversation = Utils::getConversationFromUid(selectedConvUid,
*LRCInstance::getCurrentConversationModel());
auto& callId = conversation->callId;
auto callModel = LRCInstance::getCurrentCallModel(); auto callModel = LRCInstance::getCurrentCallModel();
if (callModel->hasCall(callId)) { if (callModel->hasCall(callId_)) {
ui->noVideoButton->setChecked(callModel->getCall(callId).videoMuted); callModel->toggleMedia(callId_, lrc::api::NewCallModel::Media::VIDEO);
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::VIDEO); btn_status = callModel->getCall(callId_).videoMuted;
} }
} }
......
...@@ -50,8 +50,8 @@ private slots: ...@@ -50,8 +50,8 @@ private slots:
void on_hangupButton_clicked(); void on_hangupButton_clicked();
void on_chatButton_toggled(bool checked); void on_chatButton_toggled(bool checked);
void on_holdButton_clicked(); void on_holdButton_clicked();
void on_noMicButton_clicked(); void on_noMicButton_toggled(bool checked);
void on_noVideoButton_clicked(); void on_noVideoButton_toggled(bool checked);
void on_recButton_clicked(); void on_recButton_clicked();
private: private:
......
...@@ -166,7 +166,10 @@ ...@@ -166,7 +166,10 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="ressources.qrc"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
...@@ -207,7 +210,10 @@ ...@@ -207,7 +210,10 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="ressources.qrc"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <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