From 5adb1eb4dd8c221f54d28e1e8f584d5519185fc6 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 9 Nov 2021 11:36:23 +0100 Subject: [PATCH] - Fix history view - Allow to add license in packages (windows with NSIS/mac with dmg) --- CHANGELOG.md | 11 +- CMakeLists.txt | 4 + .../linphone_package/CMakeLists.txt | 9 +- .../linphone_package/windows/NSIS.template.in | 5 +- .../ui/views/App/Main/HistoryView.qml | 301 ++++++++++-------- linphone-app/ui/views/App/Main/MainWindow.qml | 1 + .../App/Styles/Main/HistoryViewStyle.qml | 11 + 7 files changed, 199 insertions(+), 143 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acf3945e8..d4b5a5dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 4.4.0 - [Undefined] ## Added +- Features: + * messages features : Reply -## Fixed +## 4.3.2 + +### Fixed -- Changing volume in settings has a overall effect. - ALSA volumes can be view/changed while being in call. +- Remove constraints on actions (call/chat) that were based on friends capabilities. +- Unblock secure group chat activation. +- Unselect current contact if history call view is displayed. +- Show chat actions in history view ## 4.3.1 - 2021-11-04 diff --git a/CMakeLists.txt b/CMakeLists.txt index 78512ea76..2002b9256 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,6 +113,8 @@ option(ENABLE_VIDEO "Enable Video support." YES) option(ENABLE_DAEMON "Enable the linphone daemon interface." NO) option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." NO) +option(ENABLE_APP_LICENSE "Enable the license in packages." YES) + @@ -138,6 +140,8 @@ list(APPEND APP_OPTIONS "-DENABLE_BUILD_EXAMPLES=${ENABLE_BUILD_EXAMPLES}") list(APPEND APP_OPTIONS "-DENABLE_DAEMON=${ENABLE_DAEMON}") list(APPEND APP_OPTIONS "-DENABLE_CONSOLE_UI=${ENABLE_CONSOLE_UI}") list(APPEND APP_OPTIONS "-DENABLE_VIDEO=${ENABLE_VIDEO}") +list(APPEND APP_OPTIONS "-DENABLE_APP_LICENSE=${ENABLE_APP_LICENSE}") + if(ENABLE_V4L) diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt index aecb394ab..26d56861f 100644 --- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt +++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt @@ -348,7 +348,14 @@ if(${ENABLE_APP_PACKAGING}) set(CPACK_PACKAGE_VERSION_PATCH ${LINPHONE_MICRO_VERSION}) endif () set(CPACK_PACKAGE_EXECUTABLES "${EXECUTABLE_NAME};${APPLICATION_NAME}") - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../../../LICENSE.txt") + + if(ENABLE_APP_LICENSE) + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../../../LICENSE.txt") + else() + unset(CPACK_RESOURCE_FILE_LICENSE) + endif() + set(CPACK_RESOURCE_FILE_LICENSE_PROVIDED ENABLE_APP_LICENSE) + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${APPLICATION_NAME}") set(CPACK_PACKAGE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/Packages") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../../assets/icon.ico") diff --git a/linphone-app/cmake_builder/linphone_package/windows/NSIS.template.in b/linphone-app/cmake_builder/linphone_package/windows/NSIS.template.in index 582588ceb..ea9bd58f3 100644 --- a/linphone-app/cmake_builder/linphone_package/windows/NSIS.template.in +++ b/linphone-app/cmake_builder/linphone_package/windows/NSIS.template.in @@ -549,7 +549,10 @@ FunctionEnd ;Pages !insertmacro MUI_PAGE_WELCOME - !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" + !if @CPACK_RESOURCE_FILE_LICENSE_PROVIDED@ + !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" + !endif + Page custom InstallOptionsPage !insertmacro MUI_PAGE_DIRECTORY diff --git a/linphone-app/ui/views/App/Main/HistoryView.qml b/linphone-app/ui/views/App/Main/HistoryView.qml index 1fc22915f..509e375e3 100644 --- a/linphone-app/ui/views/App/Main/HistoryView.qml +++ b/linphone-app/ui/views/App/Main/HistoryView.qml @@ -12,143 +12,166 @@ import 'HistoryView.js' as Logic // ============================================================================= ColumnLayout { - id: historyView - - property string peerAddress - property string fullPeerAddress - - readonly property var _sipAddressObserver: peerAddress?SipAddressesModel.getSipAddressObserver((fullPeerAddress?fullPeerAddress:peerAddress), ''):null - - - // --------------------------------------------------------------------------- - - spacing: 0 - - // --------------------------------------------------------------------------- - // Contact bar. - // --------------------------------------------------------------------------- - - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: peerAddress?HistoryViewStyle.bar.height:HistoryViewStyle.bar.height/2 - - color: HistoryViewStyle.bar.backgroundColor - - RowLayout { - anchors { - fill: parent - leftMargin: HistoryViewStyle.bar.leftMargin - rightMargin: HistoryViewStyle.bar.rightMargin - } - spacing: HistoryViewStyle.bar.spacing - - layoutDirection: peerAddress?Qt.LeftToRight :Qt.RightToLeft - - Avatar { - id: avatar - - Layout.preferredHeight: HistoryViewStyle.bar.avatarSize - Layout.preferredWidth: HistoryViewStyle.bar.avatarSize - - image: peerAddress?Logic.getAvatar():null - - presenceLevel: historyView._sipAddressObserver?Presence.getPresenceLevel( - historyView._sipAddressObserver.presenceStatus - ):null - - username: peerAddress? UtilsCpp.getDisplayName(historyView._sipAddressObserver.peerAddress):null - visible:peerAddress - } - - ContactDescription { - Layout.fillHeight: true - Layout.fillWidth: true - - sipAddress: historyView.peerAddress - sipAddressColor: HistoryViewStyle.bar.description.sipAddressColor - username: avatar.username - usernameColor: HistoryViewStyle.bar.description.usernameColor - visible:peerAddress - } - - Row { - Layout.fillHeight: true - - spacing: HistoryViewStyle.bar.actions.spacing - - ActionBar { - anchors.verticalCenter: parent.verticalCenter - iconSize: HistoryViewStyle.bar.actions.call.iconSize - - ActionButton { - isCustom: true - backgroundRadius: 90 - colorSet: HistoryViewStyle.videoCall - visible: peerAddress && SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton - - onClicked: CallsListModel.launchVideoCall(historyView.peerAddress) - } - - ActionButton { - isCustom: true - backgroundRadius: 90 - colorSet: HistoryViewStyle.call - visible: peerAddress && SettingsModel.outgoingCallsEnabled - - onClicked: CallsListModel.launchAudioCall(historyView.peerAddress) - } - } - - ActionBar { - anchors.verticalCenter: parent.verticalCenter - - ActionButton { - isCustom: true - backgroundRadius: 4 - colorSet: historyView._sipAddressObserver && historyView._sipAddressObserver.contact ? ConversationStyle.bar.actions.edit.viewContact : ConversationStyle.bar.actions.edit.addContact - iconSize: HistoryViewStyle.bar.actions.edit.iconSize - visible: peerAddress && SettingsModel.contactsEnabled - - onClicked: window.setView('ContactEdit', { sipAddress: historyView.peerAddress }) - tooltipText: peerAddress?Logic.getEditTooltipText():'' - } - - ActionButton { - isCustom: true - backgroundRadius: 90 - colorSet: HistoryViewStyle.deleteAction - - onClicked: Logic.removeAllEntries() - - tooltipText: qsTr('cleanHistory') - } - } - } - } - } - - // --------------------------------------------------------------------------- - // History. - // --------------------------------------------------------------------------- - - History { - Layout.fillHeight: true - Layout.fillWidth: true - - onEntryClicked:{ - historyView.fullPeerAddress=sipAddress - historyView.peerAddress=sipAddress - historyProxyModel.resetMessageCount() - } - - proxyModel: HistoryProxyModel { - id: historyProxyModel - - Component.onCompleted: { - setEntryTypeFilter() - resetMessageCount() - } - } - } - + id: historyView + + property string peerAddress + property string fullPeerAddress + + readonly property var _sipAddressObserver: peerAddress?SipAddressesModel.getSipAddressObserver((fullPeerAddress?fullPeerAddress:peerAddress), ''):null + + + // --------------------------------------------------------------------------- + + spacing: 0 + + // --------------------------------------------------------------------------- + // Contact bar. + // --------------------------------------------------------------------------- + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: peerAddress?HistoryViewStyle.bar.height:HistoryViewStyle.bar.height/2 + + color: HistoryViewStyle.bar.backgroundColor + + RowLayout { + anchors { + fill: parent + leftMargin: HistoryViewStyle.bar.leftMargin + rightMargin: HistoryViewStyle.bar.rightMargin + } + spacing: HistoryViewStyle.bar.spacing + + layoutDirection: peerAddress?Qt.LeftToRight :Qt.RightToLeft + + Avatar { + id: avatar + + Layout.preferredHeight: HistoryViewStyle.bar.avatarSize + Layout.preferredWidth: HistoryViewStyle.bar.avatarSize + + image: peerAddress?Logic.getAvatar():null + + presenceLevel: historyView._sipAddressObserver?Presence.getPresenceLevel( + historyView._sipAddressObserver.presenceStatus + ):null + + username: peerAddress? UtilsCpp.getDisplayName(historyView._sipAddressObserver.peerAddress):null + visible:peerAddress + } + + ContactDescription { + Layout.fillHeight: true + Layout.fillWidth: true + + sipAddress: historyView.peerAddress + sipAddressColor: HistoryViewStyle.bar.description.sipAddressColor + username: avatar.username + usernameColor: HistoryViewStyle.bar.description.usernameColor + visible:peerAddress + } + + Row { + Layout.fillHeight: true + + spacing: HistoryViewStyle.bar.actions.spacing + + ActionBar { + anchors.verticalCenter: parent.verticalCenter + iconSize: HistoryViewStyle.bar.actions.call.iconSize + + ActionButton { + isCustom: true + backgroundRadius: 90 + colorSet: HistoryViewStyle.videoCall + visible: peerAddress && SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton + + onClicked: CallsListModel.launchVideoCall(historyView.peerAddress) + } + + ActionButton { + isCustom: true + backgroundRadius: 90 + colorSet: HistoryViewStyle.call + visible: peerAddress && SettingsModel.outgoingCallsEnabled + + onClicked: CallsListModel.launchAudioCall(historyView.peerAddress) + } + ActionButton { + isCustom: true + backgroundRadius: 90 + colorSet: HistoryViewStyle.chat + + visible: peerAddress && SettingsModel.standardChatEnabled && SettingsModel.getShowStartChatButton() + + onClicked: CallsListModel.launchChat(historyView.peerAddress, 0) + } + ActionButton { + isCustom: true + backgroundRadius: 1000 + colorSet: HistoryViewStyle.chat + visible: peerAddress && SettingsModel.secureChatEnabled && SettingsModel.getShowStartChatButton() + onClicked: CallsListModel.launchChat(historyView.peerAddress, 1) + Icon{ + icon:'secure_level_1' + iconSize:15 + anchors.right:parent.right + anchors.top:parent.top + anchors.topMargin: -3 + } + } + } + + ActionBar { + anchors.verticalCenter: parent.verticalCenter + + ActionButton { + isCustom: true + backgroundRadius: 4 + colorSet: historyView._sipAddressObserver && historyView._sipAddressObserver.contact ? ConversationStyle.bar.actions.edit.viewContact : ConversationStyle.bar.actions.edit.addContact + iconSize: HistoryViewStyle.bar.actions.edit.iconSize + visible: peerAddress && SettingsModel.contactsEnabled + + onClicked: window.setView('ContactEdit', { sipAddress: historyView.peerAddress }) + tooltipText: peerAddress?Logic.getEditTooltipText():'' + } + + ActionButton { + isCustom: true + backgroundRadius: 90 + colorSet: HistoryViewStyle.deleteAction + + onClicked: Logic.removeAllEntries() + + tooltipText: qsTr('cleanHistory') + } + } + } + } + } + + // --------------------------------------------------------------------------- + // History. + // --------------------------------------------------------------------------- + + History { + Layout.fillHeight: true + Layout.fillWidth: true + + onEntryClicked:{ + historyView.fullPeerAddress=sipAddress + historyView.peerAddress=sipAddress + historyProxyModel.resetMessageCount() + } + + proxyModel: HistoryProxyModel { + id: historyProxyModel + + Component.onCompleted: { + setEntryTypeFilter() + resetMessageCount() + } + } + } + } diff --git a/linphone-app/ui/views/App/Main/MainWindow.qml b/linphone-app/ui/views/App/Main/MainWindow.qml index c68d5ecde..deb15c9b5 100644 --- a/linphone-app/ui/views/App/Main/MainWindow.qml +++ b/linphone-app/ui/views/App/Main/MainWindow.qml @@ -332,6 +332,7 @@ ApplicationWindow { menu.resetSelectedEntry() } onShowHistoryRequest: { + timeline.model.unselectAll() window.setView('HistoryView') } } diff --git a/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml b/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml index 7473ff1c8..a04e41bab 100644 --- a/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml @@ -80,4 +80,15 @@ QtObject { property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'l_h_b_fg').color property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'l_p_b_fg').color } + property QtObject chat: QtObject { + property int iconSize: 40 + property string name : 'chat' + property string icon : 'chat_custom' + property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 's_n_b_bg').color + property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 's_h_b_bg').color + property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 's_p_b_bg').color + property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 's_n_b_fg').color + property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 's_h_b_fg').color + property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 's_p_b_fg').color + } }