From 51658c0443d312cbb423b93f47af31fea9705990 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 22 Dec 2022 16:19:50 +0100 Subject: [PATCH] Fix volume gauge in multimedia parameters while being in call. Add customization UI when deactivating video/conference/update checker. --- CHANGELOG.md | 7 ++++++- linphone-app/src/app/App.cpp | 14 +++++++++----- .../src/components/chat-room/ChatRoomModel.cpp | 10 ++++++---- .../src/components/settings/SettingsModel.cpp | 11 ++++++----- .../src/components/settings/SettingsModel.hpp | 1 + .../src/components/timeline/TimelineProxyModel.cpp | 5 +++-- .../Linphone/Dialog/MultimediaParametersDialog.qml | 1 + .../ui/modules/Linphone/Menus/IncallMenu.qml | 2 +- linphone-app/ui/views/App/Calls/Incall.qml | 1 + .../ui/views/App/Main/MainWindowMenuBar.qml | 1 + .../ui/views/App/Main/MainWindowTopMenuBar.qml | 1 + linphone-app/ui/views/App/Settings/SettingsUi.qml | 1 + .../ui/views/App/Settings/SettingsWindow.qml | 6 +++--- linphone-sdk | 2 +- 14 files changed, 41 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce4e42de7..febb3f7cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 5.0.3 - 2022-12-19 +## 5.0.4 - undefined + +### Fixed +- Volume gauge in multimedia parameters while being in call. + +## 5.0.3 - 2022-12-21 ### Fixed - Missing SetThreadDescription entry point on Windows 7/8 (SDK update) diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index 4dd3a10ec..5684a9931 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -783,10 +783,13 @@ void App::setTrayIcon () { App::smartShowWindow(getSettingsWindow()); }); - QAction *updateCheckAction = new QAction(tr("checkForUpdates"), root); - root->connect(updateCheckAction, &QAction::triggered, root, [this] { - checkForUpdates(true); - }); + QAction *updateCheckAction = nullptr; + if(SettingsModel::isCheckForUpdateAvailable()){ + updateCheckAction = new QAction(tr("checkForUpdates"), root); + root->connect(updateCheckAction, &QAction::triggered, root, [this] { + checkForUpdates(true); + }); + } QAction *aboutAction = new QAction(tr("about"), root); root->connect(aboutAction, &QAction::triggered, root, [root] { @@ -820,7 +823,8 @@ void App::setTrayIcon () { menu->setTitle(APPLICATION_NAME); // Build trayIcon menu. menu->addAction(settingsAction); - menu->addAction(updateCheckAction); + if(updateCheckAction) + menu->addAction(updateCheckAction); menu->addAction(aboutAction); menu->addSeparator(); menu->addAction(restoreAction); diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 02a52440b..45de74dbe 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -937,9 +937,10 @@ void ChatRoomModel::initEntries(){ // Get calls. bool secureChatEnabled = CoreManager::getInstance()->getSettingsModel()->getSecureChatEnabled(); bool standardChatEnabled = CoreManager::getInstance()->getSettingsModel()->getStandardChatEnabled(); + bool noChat = !secureChatEnabled && !standardChatEnabled; - if( isOneToOne() && (secureChatEnabled && !standardChatEnabled && isSecure() - || standardChatEnabled && !isSecure()) ) { + if(noChat || (isOneToOne() && (secureChatEnabled && !standardChatEnabled && isSecure() + || standardChatEnabled && !isSecure())) ) { auto callHistory = CallsListModel::getCallHistory(getParticipantAddress(), Utils::coreStringToAppString(mChatRoom->getLocalAddress()->asStringUriOnly())); // callhistory is sorted from newest to oldest int count = 0; @@ -1006,9 +1007,10 @@ int ChatRoomModel::loadMoreEntries(){ // Calls bool secureChatEnabled = CoreManager::getInstance()->getSettingsModel()->getSecureChatEnabled(); bool standardChatEnabled = CoreManager::getInstance()->getSettingsModel()->getStandardChatEnabled(); + bool noChat = !secureChatEnabled && !standardChatEnabled; - if( isOneToOne() && (secureChatEnabled && !standardChatEnabled && isSecure() - || standardChatEnabled && !isSecure()) ) { + if( noChat || (isOneToOne() && (secureChatEnabled && !standardChatEnabled && isSecure() + || standardChatEnabled && !isSecure())) ) { auto callHistory = CallsListModel::getCallHistory(getParticipantAddress(), Utils::coreStringToAppString(mChatRoom->getLocalAddress()->asStringUriOnly())); int count = 0; auto itCallHistory = callHistory.begin(); diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index f9108f8cd..1404eae33 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -1529,14 +1529,15 @@ void SettingsModel::setExitOnClose (bool value) { emit exitOnCloseChanged(value); } -bool SettingsModel::isCheckForUpdateEnabled() const{ +bool SettingsModel::isCheckForUpdateAvailable(){ #ifdef ENABLE_UPDATE_CHECK - int enabled = 1; + return true; #else - int enabled = 0; + return false; #endif - return !!mConfig->getInt(UiSection, "check_for_update_enabled", enabled); - +} +bool SettingsModel::isCheckForUpdateEnabled() const{ + return !!mConfig->getInt(UiSection, "check_for_update_enabled", isCheckForUpdateAvailable()); } void SettingsModel::setCheckForUpdateEnabled(bool enable){ diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index d3cdcde37..6912884f6 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -570,6 +570,7 @@ public: bool getExitOnClose () const; void setExitOnClose (bool value); + Q_INVOKABLE static bool isCheckForUpdateAvailable(); bool isCheckForUpdateEnabled() const; void setCheckForUpdateEnabled(bool enable); diff --git a/linphone-app/src/components/timeline/TimelineProxyModel.cpp b/linphone-app/src/components/timeline/TimelineProxyModel.cpp index 95b7d38dd..d1fb22373 100644 --- a/linphone-app/src/components/timeline/TimelineProxyModel.cpp +++ b/linphone-app/src/components/timeline/TimelineProxyModel.cpp @@ -109,9 +109,10 @@ bool TimelineProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex &sou if(!timeline || !timeline->getChatRoomModel() || timeline->getChatRoomModel()->getState() == (int)linphone::ChatRoom::State::Deleted) return false; bool haveEncryption = timeline->getChatRoomModel()->haveEncryption(); - if(!CoreManager::getInstance()->getSettingsModel()->getStandardChatEnabled() && !haveEncryption) + bool noChat = !CoreManager::getInstance()->getSettingsModel()->getStandardChatEnabled() && !CoreManager::getInstance()->getSettingsModel()->getSecureChatEnabled(); + if(!noChat && !CoreManager::getInstance()->getSettingsModel()->getStandardChatEnabled() && !haveEncryption) return false; - if(!CoreManager::getInstance()->getSettingsModel()->getSecureChatEnabled() && haveEncryption) + if(!noChat && !CoreManager::getInstance()->getSettingsModel()->getSecureChatEnabled() && haveEncryption) return false; bool show = (mFilterFlags==0);// Show all at 0 (no hide all) bool isGroup = timeline->getChatRoomModel()->isGroupEnabled(); diff --git a/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml b/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml index 61d6a76dc..d8094b415 100644 --- a/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml +++ b/linphone-app/ui/modules/Linphone/Dialog/MultimediaParametersDialog.qml @@ -198,6 +198,7 @@ DialogPlus { RowLayout { spacing: MultimediaParametersDialogStyle.column.entry.spacing width: parent.width + visible: SettingsModel.videoSupported 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 3a1bf0529..48f8fa7b4 100644 --- a/linphone-app/ui/modules/Linphone/Menus/IncallMenu.qml +++ b/linphone-app/ui/modules/Linphone/Menus/IncallMenu.qml @@ -203,7 +203,7 @@ Rectangle{ Layout.fillHeight: true Layout.fillWidth: true Layout.minimumHeight: fitHeight - call: conference.callModel + call: mainItem.callModel flat: true showMargins: true expandHeight: false diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index 9b0bec8f0..511ade285 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -535,6 +535,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 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/Main/MainWindowMenuBar.qml b/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml index b88e8db53..a6285ea4f 100644 --- a/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml +++ b/linphone-app/ui/views/App/Main/MainWindowMenuBar.qml @@ -65,6 +65,7 @@ Item { } MenuItem { + visible: SettingsModel.isCheckForUpdateAvailable() //: 'Check for updates' : Item menu for checking updates text: qsTr('checkForUpdates') diff --git a/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml b/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml index 34a6ddee2..f61306bbd 100644 --- a/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml +++ b/linphone-app/ui/views/App/Main/MainWindowTopMenuBar.qml @@ -27,6 +27,7 @@ MenuBar { MenuItem { + visible: SettingsModel.isCheckForUpdateAvailable() //: 'Check for updates' : Item menu for checking updates text: qsTr('checkForUpdates') role: MenuItem.ApplicationSpecificRole diff --git a/linphone-app/ui/views/App/Settings/SettingsUi.qml b/linphone-app/ui/views/App/Settings/SettingsUi.qml index b370e473c..511a5dfa3 100644 --- a/linphone-app/ui/views/App/Settings/SettingsUi.qml +++ b/linphone-app/ui/views/App/Settings/SettingsUi.qml @@ -239,6 +239,7 @@ TabContainer { } FormLine { maxItemWidth: parent.width + visible: SettingsModel.isCheckForUpdateAvailable() FormGroup { //: 'Check for updates' : Label switch for enabling check for updates label: qsTr('checkForUpdateLabel') diff --git a/linphone-app/ui/views/App/Settings/SettingsWindow.qml b/linphone-app/ui/views/App/Settings/SettingsWindow.qml index 5ecf418a3..cec9b7cfe 100644 --- a/linphone-app/ui/views/App/Settings/SettingsWindow.qml +++ b/linphone-app/ui/views/App/Settings/SettingsWindow.qml @@ -57,7 +57,7 @@ ApplicationWindow { id: tabBar onCurrentIndexChanged: SettingsModel.onSettingsTabChanged(currentIndex) - + spacing:0 TabButton { iconName: TabButtonStyle.icon.sipAccountsIcon text: qsTr('sipAccountsTab') @@ -71,10 +71,10 @@ ApplicationWindow { } TabButton { - enabled: SettingsModel.videoSupported + visible: SettingsModel.videoSupported iconName: TabButtonStyle.icon.videoIcon text: qsTr('videoTab') - width: implicitWidth + width: visible ? implicitWidth : 0 } TabButton { diff --git a/linphone-sdk b/linphone-sdk index 180d93a62..fbe6d7449 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 180d93a62aa9279e7d4c82ec4df50b45c4901927 +Subproject commit fbe6d7449d47e22ca8fed0975f70a8bbdac28a94