From b132e19e2e2e008306b7260a7635d57264cc5ccc Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 28 Dec 2022 12:32:15 +0100 Subject: [PATCH] Increase max image size on GUI. More customization on about, update checker and video. (SDK) Fix a crash when starting a core on an account that don't have a contact address. Fix typo in Readme and adapt MSYS2 paths in CI for Windows. --- .gitlab-ci-files/job-windows-desktop.yml | 2 +- CHANGELOG.md | 1 + README.md | 5 +++-- linphone-app/CMakeLists.txt | 10 +++++++++- linphone-app/src/app/App.cpp | 6 +++++- linphone-app/src/components/camera/Camera.hpp | 1 - .../src/components/settings/SettingsModel.cpp | 17 ++++++++++++++--- .../src/components/settings/SettingsModel.hpp | 2 +- linphone-app/src/utils/Constants.hpp | 4 ++-- .../ui/views/App/Main/Dialogs/About.qml | 8 +++++--- 10 files changed, 41 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci-files/job-windows-desktop.yml b/.gitlab-ci-files/job-windows-desktop.yml index 94e1cf544..3fbb22fc5 100644 --- a/.gitlab-ci-files/job-windows-desktop.yml +++ b/.gitlab-ci-files/job-windows-desktop.yml @@ -23,7 +23,7 @@ # We double the "\" to escape paths as -replace uses regular expressions - $PATH_TEMP = $PATH_TEMP -replace "C:\\MinGW\\bin;" -replace "C:\\Strawberry\\c\\bin;" -replace "C:\\Program Files\\NASM" - echo $PATH_TEMP - - $env:Path = ($PATH_TEMP + ";C:\msys64;C:\msys64\usr\bin;C:\msys64\" + $MINGW_TYPE + "\bin;" + $env:SIGNTOOL_ROOT + "\x64") + - $env:Path = ($PATH_TEMP + ";C:\msys64\" + $MINGW_TYPE + "\bin;" + $env:SIGNTOOL_ROOT + "\x64;C:\msys64;C:\msys64\usr\bin;") - If ($MINGW_TYPE -eq "mingw64") {Import-BatchEnvironment "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"} Else {Import-BatchEnvironment "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"} - If ($MINGW_TYPE -eq "mingw64") {$env:Path = ($env:Path + ";C:\Qt\5.15.2\msvc2019_64\bin")} Else {$env:Path = ($env:Path + ";C:\Qt\5.14.2\msvc2019\bin")} - if ($MAKE_RELEASE_FILE_URL) { } else { $RELEASE_FILE = "" } diff --git a/CHANGELOG.md b/CHANGELOG.md index aeed48d30..7735637ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Missing SetThreadDescription entry point on Windows 7/8 (SDK update) - Add more margin on message's IMDN that was behind the icon menu in chats. - Remove JSON dependencies on unused Flexiapi. +- Crash at startup about missing contact address on account (SDK fix) ## 5.0.2 - 2022-12-13 diff --git a/README.md b/README.md index 3abb8f5ac..b3ffd5640 100644 --- a/README.md +++ b/README.md @@ -178,9 +178,10 @@ If a build for 64bits is needed, replace all `mingw32` by `mingw64`, `i686` by ` - `pacman -Sy --needed base-devel mingw-w64-i686-toolchain` - `pacman -S python3-pip` in `MSYS2 MSYS` console - `python3 -m pip install pystache six` in `cmd` - - In this order, add `C:\msys64\`, `C:\msys64\usr\bin` and `C:\msys64\mingw32\bin` in your PATH (the last one is needed by cmake to know where gcc is) to the PATH environement variable from windows advanced settings. + - In this order, add `C:\msys64\mingw\bin`, `C:\msys64\` and `C:\msys64\usr\bin` in your PATH environement variable from Windows advanced settings. Binaries from the msys folder (not from mingw32/64) doesn't fully support Windows Path and thus, they are to be avoided. +* is the version of MinGW32/64* -When building the SDK, it will install automatically from MSYS2 : `perl`, `yasm`, `gawk`, `bzip2`, `nasm, `sed`, `patch`, `pkg-config`, `gettext`, `glib2` and `intltool` (if needed) +When building the SDK, it will install automatically from MSYS2 : `toolchain`, `python`, `doxygen`, `perl`, `yasm`, `gawk`, `bzip2`, `nasm`, `sed`, `patch`, `pkg-config`, `gettext`, `glib2`, `intltool` and `graphviz` (if needed) - `git` : use MSYS2 : `pacman -S git` or [download](https://git-scm.com/download/win) diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt index 7814431c6..2edfbae96 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -62,7 +62,7 @@ set(APP_LIBRARY app-library) set(APP_PLUGIN app-plugin) include(application_info.cmake) string(TIMESTAMP CURRENT_YEAR "%Y") -if( "${CURRENT_YEAR}" STREQUAL "${APPLICATION_START_LICENCE}") +if(NOT APPLICATION_START_LICENCE OR "${CURRENT_YEAR}" STREQUAL "${APPLICATION_START_LICENCE}") set(COPYRIGHT_RANGE_DATE "${APPLICATION_START_LICENCE}") else() set(COPYRIGHT_RANGE_DATE "${APPLICATION_START_LICENCE}-${CURRENT_YEAR}") @@ -133,10 +133,18 @@ endif() set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network Test Qml) + if(ENABLE_APP_WEBVIEW) list(APPEND QT5_PACKAGES WebView WebEngine WebEngineCore) add_definitions(-DENABLE_WEBVIEW) endif() +if(ENABLE_UPDATE_CHECK) + add_definitions(-DENABLE_UPDATE_CHECK) +endif() +if(ENABLE_VIDEO) + add_definitions(-DENABLE_VIDEO) +endif() + if (UNIX AND NOT APPLE) list(APPEND QT5_PACKAGES DBus) endif () diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index 94e1618ee..13b1ec968 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -425,7 +425,11 @@ void App::initContentApp () { #else mEngine->rootContext()->setContextProperty("applicationLicence", ""); #endif - mEngine->rootContext()->setContextProperty("copyrightRangeDate", COPYRIGHT_RANGE_DATE); +#ifdef COPYRIGHT_RANGE_DATE + mEngine->rootContext()->setContextProperty("copyrightRangeDate", COPYRIGHT_RANGE_DATE); +#else + mEngine->rootContext()->setContextProperty("copyrightRangeDate", ""); +#endif mEngine->rootContext()->setContextProperty("Colors", mColorListModel->getQmlData()); mEngine->rootContext()->setContextProperty("Images", mImageListModel->getQmlData()); diff --git a/linphone-app/src/components/camera/Camera.hpp b/linphone-app/src/components/camera/Camera.hpp index 9e757a867..201acb73b 100644 --- a/linphone-app/src/components/camera/Camera.hpp +++ b/linphone-app/src/components/camera/Camera.hpp @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 5670b7e90..a4412cddb 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -257,7 +257,12 @@ void SettingsModel::setAssistantLogoutUrl (QString url) { } bool SettingsModel::isCguAccepted () const{ - return !!mConfig->getInt(UiSection, "read_and_agree_terms_and_privacy", 0); +#ifdef APPLICATION_VENDOR + QString applicationVendor = APPLICATION_VENDOR; +#else + QString applicationVendor; +#endif + return !!mConfig->getInt(UiSection, "read_and_agree_terms_and_privacy", ( applicationVendor != "" && Constants::CguUrl != QString("") && Constants::PrivatePolicyUrl != QString("") ? 0 : 1)); } void SettingsModel::acceptCgu(const bool accept){ @@ -1572,8 +1577,14 @@ void SettingsModel::setCheckForUpdateEnabled(bool enable){ emit checkForUpdateEnabledChanged(); } -QString SettingsModel::getVersionCheckUrl() const{ - return Utils::coreStringToAppString(mConfig->getString("misc", "version_check_url_root", Constants::VersionCheckReleaseUrl)); +QString SettingsModel::getVersionCheckUrl(){ + auto url = mConfig->getString("misc", "version_check_url_root", ""); + if( url == "" ){ + url = Constants::VersionCheckReleaseUrl; + if( url != "") + mConfig->setString("misc", "version_check_url_root", url); + } + return Utils::coreStringToAppString(url); } void SettingsModel::setVersionCheckUrl(const QString& url){ diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index e9a9c6863..5c01789d5 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -580,7 +580,7 @@ public: bool isCheckForUpdateEnabled() const; void setCheckForUpdateEnabled(bool enable); - QString getVersionCheckUrl() const; + QString getVersionCheckUrl(); void setVersionCheckUrl(const QString& url); VersionCheckType getVersionCheckType() const; diff --git a/linphone-app/src/utils/Constants.hpp b/linphone-app/src/utils/Constants.hpp index 2140a8a52..5ea3ca22a 100644 --- a/linphone-app/src/utils/Constants.hpp +++ b/linphone-app/src/utils/Constants.hpp @@ -82,8 +82,8 @@ public: static constexpr char DefaultAssistantLogoutUrl[] = "https://subscribe.linphone.org/logout"; //-------------- - // Max image size in bytes. (100Kb) - static constexpr qint64 MaxImageSize = 102400;// In Bytes. + // Max image size in bytes. (1Mb) + static constexpr qint64 MaxImageSize = 1024000;// In Bytes. static constexpr qint64 FileSizeLimit = 524288000;// In Bytes. static constexpr int ThumbnailImageFileWidth = 100; static constexpr int ThumbnailImageFileHeight = 100; diff --git a/linphone-app/ui/views/App/Main/Dialogs/About.qml b/linphone-app/ui/views/App/Main/Dialogs/About.qml index a37fa4618..b33fc72b3 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/About.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/About.qml @@ -94,9 +94,11 @@ DialogPlus { color: AboutStyle.copyrightBlock.license.colorModel.color elide: Text.ElideRight font.pointSize: AboutStyle.copyrightBlock.license.pointSize - visible: applicationVendor != '' - text: (applicationLicence? applicationLicence+'\n':'') +'\u00A9 '+ copyrightRangeDate + - ' ' + applicationVendor + visible: applicationVendor || applicationLicence || copyrightRangeDate + text: (applicationLicence? applicationLicence+'\n':'') + +(copyrightRangeDate || applicationVendor ? '\u00A9 ': '') + + (copyrightRangeDate ? copyrightRangeDate : '') + + (applicationVendor ? ' ' + applicationVendor : '') width: parent.width