Bugfixes : MacOs crash, Video request not working, fonts

* Activate mipmap on MacOs to avoid Qt crashes
* Use 5.14.2 for Windows
* Request Qt 5.12 as a minimal version and cmake 3.9 (in order to embed big resources)
* Remove build on Debian8 as it has Qt 5.10
* Add default fonts for supported languages
* Use a build parameter to set `dpiawareness` (Windows)
* Add OTF support, in addition of TTF
* Explicit the answer to video request : Fix on not showing video when accepting a second request
* Use UTF8 when chatting and notifications to show all languages/symbols
* Fix SIP display on call view
* Fix a typo on a variable in call view (might lead to get transparent view)
This commit is contained in:
Julien Wadel 2020-06-19 09:25:51 +02:00
parent 3ee4a72d48
commit eba233655e
30 changed files with 92 additions and 57 deletions

View file

@ -3,8 +3,8 @@
#################################################
.build_all_windows_script: &build_all_windows_script |
SET Qt5_DIR=C:\Qt\5.12.5\msvc2017\lib\cmake
SET PATH=%PATH%;C:\Qt\5.12.5\msvc2017\bin
SET Qt5_DIR=C:\Qt\5.14.2\msvc2017\lib\cmake
SET PATH=%PATH%;C:\Qt\5.14.2\msvc2017\bin
IF EXIST build RMDIR /S /Q build
mkdir build
cd build

View file

@ -32,7 +32,7 @@ variables:
include:
- '.gitlab-ci-files/job-linux-prepare.yml'
- '.gitlab-ci-files/job-linux-desktop.yml'
- '.gitlab-ci-files/job-linux-desktop-debian8.yml'
#- '.gitlab-ci-files/job-linux-desktop-debian8.yml' #Removed as there is 5.10 and not at least 5.12
- '.gitlab-ci-files/job-linux-desktop-debian9.yml'
## - '.gitlab-ci-files/job-linux-desktop-debian10.yml'
- '.gitlab-ci-files/job-linux-desktop-ubuntu-rolling.yml'

View file

@ -20,7 +20,9 @@
#
################################################################################
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.9)
#3.9 for qt5_add_big_resources
get_cmake_property(vars CACHE_VARIABLES)
foreach(var ${vars})
@ -155,6 +157,13 @@ include(FindPkgConfig)
set(APP_DEPENDS sdk)
find_package(Qt5 5.12 COMPONENTS Core REQUIRED)
if ( NOT Qt5_FOUND )
message(FATAL_ERROR "Minimum supported Qt5 version is 5.12!")
endif()
find_package(LinphoneCxx CONFIG QUIET)
find_package(Linphone CONFIG QUIET)
find_package(bctoolbox CONFIG QUIET)

View file

@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.9)
project(linphoneqt VERSION 4.2.0)
@ -86,6 +86,8 @@ endif ()
set(QT5_PACKAGES_OPTIONAL TextToSpeech)
set(CMAKE_AUTOMOC ON)
find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED)
find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET)
bc_git_version(${TARGET_NAME} ${PROJECT_VERSION})
@ -255,7 +257,7 @@ else ()
endif ()
set(QRC_RESOURCES resources.qrc)
qt5_add_big_resources(QRC_BIG_RESOURCES resources.qrc)
set(LANGUAGES_DIRECTORY "${ASSETS_DIR}/languages")
set(I18N_FILENAME i18n.qrc)
set(LANGUAGES da de en es fr_FR hu it ja lt pt_BR ru sv tr uk zh_CN)
@ -341,8 +343,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT
# ------------------------------------------------------------------------------
include_directories(src/)
find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED)
find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET)
if (CMAKE_INSTALL_RPATH)
#Retrieve lib path from a know QT executable
@ -357,20 +359,20 @@ list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_F
get_directory_property(TS_FILES DIRECTORY "${LANGUAGES_DIRECTORY}" DEFINITION TS_FILES)
list(APPEND SOURCES ${TS_FILES})
#add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${RESOURCES} ${QML_SOURCES})
add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES})
#add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES})
add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES})
if(TARGET_NAME_ONLY)
add_library(${APP_LIBRARY_ONLY} OBJECT EXCLUDE_FROM_ALL ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES})
add_library(${APP_LIBRARY_ONLY} OBJECT EXCLUDE_FROM_ALL ${SOURCES} ${HEADERS} ${QML_SOURCES}})
endif()
if (WIN32)
add_executable(${TARGET_NAME} WIN32 $<TARGET_OBJECTS:${APP_LIBRARY}> ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE})
add_executable(${TARGET_NAME} WIN32 $<TARGET_OBJECTS:${APP_LIBRARY}> ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE} ${QRC_BIG_RESOURCES})
if(TARGET_NAME_ONLY)
add_executable(${TARGET_NAME_ONLY} WIN32 EXCLUDE_FROM_ALL $<TARGET_OBJECTS:${APP_LIBRARY_ONLY}> ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE})
add_executable(${TARGET_NAME_ONLY} WIN32 EXCLUDE_FROM_ALL $<TARGET_OBJECTS:${APP_LIBRARY_ONLY}> ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE} ${QRC_BIG_RESOURCES})
endif()
else ()
add_executable(${TARGET_NAME} $<TARGET_OBJECTS:${APP_LIBRARY}> ${MAIN_FILE})
add_executable(${TARGET_NAME} $<TARGET_OBJECTS:${APP_LIBRARY}> ${MAIN_FILE} ${QRC_BIG_RESOURCES})
if(TARGET_NAME_ONLY)
add_executable(${TARGET_NAME_ONLY} EXCLUDE_FROM_ALL $<TARGET_OBJECTS:${APP_LIBRARY_ONLY}> ${MAIN_FILE})
add_executable(${TARGET_NAME_ONLY} EXCLUDE_FROM_ALL $<TARGET_OBJECTS:${APP_LIBRARY_ONLY}> ${MAIN_FILE} ${QRC_BIG_RESOURCES})
endif()
endif ()
if(TARGET_NAME_ONLY)

View file

@ -50,6 +50,7 @@ set(LRELEASE_OPTIONS "")
#Clean existing generated file to force re-creation
file(REMOVE ${QM_FILES})
file(REMOVE ${TARGET_TS_FILES})
file(REMOVE ${QRC_BIG_RESOURCES})
add_custom_command(OUTPUT ${TARGET_TS_FILES}
COMMAND ${Qt5_LUPDATE_EXECUTABLE}

View file

@ -1,3 +1,3 @@
[Platforms]
WindowsArguments = dpiawareness=1
WindowsArguments = dpiawareness=@APP_QT_CONF_DPI@
@APP_QT_CONF_PATH@

View file

@ -97,8 +97,8 @@ endif ()
# ==============================================================================
# Specific deployment.
# ==============================================================================
if (WIN32)
set(APP_QT_CONF_DPI "1")
if (WIN32)
find_program(DEPLOYQT_PROGRAM windeployqt)
if (NOT DEPLOYQT_PROGRAM)
message(FATAL_ERROR "Could not find the windeployqt program. Make sure it is in the PATH.")
@ -132,6 +132,7 @@ if (WIN32)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/sounds" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS)
install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}/")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../assets/linphonerc-factory" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}")
set(APP_QT_CONF_DPI "0")
set(APP_QT_CONF_PATH "")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../assets/qt.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/../../qt.conf" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../../qt.conf" DESTINATION "${CMAKE_INSTALL_BINDIR}")
@ -243,7 +244,8 @@ else()# Not Windows and Apple
# Install desktop/icon files.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../assets/linphone.desktop.cmake" "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}.desktop" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
set(APP_QT_CONF_PATH "")
set(APP_QT_CONF_PATH "")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../assets/qt.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/../../qt.conf" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../../qt.conf" DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../assets/images/linphone_logo.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps/" RENAME "${EXECUTABLE_NAME}.svg")

View file

@ -481,5 +481,11 @@
<file>ui/dev-modules/Colors/Colors.qml</file>
<file>ui/dev-modules/Units/Units.qml</file>
<file>assets/icon.ico</file>
<file>assets/fonts/NotoSans-hinted/NotoSansCJKjp-Regular.otf</file>
<file>assets/fonts/NotoSans-hinted/NotoSansCJKjp-Bold.otf</file>
<file>assets/fonts/NotoSans-hinted/NotoColorEmoji.ttf</file>
<file>assets/fonts/NotoSans-hinted/NotoEmoji-Regular.ttf</file>
<file>assets/fonts/NotoSans-hinted/NotoSansSC-Bold.otf</file>
<file>assets/fonts/NotoSans-hinted/NotoSansSC-Regular.otf</file>
</qresource>
</RCC>

View file

@ -80,12 +80,14 @@ AppController::AppController (int &argc, char *argv[]) {
while (it.hasNext()) {
QFileInfo info(it.next());
if (info.suffix() == QLatin1String("ttf")) {
if (info.suffix() == QLatin1String("ttf") || info.suffix() == QLatin1String("otf")) {
QString path = info.absoluteFilePath();
if (path.startsWith(":/assets/fonts/"))
QFontDatabase::addApplicationFont(path);
if(QFontDatabase::addApplicationFont(path)<0)
qWarning() << "Font cannot load : " << path;
}
}
qInfo() << "Available fonts : " << QFontDatabase().families();
mApp->setFont(QFont(DefaultFont));
}

View file

@ -208,15 +208,17 @@ bool CallModel::transferTo (const QString &sipAddress) {
// -----------------------------------------------------------------------------
void CallModel::acceptVideoRequest () {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::CallParams> params = core->createCallParams(mCall);
shared_ptr<linphone::CallParams> params = CoreManager::getInstance()->getCore()->createCallParams(mCall);
params->enableVideo(true);
mCall->acceptUpdate(params);
}
void CallModel::rejectVideoRequest () {
mCall->acceptUpdate(mCall->getCurrentParams());
shared_ptr<linphone::CallParams> params = CoreManager::getInstance()->getCore()->createCallParams(mCall);
params->enableVideo(false);
mCall->acceptUpdate(params);
}
void CallModel::takeSnapshot () {

View file

@ -191,7 +191,13 @@ static inline void removeFileMessageThumbnail (const shared_ptr<linphone::ChatMe
// -----------------------------------------------------------------------------
static inline void fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::ChatMessage> &message) {
dest["content"] = Utils::coreStringToAppString(message->getTextContent());
std::list<std::shared_ptr<linphone::Content>> contents = message->getContents();
QString txt;
foreach(auto content, contents){
if(content->isText())
txt += content->getStringBuffer().c_str();
}
dest["content"] = txt;
dest["isOutgoing"] = message->isOutgoing() || message->getState() == linphone::ChatMessage::State::Idle;
// Old workaround.
@ -481,7 +487,8 @@ void ChatModel::removeAllEntries () {
// -----------------------------------------------------------------------------
void ChatModel::sendMessage (const QString &message) {
shared_ptr<linphone::ChatMessage> _message = mChatRoom->createMessage(Utils::appStringToCoreString(message));
shared_ptr<linphone::ChatMessage> _message = mChatRoom->createMessage("");
_message->getContents().begin()->get()->setStringBuffer(message.toUtf8().toStdString());
_message->removeListener(mMessageHandlers);// Remove old listener if already exists
_message->addListener(mMessageHandlers);

View file

@ -262,10 +262,15 @@ void Notifier::deleteNotification (QVariant notification) {
void Notifier::notifyReceivedMessage (const shared_ptr<linphone::ChatMessage> &message) {
QVariantMap map;
map["message"] = message->getFileTransferInformation()
? tr("newFileMessage")
: Utils::coreStringToAppString(message->getText());
QString txt;
if(! message->getFileTransferInformation() ){
foreach(auto content, message->getContents()){
if(content->isText())
txt += content->getStringBuffer().c_str();
}
}else
txt = tr("newFileMessage");
map["message"] = txt;
shared_ptr<linphone::ChatRoom> chatRoom(message->getChatRoom());
map["peerAddress"] = Utils::coreStringToAppString(chatRoom->getPeerAddress()->asStringUriOnly());
map["localAddress"] = Utils::coreStringToAppString(chatRoom->getLocalAddress()->asStringUriOnly());

View file

@ -15,6 +15,7 @@ Item {
width: iconSize
Image {
mipmap: Qt.platform.os === 'osx'
function getIconSize () {
Utils.assert(
iconSize != null && iconSize >= 0,

View file

@ -19,7 +19,7 @@ Item {
Image {
id: image
mipmap: Qt.platform.os === 'osx'
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
sourceSize.width: parent.width

View file

@ -99,7 +99,7 @@ Core.ToolTip {
// and `implicitWidth`.
Core.Image {
id: icon
mipmap: Qt.platform.os === 'osx'
fillMode: Core.Image.PreserveAspectFit
height: TooltipStyle.arrowSize
source: _edge

View file

@ -80,6 +80,7 @@ Row {
id: thumbnail
Image {
mipmap: Qt.platform.os === 'osx'
source: $chatEntry.thumbnail
}
}

View file

@ -22,21 +22,20 @@ Column {
elide: Text.ElideRight
font.bold: true
font.pointSize: ContactDescriptionStyle.username.pointSize
height: parent.height / 2
horizontalAlignment: horizontalTextAlignment
verticalAlignment: Text.AlignBottom
width: parent.width
height: (parent.height-parent.topPadding-parent.bottomPadding)/parent.visibleChildren.length
}
Text {
text: SipAddressesModel.cleanSipAddress(sipAddress)
color: sipAddressColor
elide: Text.ElideRight
font.pointSize: ContactDescriptionStyle.sipAddress.pointSize
height: parent.height / 2
horizontalAlignment: horizontalTextAlignment
verticalAlignment: Text.AlignTop
width: parent.width
height: (parent.height-parent.topPadding-parent.bottomPadding)/parent.visibleChildren.length
}
}

View file

@ -44,6 +44,7 @@ Notification {
}
Image{
id:image
mipmap: Qt.platform.os === 'osx'
Layout.fillHeight: true
Layout.fillWidth: true
fillMode: Image.PreserveAspectFit

View file

@ -47,7 +47,7 @@ Window {
function setHeight (height) {
window.height = (Window.screen && height > Window.screen.desktopAvailableHeight)
? Winodw.screen.desktopAvailableHeight
? Window.screen.desktopAvailableHeight
: height
}

View file

@ -64,25 +64,6 @@ Rectangle {
Layout.rightMargin: CallStyle.header.rightMargin
Layout.preferredHeight: CallStyle.header.contactDescription.height
Text {
id: elapsedTime
anchors.bottom: parent.bottom
color: CallStyle.header.elapsedTime.color
font.pointSize: CallStyle.header.elapsedTime.pointSize
horizontalAlignment: Text.AlignHCenter
width: parent.width
Timer {
interval: 1000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {elapsedTime.text = Utils.formatElapsedTime(call.duration);}
}
}
ActionBar {
id: leftActions
@ -144,11 +125,27 @@ Rectangle {
anchors.centerIn: parent
horizontalTextAlignment: Text.AlignHCenter
sipAddress: ''
sipAddress: _sipAddressObserver.peerAddress
username: LinphoneUtils.getContactUsername(_sipAddressObserver)
height: parent.height
width: parent.width - rightActions.width - leftActions.width - CallStyle.header.contactDescription.width
width: parent.width - rightActions.width - leftActions.width
Text {
id: elapsedTime
color: CallStyle.header.elapsedTime.color
font.pointSize: CallStyle.header.elapsedTime.pointSize
horizontalAlignment: Text.AlignHCenter
width: parent.width
Timer {
interval: 1000
repeat: true
running: true
triggeredOnStart: true
onTriggered: {elapsedTime.text = Utils.formatElapsedTime(call.duration);}
}
}
}
// -----------------------------------------------------------------------