diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index f45a560f8..96179a553 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -679,7 +679,7 @@ void CallModel::acceptWithAutoAnswerDelay () { // Use auto-answer if activated and it's the only call. if (settingsModel->getAutoAnswerStatus() && coreManager->getCore()->getCallsNb() == 1) { - if (mCall && mCall->getRemoteParams()->videoEnabled() && settingsModel->getAutoAnswerVideoStatus() && settingsModel->getVideoSupported()) + if (mCall && mCall->getRemoteParams()->videoEnabled() && settingsModel->getAutoAnswerVideoStatus() && settingsModel->getVideoEnabled()) acceptWithVideo(); else accept(); @@ -787,8 +787,8 @@ bool CallModel::getCameraEnabled () const{ void CallModel::setCameraEnabled (bool status){ shared_ptr core = CoreManager::getInstance()->getCore(); - if (!core->videoSupported()) { - qWarning() << QStringLiteral("Unable to update video call property. (Video not supported.)"); + if (!CoreManager::getInstance()->getSettingsModel()->getVideoEnabled()) { + qWarning() << QStringLiteral("Unable to update video call property. (Video not enabled.)"); return; } if(mCall) { @@ -857,13 +857,13 @@ bool CallModel::getVideoEnabled () const { shared_ptr params = mCall->getCurrentParams(); return params && params->videoEnabled(); }else - return true; + return CoreManager::getInstance()->getSettingsModel()->getVideoEnabled(); } void CallModel::setVideoEnabled (bool status) { shared_ptr core = CoreManager::getInstance()->getCore(); - if (!core->videoSupported()) { - qWarning() << QStringLiteral("Unable to update video call property. (Video not supported.)"); + if (!CoreManager::getInstance()->getSettingsModel()->getVideoEnabled()) { + qWarning() << QStringLiteral("Unable to update video call property. (Video not enabled.)"); return; } if(mCall) { diff --git a/linphone-app/src/components/calls/CallsListModel.cpp b/linphone-app/src/components/calls/CallsListModel.cpp index 3ba0ea8d7..8dad2c7cd 100644 --- a/linphone-app/src/components/calls/CallsListModel.cpp +++ b/linphone-app/src/components/calls/CallsListModel.cpp @@ -174,8 +174,8 @@ void CallsListModel::launchSecureAudioCall (const QString &sipAddress, LinphoneE void CallsListModel::launchVideoCall (const QString &sipAddress, const QString& prepareTransfertAddress, const bool& autoSelectAfterCreation, QVariantMap options) const { CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = autoSelectAfterCreation; shared_ptr core = CoreManager::getInstance()->getCore(); - if (!core->videoSupported()) { - qWarning() << QStringLiteral("Unable to launch video call. (Video not supported.) Launching audio call..."); + if (!CoreManager::getInstance()->getSettingsModel()->getVideoEnabled()) { + qWarning() << QStringLiteral("Unable to launch video call. (Video not enabled.) Launching audio call..."); launchAudioCall(sipAddress, prepareTransfertAddress, {}); return; } diff --git a/linphone-app/src/components/core/CoreHandlers.cpp b/linphone-app/src/components/core/CoreHandlers.cpp index bca08f971..780d6a88a 100644 --- a/linphone-app/src/components/core/CoreHandlers.cpp +++ b/linphone-app/src/components/core/CoreHandlers.cpp @@ -238,13 +238,12 @@ void CoreHandlers::onMessagesReceived ( } if( !message || message->isOutgoing() ) continue; - - messagesToSignal.push_back(message); - // 1. Do not notify if chat is not activated. if (chatRoom->getCurrentParams()->getEncryptionBackend() == linphone::ChatRoomEncryptionBackend::None && !settingsModel->getStandardChatEnabled() || chatRoom->getCurrentParams()->getEncryptionBackend() != linphone::ChatRoomEncryptionBackend::None && !settingsModel->getSecureChatEnabled()) continue; + + messagesToSignal.push_back(message); // 2. Do not notify if the chatroom's notification has been deactivated. appSettings.beginGroup(ChatRoomModel::getChatRoomId(chatRoom)); diff --git a/linphone-app/src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp b/linphone-app/src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp index a0d323f06..41795095d 100644 --- a/linphone-app/src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp +++ b/linphone-app/src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp @@ -57,6 +57,8 @@ AbstractEventCountNotifier::AbstractEventCountNotifier (QObject *parent) : QObje coreManager->getSettingsModel(), &SettingsModel::secureChatEnabledChanged, this, &AbstractEventCountNotifier::internalnotifyEventCount ); + QObject::connect(coreManager->getSettingsModel(), &SettingsModel::standardChatEnabledChanged, this, &AbstractEventCountNotifier::updateUnreadMessageCount); + QObject::connect(coreManager->getSettingsModel(), &SettingsModel::secureChatEnabledChanged, this, &AbstractEventCountNotifier::updateUnreadMessageCount); /* QObject::connect( coreManager->getCallsListModel(), &CallsListModel::callMissed, @@ -67,8 +69,12 @@ AbstractEventCountNotifier::AbstractEventCountNotifier (QObject *parent) : QObje // ----------------------------------------------------------------------------- void AbstractEventCountNotifier::updateUnreadMessageCount () { - mUnreadMessageCount = CoreManager::getInstance()->getCore()->getUnreadChatMessageCountFromActiveLocals(); - internalnotifyEventCount(); + auto coreManager = CoreManager::getInstance(); + if(!coreManager->getSettingsModel()->getStandardChatEnabled() && !coreManager->getSettingsModel()->getSecureChatEnabled()) + mUnreadMessageCount = 0; + else + mUnreadMessageCount = CoreManager::getInstance()->getCore()->getUnreadChatMessageCountFromActiveLocals(); + internalnotifyEventCount(); } void AbstractEventCountNotifier::internalnotifyEventCount () { diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index 44d1a447e..5845bb899 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -519,12 +519,12 @@ QString AccountSettingsModel::getDefaultAccountDomain() const{ QVariantList AccountSettingsModel::getAccounts () const { shared_ptr core = CoreManager::getInstance()->getCore(); QVariantList accounts; - - if(CoreManager::getInstance()->getSettingsModel()->getShowLocalSipAccount()) { + auto settingsModel = CoreManager::getInstance()->getSettingsModel(); + if(settingsModel->getShowLocalSipAccount()) { QVariantMap account; account["sipAddress"] = Utils::coreStringToAppString(core->createPrimaryContactParsed()->asStringUriOnly()); account["fullSipAddress"] = Utils::coreStringToAppString(core->createPrimaryContactParsed()->asString()); - account["unreadMessageCount"] = core->getUnreadChatMessageCountFromLocal(core->createPrimaryContactParsed()); + account["unreadMessageCount"] = settingsModel->getStandardChatEnabled() || settingsModel->getSecureChatEnabled() ? core->getUnreadChatMessageCountFromLocal(core->createPrimaryContactParsed()) : 0; account["missedCallCount"] = CoreManager::getInstance()->getMissedCallCountFromLocal(account["sipAddress"].toString()); account["account"].setValue(nullptr); accounts << account; @@ -535,7 +535,7 @@ QVariantList AccountSettingsModel::getAccounts () const { accountMap["sipAddress"] = Utils::coreStringToAppString(account->getParams()->getIdentityAddress()->asStringUriOnly()); accountMap["fullSipAddress"] = Utils::coreStringToAppString(account->getParams()->getIdentityAddress()->asString()); accountMap["account"].setValue(account); - accountMap["unreadMessageCount"] = account->getUnreadChatMessageCount(); + accountMap["unreadMessageCount"] = settingsModel->getStandardChatEnabled() || settingsModel->getSecureChatEnabled() ? account->getUnreadChatMessageCount() : 0; accountMap["missedCallCount"] = CoreManager::getInstance()->getMissedCallCountFromLocal(accountMap["sipAddress"].toString()); accounts << accountMap; } diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 2a9137319..9b4bcb321 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -632,9 +632,17 @@ void SettingsModel::setVideoDefinition (const QVariantMap &definition) { emit videoDefinitionChanged(definition); } -bool SettingsModel::getVideoSupported () const { - return CoreManager::getInstance()->getCore()->videoSupported(); +bool SettingsModel::getVideoEnabled() const { + return CoreManager::getInstance()->getCore()->videoSupported() && !!mConfig->getInt(UiSection, "video_enabled", 1); } + +void SettingsModel::setVideoEnabled(const bool& enable){ + if( CoreManager::getInstance()->getCore()->videoSupported()){ + mConfig->setInt(UiSection, "video_enabled", enable); + emit videoEnabledChanged(); + } +} + void SettingsModel::setHighMosaicQuality(){ mConfig->setString("video", "max_mosaic_size", ""); } diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 6159c7437..93fe6c62e 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -97,7 +97,7 @@ class SettingsModel : public QObject { Q_PROPERTY(QVariantMap videoDefinition READ getVideoDefinition WRITE setVideoDefinition NOTIFY videoDefinitionChanged) - Q_PROPERTY(bool videoSupported READ getVideoSupported CONSTANT) + Q_PROPERTY(bool videoEnabled READ getVideoEnabled WRITE setVideoEnabled NOTIFY videoEnabledChanged) Q_PROPERTY(bool showVideoCodecs READ getShowVideoCodecs WRITE setShowVideoCodecs NOTIFY showVideoCodecsChanged) @@ -374,7 +374,8 @@ public: Q_INVOKABLE QVariantMap getCurrentPreviewVideoDefinition () const; void setVideoDefinition (const QVariantMap &definition); - bool getVideoSupported () const; + bool getVideoEnabled() const; + void setVideoEnabled(const bool& enable); bool getShowVideoCodecs () const; void setShowVideoCodecs (bool status); @@ -709,7 +710,7 @@ signals: void showAudioCodecsChanged (bool status); // Video. -------------------------------------------------------------------- - + void videoEnabledChanged(); void videoDevicesChanged (const QStringList &devices); void videoDeviceChanged (const QString &device); diff --git a/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp b/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp index b0d73e0fe..e9c427597 100644 --- a/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp +++ b/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp @@ -32,6 +32,7 @@ #include "components/core/CoreManager.hpp" #include "components/history/HistoryModel.hpp" #include "components/settings/AccountSettingsModel.hpp" +#include "components/settings/SettingsModel.hpp" #include "utils/Utils.hpp" #include "SipAddressesModel.hpp" @@ -510,7 +511,11 @@ void SipAddressesModel::addOrUpdateSipAddress (SipAddressEntry &sipAddressEntry, void SipAddressesModel::addOrUpdateSipAddress (SipAddressEntry &sipAddressEntry, const shared_ptr &message) { shared_ptr chatRoom(message->getChatRoom()); - int count = chatRoom->getUnreadMessagesCount(); + auto settingsModel = CoreManager::getInstance()->getSettingsModel(); + int count = 0; + if (chatRoom->getCurrentParams()->getEncryptionBackend() == linphone::ChatRoomEncryptionBackend::None && !settingsModel->getStandardChatEnabled() + || chatRoom->getCurrentParams()->getEncryptionBackend() != linphone::ChatRoomEncryptionBackend::None && !settingsModel->getSecureChatEnabled()) + count = chatRoom->getUnreadMessagesCount(); QString localAddress(Utils::cleanSipAddress(Utils::coreStringToAppString(chatRoom->getLocalAddress()->asStringUriOnly()))); QString peerAddress(Utils::cleanSipAddress(Utils::coreStringToAppString(chatRoom->getPeerAddress()->asStringUriOnly()))); diff --git a/linphone-app/ui/modules/Linphone/Calls/Calls.js b/linphone-app/ui/modules/Linphone/Calls/Calls.js index 771eb6106..aa33c8f0e 100644 --- a/linphone-app/ui/modules/Linphone/Calls/Calls.js +++ b/linphone-app/ui/modules/Linphone/Calls/Calls.js @@ -83,7 +83,7 @@ function getParams (call) { if (status === CallModel.CallStatusIncoming) { var optActions = [] - if (Linphone.SettingsModel.videoSupported) { + if (Linphone.SettingsModel.videoEnabled) { optActions.push({ handler: call.acceptWithVideo, name: qsTr('acceptVideoCall') diff --git a/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml b/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml index d4741df47..32dbbe0fb 100644 --- a/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml +++ b/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml @@ -198,7 +198,7 @@ DialogPlus { RowLayout { spacing: MultimediaParametersDialogStyle.column.entry.spacing width: parent.width - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled Icon { icon: MultimediaParametersDialogStyle.column.entry.camera.icon diff --git a/linphone-app/ui/modules/Linphone/Menus/IncallMenu.qml b/linphone-app/ui/modules/Linphone/Menus/IncallMenu.qml index 0a538292f..0779139c2 100644 --- a/linphone-app/ui/modules/Linphone/Menus/IncallMenu.qml +++ b/linphone-app/ui/modules/Linphone/Menus/IncallMenu.qml @@ -129,7 +129,7 @@ Rectangle{ : IncallMenuStyle.settingsIcons.activeSpeakerIcon : IncallMenuStyle.settingsIcons.audioOnlyIcon) , nextPage:layoutMenu - , visible: mainItem.callModel && mainItem.callModel.isConference}, + , visible: mainItem.callModel && mainItem.callModel.isConference && SettingsModel.videoEnabled}, { titleIndex: 2 , icon: IncallMenuStyle.settingsIcons.participantsIcon diff --git a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml index 37a64aae2..5b7cb48a4 100644 --- a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml +++ b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml @@ -62,7 +62,7 @@ Notification { isCustom: true backgroundRadius: 90 colorSet: NotificationReceivedCallStyle.acceptVideoCall - visible: SettingsModel.videoSupported && notification.call.getRemoteVideoEnabled() + visible: SettingsModel.videoEnabled && notification.call.getRemoteVideoEnabled() onClicked: notification._close(notification.call.acceptWithVideo) } diff --git a/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml b/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml index 2c7a672c8..dae22d452 100644 --- a/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml +++ b/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml @@ -70,7 +70,7 @@ SearchBox { searchBox.closeMenu() searchBox.launchVideoCall(entry.sipAddress) }, - visible: SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton + visible: SettingsModel.videoEnabled && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton }, { colorSet: SipAddressesViewStyle.call, secure: 0, diff --git a/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml b/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml index 5c37cc136..866924947 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/TimelineItem.qml @@ -129,6 +129,7 @@ Rectangle { spacing: 0 Layout.alignment: Qt.AlignBottom | Qt.AlignRight Layout.preferredHeight: TimelineStyle.status.iconSize + visible: SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled Icon{ id: notificationsIcon Layout.preferredHeight: TimelineStyle.status.iconSize diff --git a/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml b/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml index ff52d08d2..5b8189d3e 100644 --- a/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml +++ b/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml @@ -75,7 +75,7 @@ DialogPlus { handler: function (entry) { launchVideoCall(entry.sipAddress) }, - visible: SettingsModel.videoSupported && SettingsModel.showStartVideoCallButton, + visible: SettingsModel.videoEnabled && SettingsModel.showStartVideoCallButton, handlerSipAddress: function(sipAddress) { launchVideoCall(sipAddress) } diff --git a/linphone-app/ui/views/App/Calls/Incall.js b/linphone-app/ui/views/App/Calls/Incall.js index 66412755a..c44091fc6 100644 --- a/linphone-app/ui/views/App/Calls/Incall.js +++ b/linphone-app/ui/views/App/Calls/Incall.js @@ -65,7 +65,7 @@ function handleStatusChanged (status, isFullscreen) { } function handleVideoRequested (call) { - if (window.virtualWindowVisible || !Linphone.SettingsModel.videoSupported) { + if (window.virtualWindowVisible || !Linphone.SettingsModel.videoEnabled) { call.rejectVideoRequest() return } diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index 9f06e7e22..01251011e 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -539,7 +539,7 @@ Rectangle { colorSet: callModel && callModel.cameraEnabled ? IncallStyle.buttons.cameraOn : IncallStyle.buttons.cameraOff updating: callModel.videoEnabled && callModel.updating && !mainItem.layoutChanging enabled: callModel && !callModel.pausedByUser - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled property bool _activateCamera: false onClicked: if(callModel && !mainItem.layoutChanging){ if( callModel.isConference){// Only deactivate camera in conference. diff --git a/linphone-app/ui/views/App/Calls/IncomingCall.qml b/linphone-app/ui/views/App/Calls/IncomingCall.qml index d0ff5ae9a..b0e74ea47 100644 --- a/linphone-app/ui/views/App/Calls/IncomingCall.qml +++ b/linphone-app/ui/views/App/Calls/IncomingCall.qml @@ -16,7 +16,7 @@ AbstractStartingCall { isCustom: true backgroundRadius: 90 colorSet: CallStyle.buttons.acceptVideoCall - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled onClicked: call.acceptWithVideo() } diff --git a/linphone-app/ui/views/App/Calls/WaitingRoom.qml b/linphone-app/ui/views/App/Calls/WaitingRoom.qml index c162a447b..6ff2e0ded 100644 --- a/linphone-app/ui/views/App/Calls/WaitingRoom.qml +++ b/linphone-app/ui/views/App/Calls/WaitingRoom.qml @@ -20,7 +20,7 @@ Rectangle { color: WaitingRoomStyle.backgroundColor.color property ConferenceInfoModel conferenceInfoModel property CallModel callModel // Store the call for processing calling. - property bool previewLoaderEnabled: callModel ? callModel.videoEnabled : true + property bool previewLoaderEnabled: callModel ? callModel.videoEnabled : SettingsModel.videoEnabled property var _sipAddressObserver: callModel ? SipAddressesModel.getSipAddressObserver(callModel.fullPeerAddress, callModel.fullLocalAddress) : undefined property bool isEnded: callModel && callModel.status == CallModel.CallStatusEnded @@ -156,7 +156,7 @@ Rectangle { : mainItem.callModel ? mainItem.callModel.conferenceModel : null - deactivateCamera: !mainItem.previewLoaderEnabled || mainItem.isEnded + deactivateCamera: !SettingsModel.videoEnabled || !mainItem.previewLoaderEnabled || mainItem.isEnded /* image: mainItem._sipAddressObserver && mainItem._sipAddressObserver.contact && mainItem._sipAddressObserver.contact.vcard.avatar @@ -307,7 +307,7 @@ Rectangle { ActionSwitch { id: camera property bool cameraEnabled: true - visible: !mainItem.callModel + visible: !mainItem.callModel && SettingsModel.videoEnabled isCustom: true backgroundRadius: 90 colorSet: cameraEnabled ? WaitingRoomStyle.buttons.cameraOn : WaitingRoomStyle.buttons.cameraOff @@ -346,7 +346,7 @@ Rectangle { property int selectedMode: SettingsModel.videoConferenceLayout anchors.centerIn: parent anchors.horizontalCenterOffset: contentsStack.cameraWidth/2 - modeChoice.width/2 - visible: !mainItem.callModel + visible: !mainItem.callModel && SettingsModel.videoEnabled toggled: layoutMenu.visible isCustom: true backgroundRadius: width/2 diff --git a/linphone-app/ui/views/App/Main/ContactEdit.qml b/linphone-app/ui/views/App/Main/ContactEdit.qml index bfa95d92a..702405aa3 100644 --- a/linphone-app/ui/views/App/Main/ContactEdit.qml +++ b/linphone-app/ui/views/App/Main/ContactEdit.qml @@ -159,7 +159,7 @@ ColumnLayout { backgroundRadius: 90 colorSet: ContactEditStyle.videoCall - visible: SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton + visible: SettingsModel.videoEnabled && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton onClicked: sipAddressesMenu.open(sipAddressesMenu.startVideoCall) } diff --git a/linphone-app/ui/views/App/Main/Contacts.qml b/linphone-app/ui/views/App/Main/Contacts.qml index 1d1274ba3..c3665bc5d 100644 --- a/linphone-app/ui/views/App/Main/Contacts.qml +++ b/linphone-app/ui/views/App/Main/Contacts.qml @@ -139,7 +139,7 @@ ColumnLayout { isCustom: true backgroundRadius: 90 colorSet: ContactsStyle.videoCall - visible: SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.getShowStartVideoCallButton() + visible: SettingsModel.videoEnabled && SettingsModel.outgoingCallsEnabled && SettingsModel.getShowStartVideoCallButton() onClicked: actions.itemAt(0).open() } diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index ad967d74d..c28497cdd 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -213,7 +213,7 @@ ColumnLayout { iconSize:30 MouseArea{ anchors.fill:parent - visible: conversation.chatRoomModel && !conversation.chatRoomModel.isReadOnly + visible: conversation.chatRoomModel && !conversation.chatRoomModel.isReadOnly && (SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled) onClicked : { window.detachVirtualWindow() window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/InfoEncryption.qml') @@ -265,7 +265,7 @@ ColumnLayout { backgroundRadius: 1000 colorSet: ConversationStyle.bar.actions.videoCall - visible: SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton && !conversation.haveMoreThanOneParticipants + visible: SettingsModel.videoEnabled && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton && !conversation.haveMoreThanOneParticipants onClicked: CallsListModel.launchVideoCall(chatRoomModel.participants.addressesToString) } @@ -441,7 +441,7 @@ ColumnLayout { //: "Conversation's devices" : Item menu to get all participant devices of the chat room text: qsTr('conversationMenuDevices') iconMenu: MenuItemStyle.devices.icon - visible: conversationMenu.showDevices + visible: conversationMenu.showDevices && (SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled) iconSizeMenu: 40 menuItemStyle : MenuItemStyle.aux2 onTriggered: { @@ -463,7 +463,7 @@ ColumnLayout { iconMenu: MenuItemStyle.ephemeral.icon iconSizeMenu: 40 menuItemStyle : MenuItemStyle.aux2 - visible: conversationMenu.showEphemerals + visible: conversationMenu.showEphemerals && (SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled) onTriggered: { window.detachVirtualWindow() window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/EphemeralChatRoom.qml') @@ -485,7 +485,7 @@ ColumnLayout { iconMenu: MenuItemStyle.scheduleMeeting.icon iconSizeMenu: 40 menuItemStyle : MenuItemStyle.aux2 - visible: conversationMenu.showScheduleMeeting + visible: SettingsModel.videoConferenceEnabled && conversationMenu.showScheduleMeeting onClicked: { conferenceInfoModel.resetConferenceInfo() conferenceInfoModel.isScheduled = true @@ -511,6 +511,7 @@ ColumnLayout { } MenuItem{ id: muteMenuItem + visible: SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled text: chatRoomModel.notificationsEnabled //: 'Disable notifications' : Item menu to disable chat's notifications ? qsTr('conversationMenuDeactivate') diff --git a/linphone-app/ui/views/App/Main/HistoryView.qml b/linphone-app/ui/views/App/Main/HistoryView.qml index a3ff4b115..294030e2d 100644 --- a/linphone-app/ui/views/App/Main/HistoryView.qml +++ b/linphone-app/ui/views/App/Main/HistoryView.qml @@ -92,7 +92,7 @@ ColumnLayout { isCustom: true backgroundRadius: 90 colorSet: HistoryViewStyle.videoCall - visible: peerAddress && SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton + visible: peerAddress && SettingsModel.videoEnabled && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton onClicked: CallsListModel.launchVideoCall(historyView.peerAddress) } diff --git a/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml b/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml index 085633611..c39b6221f 100644 --- a/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml +++ b/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml @@ -94,7 +94,7 @@ TabContainer { FormLine { FormGroup { label: qsTr('autoAnswerWithVideoLabel') - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled Switch { checked: SettingsModel.autoAnswerVideoStatus diff --git a/linphone-app/ui/views/App/Settings/SettingsNetwork.qml b/linphone-app/ui/views/App/Settings/SettingsNetwork.qml index 9be7c2e41..29dd12fc1 100644 --- a/linphone-app/ui/views/App/Settings/SettingsNetwork.qml +++ b/linphone-app/ui/views/App/Settings/SettingsNetwork.qml @@ -254,7 +254,7 @@ TabContainer { readonly property int defaultPort: 9078 title: qsTr('videoRtpUdpPortLabel') - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled FormTableEntry { width:randomVideoRtpUdpPort.width @@ -394,7 +394,7 @@ TabContainer { FormGroup { label: qsTr('videoRtpStreamFieldLabel') - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled HexField { text: SettingsModel.dscpVideo diff --git a/linphone-app/ui/views/App/Settings/SettingsUi.qml b/linphone-app/ui/views/App/Settings/SettingsUi.qml index 27b890dea..9c6f70d46 100644 --- a/linphone-app/ui/views/App/Settings/SettingsUi.qml +++ b/linphone-app/ui/views/App/Settings/SettingsUi.qml @@ -112,7 +112,7 @@ TabContainer { Form { title: qsTr('pathsTitle') - visible: SettingsModel.videoSupported || + visible: SettingsModel.videoEnabled || SettingsModel.callRecorderEnabled || SettingsModel.standardChatEnabled || SettingsModel.secureChatEnabled || @@ -120,7 +120,7 @@ TabContainer { width: parent.width FormLine { - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled FormGroup { label: qsTr('savedScreenshotsLabel') diff --git a/linphone-app/ui/views/App/Settings/SettingsVideo.qml b/linphone-app/ui/views/App/Settings/SettingsVideo.qml index ed3c22b49..00e29665a 100644 --- a/linphone-app/ui/views/App/Settings/SettingsVideo.qml +++ b/linphone-app/ui/views/App/Settings/SettingsVideo.qml @@ -176,6 +176,16 @@ TabContainer { onClicked: SettingsModel.showVideoCodecs = !checked } } + + FormGroup { + label: 'Video enabled' + + Switch { + checked: SettingsModel.videoEnabled + + onClicked: SettingsModel.videoEnabled = !checked + } + } } CodecsViewer { diff --git a/linphone-app/ui/views/App/Settings/SettingsWindow.qml b/linphone-app/ui/views/App/Settings/SettingsWindow.qml index 4b299028b..df3623214 100644 --- a/linphone-app/ui/views/App/Settings/SettingsWindow.qml +++ b/linphone-app/ui/views/App/Settings/SettingsWindow.qml @@ -71,7 +71,7 @@ ApplicationWindow { } TabButton { - visible: SettingsModel.videoSupported + visible: SettingsModel.videoEnabled || SettingsModel.developerSettingsEnabled iconName: TabButtonStyle.icon.videoIcon text: qsTr('videoTab') width: visible ? implicitWidth : 0