From c6df2a1868e0ab2cc73b29d9537fcd418d61cc64 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 21 Dec 2022 15:00:47 +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 --- 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 | 25 ++++++++++++++++--- .../src/components/settings/SettingsModel.hpp | 2 +- linphone-app/src/utils/Constants.hpp | 4 +-- .../ui/views/App/Main/Dialogs/About.qml | 8 +++--- linphone-sdk | 2 +- 10 files changed, 48 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad258ad6c..ce4e42de7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,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 68475b362..b0231492a 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -57,7 +57,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}") @@ -123,10 +123,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 76276e2d8..4dd3a10ec 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 c599ebad6..f9108f8cd 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -225,7 +225,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){ @@ -1525,7 +1530,13 @@ void SettingsModel::setExitOnClose (bool value) { } bool SettingsModel::isCheckForUpdateEnabled() const{ - return !!mConfig->getInt(UiSection, "check_for_update_enabled", 1); +#ifdef ENABLE_UPDATE_CHECK + int enabled = 1; +#else + int enabled = 0; +#endif + return !!mConfig->getInt(UiSection, "check_for_update_enabled", enabled); + } void SettingsModel::setCheckForUpdateEnabled(bool enable){ @@ -1533,8 +1544,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 ab4211f7f..d3cdcde37 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -573,7 +573,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 da45c7e0a..6810c4d98 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.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 diff --git a/linphone-sdk b/linphone-sdk index 27c02e232..180d93a62 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 27c02e232d7fd5facdcd21c2b15d558812ab4151 +Subproject commit 180d93a62aa9279e7d4c82ec4df50b45c4901927