From a622900e8bf56b366dc8a456bd8e3e7f84989088 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 22 Dec 2022 16:23:30 +0100 Subject: [PATCH] Fix volume gauge in multimedia parameters while being in call. Add customization UI when deactivating video/conference/update checker. --- CHANGELOG.md | 8 +++++++- linphone-app/src/app/App.cpp | 14 +++++++++----- .../src/components/chat-room/ChatRoomModel.cpp | 10 ++++++---- .../src/components/settings/SettingsModel.cpp | 9 ++++++++- .../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, 44 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e60198499..aeed48d30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,19 @@ 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.1.0 - undefined ### Added - VFS Encryption - File viewer in chats (Image/Animated Image/Video/Texts) with the option to export the file. -## 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 3b081f057..94e1618ee 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -780,10 +780,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] { @@ -817,7 +820,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 1632c5a4e..fb3c5ed62 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -1556,8 +1556,15 @@ void SettingsModel::setExitOnClose (bool value) { emit exitOnCloseChanged(value); } +bool SettingsModel::isCheckForUpdateAvailable(){ +#ifdef ENABLE_UPDATE_CHECK + return true; +#else + return false; +#endif +} bool SettingsModel::isCheckForUpdateEnabled() const{ - return !!mConfig->getInt(UiSection, "check_for_update_enabled", 1); + 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 56231b323..e9a9c6863 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -576,6 +576,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 6eeb6d288..d4741df47 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 62eaec882..2e1058e15 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 96cca8a9a..e8442895f 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 fdd68d616..4b299028b 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 27c02e232..fbe6d7449 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 27c02e232d7fd5facdcd21c2b15d558812ab4151 +Subproject commit fbe6d7449d47e22ca8fed0975f70a8bbdac28a94