diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index dbd5fa741..9661ec815 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -430,6 +430,43 @@ void App::setSelf(QSharedPointer(me)) { }); }); + // Check update + mCoreModelConnection->makeConnectToModel( + &CoreModel::versionUpdateCheckResultReceived, + [this](const std::shared_ptr &core, linphone::VersionUpdateCheckResult result, + const std::string &version, const std::string &url, bool checkRequestedByUser) { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + mCoreModelConnection->invokeToCore([this, result, version, url, checkRequestedByUser] { + switch (result) { + case linphone::VersionUpdateCheckResult::Error: + if (checkRequestedByUser) + Utils::showInformationPopup(tr("info_popup_error_title"), + //: An error occured while trying to check update. Please + //: try again later or contact support team. + tr("info_popup_error_checking_update"), false); + break; + case linphone::VersionUpdateCheckResult::NewVersionAvailable: { + QString downloadLink = + QStringLiteral("%2") + .arg(url) + .arg(tr("info_popup_new_version_download_label")); + Utils::showInformationPopup( + //: New version available ! + tr("info_popup_new_version_available_title"), + //: A new version of Linphone (%1) is available. %2 + tr("info_popup_new_version_available_message").arg(version).arg(downloadLink)); + break; + } + case linphone::VersionUpdateCheckResult::UpToDate: + if (checkRequestedByUser) + //: Up to date + Utils::showInformationPopup(tr("info_popup_version_up_to_date_title"), + //: Your version is up to date + tr("info_popup_version_up_to_date_message")); + } + }); + }); + //--------------------------------------------------------------------------------------------- mCliModelConnection = SafeConnection::create(me, CliModel::getInstance()); mCliModelConnection->makeConnectToCore(&App::receivedMessage, [this](int, const QByteArray &byteArray) { @@ -660,6 +697,7 @@ void App::initCore() { tr("info_popup_configuration_failed_message").arg(message), false); }); } + checkForUpdate(); mIsRestarting = false; //--------------------------------------------------------------------------------------------- @@ -1357,6 +1395,12 @@ void App::setSysTrayIcon() { menu->addSeparator(); } menu->addAction(markAllReadAction); + //: Check for update + if (mSettings->isCheckForUpdateAvailable()) { + QAction *checkForUpdateAction = new QAction(tr("check_for_update"), root); + root->connect(checkForUpdateAction, &QAction::triggered, this, [this] { checkForUpdate(); }); + menu->addAction(checkForUpdateAction); + } menu->addAction(quitAction); if (!mSystemTrayIcon) { systemTrayIcon->setContextMenu(menu); // This is a Qt bug. We cannot call setContextMenu more than once. So @@ -1436,6 +1480,17 @@ QString App::getSdkVersion() { #endif } +void App::checkForUpdate(bool requestedByUser) { + mustBeInMainThread(log().arg(Q_FUNC_INFO)); + if (CoreModel::getInstance() && mCoreModelConnection) { + mCoreModelConnection->invokeToModel([this, requestedByUser] { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + CoreModel::getInstance()->checkForUpdate(Utils::appStringToCoreString(applicationVersion()), + requestedByUser); + }); + } +} + ChatGui *App::getCurrentChat() const { return mCurrentChat; } diff --git a/Linphone/core/App.hpp b/Linphone/core/App.hpp index e3dfbc1b7..ef0719258 100644 --- a/Linphone/core/App.hpp +++ b/Linphone/core/App.hpp @@ -165,6 +165,7 @@ public: QString getGitBranchName(); QString getSdkVersion(); + Q_INVOKABLE void checkForUpdate(bool requestedByUser = false); ChatGui *getCurrentChat() const; void setCurrentChat(ChatGui *chat); diff --git a/Linphone/core/setting/SettingsCore.cpp b/Linphone/core/setting/SettingsCore.cpp index 16080a359..77e22c786 100644 --- a/Linphone/core/setting/SettingsCore.cpp +++ b/Linphone/core/setting/SettingsCore.cpp @@ -107,6 +107,9 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) { mEmojiFont = settingsModel->getEmojiFont(); mTextMessageFont = settingsModel->getTextMessageFont(); + // Check for update + mIsCheckForUpdateAvailable = settingsModel->isCheckForUpdateAvailable(); + // Ui INIT_CORE_MEMBER(DisableChatFeature, settingsModel) INIT_CORE_MEMBER(DisableMeetingsFeature, settingsModel) @@ -1143,6 +1146,9 @@ void SettingsCore::writeFromModel(const std::shared_ptr &model) { mLogsFolder = model->getLogsFolder(); mLogsEmail = model->getLogsEmail(); + // Check update + mIsCheckForUpdateAvailable = model->isCheckForUpdateAvailable(); + // UI mDisableChatFeature = model->getDisableChatFeature(); mDisableMeetingsFeature = model->getDisableMeetingsFeature(); @@ -1171,6 +1177,10 @@ void SettingsCore::writeFromModel(const std::shared_ptr &model) { mDownloadFolder = model->getDownloadFolder(); } +bool SettingsCore::isCheckForUpdateAvailable() const { + return mIsCheckForUpdateAvailable; +} + void SettingsCore::save() { mustBeInMainThread(getClassName() + Q_FUNC_INFO); SettingsCore *thisCopy = new SettingsCore(*this); diff --git a/Linphone/core/setting/SettingsCore.hpp b/Linphone/core/setting/SettingsCore.hpp index 649d678e3..ec8851b1d 100644 --- a/Linphone/core/setting/SettingsCore.hpp +++ b/Linphone/core/setting/SettingsCore.hpp @@ -218,6 +218,7 @@ public: bool getCardDAVMinCharForResearch() const; void setCardDAVMinCharForResearch(int min); + bool isCheckForUpdateAvailable() const; Q_INVOKABLE void save(); Q_INVOKABLE void undo(); @@ -401,6 +402,9 @@ private: // CardDAV int mCardDAVMinCharForResearch = 0; + // Check update + bool mIsCheckForUpdateAvailable = false; + DECLARE_ABSTRACT_OBJECT }; #endif diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 60bfe1660..ae24e7eb8 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -641,93 +641,134 @@ - + + info_popup_error_title Error Fehler - + info_popup_configuration_failed_message Remote provisioning failed : %1 - + + info_popup_error_checking_update + An error occured while trying to check update. Please try again later or contact support team. + + + + + info_popup_new_version_download_label + + + + + info_popup_new_version_available_title + New version available ! + + + + + info_popup_new_version_available_message + A new version of Linphone (%1) is available. %2 + + + + + info_popup_version_up_to_date_title + + + + + info_popup_version_up_to_date_message + Your version is up to date + + + + configuration_error_detail not reachable - + application_description "A free and open source SIP video-phone." Ein kostenloses Open-Source SIP Video-Telefon. - + command_line_arg_order "Send an order to the application towards a command line" Kommandozeilen-Befehl an die Anwendung schicken - + command_line_option_show_help Zeige Hilfe - + command_line_option_show_app_version App-Version anzeigen - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, Pfad oder Datei - + command_line_option_minimized - + command_line_option_log_to_stdout Debug-Informationen auf der Standardausgabe ausgeben - + command_line_option_print_app_logs_only "Print only logs from the application" Nur Anwendungs-Logs ausgeben - + hide_action "Cacher" "Afficher" Ausblenden - + show_action Zeigen - + quit_action "Quitter" Beenden - + + check_for_update + Check for update + + + + mark_all_read_action @@ -2021,13 +2062,13 @@ ChatCore - + info_toast_deleted_title Deleted - + info_toast_deleted_message_history Message history has been deleted @@ -3879,50 +3920,56 @@ Error HelpPage - + help_title "Aide" Hilfe - - + + help_about_title "À propos de %1" Über %1 - + help_about_privacy_policy_title "Règles de confidentialité" Datenschutzrichtlinie - + help_about_privacy_policy_subtitle Quelles informations %1 collecte et utilise Welche Informationen sammelt und verwendet %1 - + help_about_version_title "Version" Version - + + help_check_for_update_button_label + Check update + + + + help_about_gpl_licence_title "Licences GPLv3" GPLv3-Lizenzen - + help_about_contribute_translations_title "Contribuer à la traduction de %1" Zur Übersetzung von %1 beitragen - + help_troubleshooting_title "Dépannage" Fehlerbehebung @@ -5784,6 +5831,13 @@ Pour les activer dans un projet commercial, merci de nous contacter. Konversationen + + SettingsCore + + info_popup_error_title + Fehler + + SettingsMenuItem diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 53fcad501..191f520e5 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -636,93 +636,134 @@ - + + info_popup_error_title Error Error - + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote provisioning failed : %1 - + + info_popup_error_checking_update + An error occured while trying to check update. Please try again later or contact support team. + An error occured while trying to check update. Please try again later or contact support team. + + + + info_popup_new_version_download_label + + + + + info_popup_new_version_available_title + New version available ! + New version available ! + + + + info_popup_new_version_available_message + A new version of Linphone (%1) is available. %2 + A new version of Linphone (%1) is available at %1 + + + + info_popup_version_up_to_date_title + Up to date + + + + info_popup_version_up_to_date_message + Your version is up to date + Up to date Your version is up to date + + + configuration_error_detail not reachable not reachable - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Show app version - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimize - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Hide - + show_action Show - + quit_action "Quitter" Quit - + + check_for_update + Check for update + Check for update + + + mark_all_read_action Marquer tout comme lu @@ -1998,13 +2039,13 @@ ChatCore - + info_toast_deleted_title Deleted Deleted - + info_toast_deleted_message_history Message history has been deleted Message history has been deleted @@ -3795,50 +3836,56 @@ Expiration : %1 HelpPage - + help_title "Aide" Help - - + + help_about_title "À propos de %1" About %1 - + help_about_privacy_policy_title "Règles de confidentialité" Privacy Policy - + help_about_privacy_policy_subtitle Quelles informations %1 collecte et utilise What information does %1 collect and use - + help_about_version_title "Version" Version - + + help_check_for_update_button_label + Check update + Check for update + + + help_about_gpl_licence_title "Licences GPLv3" GPLv3 licences - + help_about_contribute_translations_title "Contribuer à la traduction de %1" Contribute to the translation of %1 - + help_troubleshooting_title "Dépannage" Troubleshooting diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index bf5310bf2..54d40cd4c 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -636,93 +636,134 @@ - + + info_popup_error_title Error Erreur - + info_popup_configuration_failed_message Remote provisioning failed : %1 La configuration distante a échoué : %1 - + + info_popup_error_checking_update + An error occured while trying to check update. Please try again later or contact support team. + Une erreur est survenue lors de la recherche de mise à jour. Merci de réessayer plus tard ou de contacter l'équipe de support. + + + + info_popup_new_version_download_label + Téléchargez-là ! + + + + info_popup_new_version_available_title + New version available ! + Nouvelle version disponible ! + + + + info_popup_new_version_available_message + A new version of Linphone (%1) is available. %2 + Une nouvelle version de Linphone (%1) est disponible. %2 + + + + info_popup_version_up_to_date_title + À jour + + + + info_popup_version_up_to_date_message + Your version is up to date + Votre version est à jour + + + configuration_error_detail not reachable indisponible - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Afficher la version de l'application - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimiser - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Cacher - + show_action Afficher - + quit_action "Quitter" Quitter - + + check_for_update + Check for update + Rechercher une mise à jour + + + mark_all_read_action Marquer tout comme lu @@ -1998,13 +2039,13 @@ ChatCore - + info_toast_deleted_title Deleted Supprimé - + info_toast_deleted_message_history Message history has been deleted L'historique des messages a été supprimé @@ -3795,50 +3836,56 @@ Expiration : %1 HelpPage - + help_title "Aide" Aide - - + + help_about_title "À propos de %1" À propos de %1 - + help_about_privacy_policy_title "Règles de confidentialité" Règles de confidentialité - + help_about_privacy_policy_subtitle Quelles informations %1 collecte et utilise Quelles informations %1 collecte et utilise - + help_about_version_title "Version" Version - + + help_check_for_update_button_label + Check update + Rechercher une mise à jour + + + help_about_gpl_licence_title "Licences GPLv3" Licences GPLv3 - + help_about_contribute_translations_title "Contribuer à la traduction de %1" Contribuer à la traduction de %1 - + help_troubleshooting_title "Dépannage" Dépannage diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index 143524322..f36550773 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -368,6 +368,17 @@ void CoreModel::searchInMagicSearch(QString filter, mMagicSearch->search(filter, sourceFlags, aggregation, maxResults); } +void CoreModel::checkForUpdate(const std::string &applicationVersion, bool requestedByUser) { + mCheckVersionRequestedByUser = requestedByUser; + if (SettingsModel::getInstance()->isCheckForUpdateEnabled()) { + CoreModel::getInstance()->getCore()->checkForUpdate(applicationVersion); + } +} + +bool CoreModel::isCheckVersionRequestedByUser() const { + return mCheckVersionRequestedByUser; +} + //--------------------------------------------------------------------------------------------------------------------------- void CoreModel::onAccountAdded(const std::shared_ptr &core, @@ -585,7 +596,7 @@ void CoreModel::onVersionUpdateCheckResultReceived(const std::shared_ptr &core, diff --git a/Linphone/model/core/CoreModel.hpp b/Linphone/model/core/CoreModel.hpp index 1c07c9cc7..0bbc46c82 100644 --- a/Linphone/model/core/CoreModel.hpp +++ b/Linphone/model/core/CoreModel.hpp @@ -71,6 +71,9 @@ public: LinphoneEnums::MagicSearchAggregation aggregation, int maxResults); + void checkForUpdate(const std::string &applicationVersion, bool requestedByUser = false); + bool isCheckVersionRequestedByUser() const; + bool mEnd = false; linphone::ConfiguringState mConfigStatus; QString mConfigMessage; @@ -97,6 +100,7 @@ private: QMap mOpenIdConnections; std::shared_ptr mMagicSearch; bool mStarted = false; + bool mCheckVersionRequestedByUser = false; void setPathBeforeCreation(); void setPathsAfterCreation(); @@ -281,7 +285,8 @@ signals: void versionUpdateCheckResultReceived(const std::shared_ptr &core, linphone::VersionUpdateCheckResult result, const std::string &version, - const std::string &url); + const std::string &url, + bool checkRequestedByUser); void friendListRemoved(const std::shared_ptr &core, const std::shared_ptr &friendList); }; diff --git a/Linphone/model/setting/SettingsModel.cpp b/Linphone/model/setting/SettingsModel.cpp index 125cbc6cc..a2bb672c5 100644 --- a/Linphone/model/setting/SettingsModel.cpp +++ b/Linphone/model/setting/SettingsModel.cpp @@ -855,6 +855,40 @@ bool SettingsModel::getDisableMeetingsFeature() const { return !!mConfig->getInt(UiSection, "disable_meetings_feature", 0); } +bool SettingsModel::isCheckForUpdateAvailable() const { +#ifdef ENABLE_UPDATE_CHECK + return true; +#else + return false; +#endif +} + +bool SettingsModel::isCheckForUpdateEnabled() const { + return !!mConfig->getInt(UiSection, "check_for_update_enabled", isCheckForUpdateAvailable()); +} + +void SettingsModel::setCheckForUpdateEnabled(bool enable) { + mConfig->setInt(UiSection, "check_for_update_enabled", enable); + emit checkForUpdateEnabledChanged(); +} + +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) { + if (url != getVersionCheckUrl()) { + // Do not trim the url before because we want to update GUI from potential auto fix. + mConfig->setString("misc", "version_check_url_root", Utils::appStringToCoreString(url.trimmed())); + emit versionCheckUrlChanged(); + } +} + void SettingsModel::setChatNotificationSoundPath(const QString &path) { QString cleanedPath = QDir::cleanPath(path); mConfig->setString(UiSection, "chat_sound_notification_file", Utils::appStringToCoreString(cleanedPath)); diff --git a/Linphone/model/setting/SettingsModel.hpp b/Linphone/model/setting/SettingsModel.hpp index 2673dd7e7..416dbf954 100644 --- a/Linphone/model/setting/SettingsModel.hpp +++ b/Linphone/model/setting/SettingsModel.hpp @@ -22,6 +22,7 @@ #define SETTINGS_MODEL_H_ #include "MediastreamerUtils.hpp" +#include "tool/LinphoneEnums.hpp" #include #include #include @@ -186,6 +187,13 @@ public: void setDisableMeetingsFeature(bool value); bool getDisableMeetingsFeature() const; + bool isCheckForUpdateAvailable() const; + bool isCheckForUpdateEnabled() const; + void setCheckForUpdateEnabled(bool enable); + QString getVersionCheckUrl(); + void setVersionCheckUrl(const QString &url); + void setVersionCheckType(const LinphoneEnums::VersionCheckType &type); + // UI DECLARE_GETSET(bool, disableChatFeature, DisableChatFeature) DECLARE_GETSET(bool, disableBroadcastFeature, DisableBroadcastFeature) @@ -269,6 +277,9 @@ signals: void disableMeetingsFeatureChanged(bool value); + void checkForUpdateEnabledChanged(); + void versionCheckUrlChanged(); + // Messages. -------------------------------------------------------------------- void autoDownloadReceivedFilesChanged(bool enabled); diff --git a/Linphone/tool/Constants.hpp b/Linphone/tool/Constants.hpp index 527f6b45d..dccbd0f5f 100644 --- a/Linphone/tool/Constants.hpp +++ b/Linphone/tool/Constants.hpp @@ -66,8 +66,8 @@ public: static constexpr int DefaultExpires = 600; static constexpr int DefaultPublishExpires = 120; static constexpr char DownloadUrl[] = "https://www.linphone.org/technical-corner/linphone"; - static constexpr char VersionCheckReleaseUrl[] = "https://linphone.org/releases"; - static constexpr char VersionCheckNightlyUrl[] = "https://linphone.org/snapshots"; + static constexpr char VersionCheckReleaseUrl[] = "https://download.linphone.org/releases"; + static constexpr char VersionCheckNightlyUrl[] = "https://download.linphone.org/snapshots"; static constexpr char PasswordRecoveryUrl[] = "https://subscribe.linphone.org/recovery/email"; static constexpr char CguUrl[] = "https://www.linphone.org/en/terms-of-use/"; static constexpr char PrivatePolicyUrl[] = "https://www.linphone.org/en/privacy-policy/"; diff --git a/Linphone/tool/LinphoneEnums.hpp b/Linphone/tool/LinphoneEnums.hpp index d13deccca..849b870f4 100644 --- a/Linphone/tool/LinphoneEnums.hpp +++ b/Linphone/tool/LinphoneEnums.hpp @@ -399,6 +399,9 @@ LinphoneEnums::VideoSourceScreenSharingType fromLinphone(const linphone::VideoSo enum class PlaybackState { PlayingState = 0, PausedState = 1, StoppedState = 2, ErrorState = 3 }; Q_ENUM_NS(PlaybackState); +enum class VersionCheckType { Release = 0, Nightly = 1, Custom = 2 }; +Q_ENUM_NS(VersionCheckType) + } // namespace LinphoneEnums /* Q_DECLARE_METATYPE(LinphoneEnums::CallState) diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index 0d15acdd0..6552f67bc 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -139,6 +139,12 @@ Control.Button { underline: mainItem.underline bold: (mainItem.style === ButtonStyle.noBackground || mainItem.style === ButtonStyle.noBackgroundRed) && (mainItem.hovered || mainItem.pressed) } + ToolTip { + parent: mainItem + text: mainItem.text + visible: mainItem.hovered && (buttonText.implicitWidth > buttonText.width) + delay: 500 + } TextMetrics { id: textMetrics text: mainItem.text diff --git a/Linphone/view/Control/Button/HelpIconLabelButton.qml b/Linphone/view/Control/Button/HelpIconLabelButton.qml index a7802f7a3..801dc77d7 100644 --- a/Linphone/view/Control/Button/HelpIconLabelButton.qml +++ b/Linphone/view/Control/Button/HelpIconLabelButton.qml @@ -36,10 +36,12 @@ MouseArea { } ColumnLayout { width: implicitWidth + Layout.preferredWidth: width height: implicitHeight Layout.leftMargin: Utils.getSizeWithScreenRatio(16) Text { Layout.fillWidth: true + maximumLineCount: 1 text: mainItem.title color: DefaultStyle.main2_600 font: Typography.p2 @@ -49,6 +51,7 @@ MouseArea { Text { Layout.alignment: Qt.AlignTop verticalAlignment: Text.AlignTop + maximumLineCount: 2 Layout.fillWidth: true text: mainItem.subTitle color: DefaultStyle.main2_500_main diff --git a/Linphone/view/Control/Popup/InformationPopup.qml b/Linphone/view/Control/Popup/InformationPopup.qml index 84f6d2c03..e9e5d89b2 100644 --- a/Linphone/view/Control/Popup/InformationPopup.qml +++ b/Linphone/view/Control/Popup/InformationPopup.qml @@ -86,6 +86,7 @@ Popup { text: mainItem.description wrapMode: Text.WordWrap color: DefaultStyle.main2_500_main + onLinkActivated: Qt.openUrlExternally(link) font { pixelSize: Utils.getSizeWithScreenRatio(12) weight: Utils.getSizeWithScreenRatio(300) diff --git a/Linphone/view/Page/Main/Help/HelpPage.qml b/Linphone/view/Page/Main/Help/HelpPage.qml index a9defedc0..736df377e 100644 --- a/Linphone/view/Page/Main/Help/HelpPage.qml +++ b/Linphone/view/Page/Main/Help/HelpPage.qml @@ -21,14 +21,15 @@ AbstractMainPage { id: leftPanel Layout.fillWidth: true Layout.fillHeight: true - property real sideMargin: Utils.getSizeWithScreenRatio(45) + property real leftMargin: Utils.getSizeWithScreenRatio(45) + property real rightMargin: Utils.getSizeWithScreenRatio(29) spacing: Utils.getSizeWithScreenRatio(5) RowLayout { Layout.fillWidth: true - Layout.leftMargin: leftPanel.sideMargin - Layout.rightMargin: leftPanel.sideMargin - spacing: Utils.getSizeWithScreenRatio(5) - Button { + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin + spacing: Utils.getSizeWithScreenRatio(8) + RoundButton { icon.source: AppIcons.leftArrow style: ButtonStyle.noBackground icon.width: Utils.getSizeWithScreenRatio(24) @@ -51,8 +52,8 @@ AbstractMainPage { id: aboutImage Layout.fillWidth: true Layout.preferredHeight: Utils.getSizeWithScreenRatio(100) - Layout.leftMargin: leftPanel.sideMargin - Layout.rightMargin: leftPanel.sideMargin + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin Layout.topMargin: Utils.getSizeWithScreenRatio(41) fillMode: Image.PreserveAspectFit source: SettingsCpp.themeAboutPictureUrl @@ -64,8 +65,8 @@ AbstractMainPage { } } Text { - Layout.leftMargin: leftPanel.sideMargin - Layout.rightMargin: leftPanel.sideMargin + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin Layout.topMargin: Utils.getSizeWithScreenRatio(aboutImage.visible ? 41 : 24) Layout.fillWidth: true //: "À propos de %1" @@ -75,8 +76,8 @@ AbstractMainPage { } ColumnLayout { Layout.fillWidth: true - Layout.leftMargin: leftPanel.sideMargin - Layout.rightMargin: leftPanel.sideMargin + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin Layout.topMargin: Utils.getSizeWithScreenRatio(24) spacing: Utils.getSizeWithScreenRatio(32) HelpIconLabelButton { @@ -91,13 +92,24 @@ AbstractMainPage { Qt.openUrlExternally(ConstantsCpp.PrivatePolicyUrl) } } - HelpIconLabelButton { - Layout.fillWidth: true - iconSource: AppIcons.info - //: "Version" - title: qsTr("help_about_version_title") - subTitle: AppCpp.shortApplicationVersion - onClicked: {} + RowLayout { + HelpIconLabelButton { + Layout.preferredWidth: width + Layout.minimumWidth: width + iconSource: AppIcons.info + //: "Version" + title: qsTr("help_about_version_title") + subTitle: AppCpp.shortApplicationVersion + onClicked: {} + } + Item{Layout.fillWidth: true} + MediumButton { + style: ButtonStyle.tertiary + Layout.fillWidth: true + //: Check update + text: qsTr("help_check_for_update_button_label") + onClicked: AppCpp.checkForUpdate(true) + } } HelpIconLabelButton { Layout.fillWidth: true @@ -122,8 +134,8 @@ AbstractMainPage { } } Text { - Layout.leftMargin: leftPanel.sideMargin - Layout.rightMargin: leftPanel.sideMargin + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin Layout.topMargin: Utils.getSizeWithScreenRatio(32) Layout.fillWidth: true //: "À propos de %1" @@ -134,8 +146,8 @@ AbstractMainPage { HelpIconLabelButton { id: troubleShooting Layout.fillWidth: true - Layout.leftMargin: leftPanel.sideMargin - Layout.rightMargin: leftPanel.sideMargin + Layout.leftMargin: leftPanel.leftMargin + Layout.rightMargin: leftPanel.rightMargin Layout.topMargin: Utils.getSizeWithScreenRatio(24) iconSource: AppIcons.debug //: "Dépannage" diff --git a/Linphone/view/Style/DefaultStyle.qml b/Linphone/view/Style/DefaultStyle.qml index 3e8ee06d9..229b07f49 100644 --- a/Linphone/view/Style/DefaultStyle.qml +++ b/Linphone/view/Style/DefaultStyle.qml @@ -51,8 +51,8 @@ QtObject { property color vue_meter_light_green: "#6FF88D" property color vue_meter_dark_green: "#00D916" - property real defaultHeight: 1080.0 - property real defaultWidth: 1920.0 + property real defaultHeight: 1007.0 + property real defaultWidth: 1512.0 property real maxDp: 0.98 property real dp: Math.min((Screen.width/Screen.height)/(defaultWidth/defaultHeight), maxDp)