check for update

This commit is contained in:
Gaelle Braud 2025-10-31 18:00:15 +01:00
parent db1f04350a
commit 80bf126b23
18 changed files with 413 additions and 109 deletions

View file

@ -430,6 +430,43 @@ void App::setSelf(QSharedPointer<App>(me)) {
});
});
// Check update
mCoreModelConnection->makeConnectToModel(
&CoreModel::versionUpdateCheckResultReceived,
[this](const std::shared_ptr<linphone::Core> &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("<a href='%1'><font color='DefaultStyle.main2_600'>%2</a>")
.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<App, CliModel>::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;
}

View file

@ -165,6 +165,7 @@ public:
QString getGitBranchName();
QString getSdkVersion();
Q_INVOKABLE void checkForUpdate(bool requestedByUser = false);
ChatGui *getCurrentChat() const;
void setCurrentChat(ChatGui *chat);

View file

@ -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<SettingsModel> &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<SettingsModel> &model) {
mDownloadFolder = model->getDownloadFolder();
}
bool SettingsCore::isCheckForUpdateAvailable() const {
return mIsCheckForUpdateAvailable;
}
void SettingsCore::save() {
mustBeInMainThread(getClassName() + Q_FUNC_INFO);
SettingsCore *thisCopy = new SettingsCore(*this);

View file

@ -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

View file

@ -641,93 +641,134 @@
</message>
<message>
<location filename="../../core/App.cpp" line="393"/>
<location filename="../../core/App.cpp" line="658"/>
<location filename="../../core/App.cpp" line="443"/>
<location filename="../../core/App.cpp" line="695"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Fehler</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="394"/>
<location filename="../../core/App.cpp" line="660"/>
<location filename="../../core/App.cpp" line="697"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="654"/>
<location filename="../../core/App.cpp" line="446"/>
<source>info_popup_error_checking_update</source>
<extracomment>An error occured while trying to check update. Please try again later or contact support team.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="452"/>
<source>info_popup_new_version_download_label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="455"/>
<source>info_popup_new_version_available_title</source>
<extracomment>New version available !</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="457"/>
<source>info_popup_new_version_available_message</source>
<extracomment>A new version of Linphone (%1) is available. %2</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="463"/>
<source>info_popup_version_up_to_date_title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="465"/>
<source>info_popup_version_up_to_date_message</source>
<extracomment>Your version is up to date</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="691"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="926"/>
<location filename="../../core/App.cpp" line="964"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>Ein kostenloses Open-Source SIP Video-Telefon.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="928"/>
<location filename="../../core/App.cpp" line="966"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Kommandozeilen-Befehl an die Anwendung schicken</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="932"/>
<location filename="../../core/App.cpp" line="970"/>
<source>command_line_option_show_help</source>
<translation>Zeige Hilfe</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="937"/>
<location filename="../../core/App.cpp" line="975"/>
<source>command_line_option_show_app_version</source>
<translation>App-Version anzeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="945"/>
<location filename="../../core/App.cpp" line="983"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="947"/>
<location filename="../../core/App.cpp" line="985"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, Pfad oder Datei</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="952"/>
<location filename="../../core/App.cpp" line="990"/>
<source>command_line_option_minimized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="955"/>
<location filename="../../core/App.cpp" line="993"/>
<source>command_line_option_log_to_stdout</source>
<translation>Debug-Informationen auf der Standardausgabe ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="958"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Nur Anwendungs-Logs ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1329"/>
<location filename="../../core/App.cpp" line="1367"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Ausblenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1329"/>
<location filename="../../core/App.cpp" line="1367"/>
<source>show_action</source>
<translation>Zeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1344"/>
<location filename="../../core/App.cpp" line="1382"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1459"/>
<location filename="../../core/App.cpp" line="1400"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1514"/>
<source>mark_all_read_action</source>
<translation type="unfinished"></translation>
</message>
@ -2021,13 +2062,13 @@
<context>
<name>ChatCore</name>
<message>
<location filename="../../core/chat/ChatCore.cpp" line="144"/>
<location filename="../../core/chat/ChatCore.cpp" line="145"/>
<source>info_toast_deleted_title</source>
<extracomment>Deleted</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/chat/ChatCore.cpp" line="146"/>
<location filename="../../core/chat/ChatCore.cpp" line="147"/>
<source>info_toast_deleted_message_history</source>
<extracomment>Message history has been deleted</extracomment>
<translation type="unfinished"></translation>
@ -3879,50 +3920,56 @@ Error</extracomment>
<context>
<name>HelpPage</name>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="42"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="43"/>
<source>help_title</source>
<extracomment>&quot;Aide&quot;</extracomment>
<translation>Hilfe</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="72"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="130"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="73"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="142"/>
<source>help_about_title</source>
<extracomment>&quot;À propos de %1&quot;</extracomment>
<translation>Über %1</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="86"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="87"/>
<source>help_about_privacy_policy_title</source>
<extracomment>&quot;Règles de confidentialité&quot;</extracomment>
<translation>Datenschutzrichtlinie</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="88"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="89"/>
<source>help_about_privacy_policy_subtitle</source>
<extracomment>Quelles informations %1 collecte et utilise</extracomment>
<translation>Welche Informationen sammelt und verwendet %1</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="98"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="101"/>
<source>help_about_version_title</source>
<extracomment>&quot;Version&quot;</extracomment>
<translation>Version</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="106"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="110"/>
<source>help_check_for_update_button_label</source>
<extracomment>Check update</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="118"/>
<source>help_about_gpl_licence_title</source>
<extracomment>&quot;Licences GPLv3&quot;</extracomment>
<translation>GPLv3-Lizenzen</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="117"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="129"/>
<source>help_about_contribute_translations_title</source>
<extracomment>&quot;Contribuer à la traduction de %1&quot;</extracomment>
<translation>Zur Übersetzung von %1 beitragen</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="142"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="154"/>
<source>help_troubleshooting_title</source>
<extracomment>&quot;Dépannage&quot;</extracomment>
<translation>Fehlerbehebung</translation>
@ -5784,6 +5831,13 @@ Pour les activer dans un projet commercial, merci de nous contacter.</source>
<translation>Konversationen</translation>
</message>
</context>
<context>
<name>SettingsCore</name>
<message>
<source>info_popup_error_title</source>
<translation type="obsolete">Fehler</translation>
</message>
</context>
<context>
<name>SettingsMenuItem</name>
<message>

View file

@ -636,93 +636,134 @@
</message>
<message>
<location filename="../../core/App.cpp" line="393"/>
<location filename="../../core/App.cpp" line="658"/>
<location filename="../../core/App.cpp" line="443"/>
<location filename="../../core/App.cpp" line="695"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Error</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="394"/>
<location filename="../../core/App.cpp" line="660"/>
<location filename="../../core/App.cpp" line="697"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>Remote provisioning failed : %1</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="654"/>
<location filename="../../core/App.cpp" line="446"/>
<source>info_popup_error_checking_update</source>
<extracomment>An error occured while trying to check update. Please try again later or contact support team.</extracomment>
<translation>An error occured while trying to check update. Please try again later or contact support team.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="452"/>
<source>info_popup_new_version_download_label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="455"/>
<source>info_popup_new_version_available_title</source>
<extracomment>New version available !</extracomment>
<translation>New version available !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="457"/>
<source>info_popup_new_version_available_message</source>
<extracomment>A new version of Linphone (%1) is available. %2</extracomment>
<translation>A new version of Linphone (%1) is available at %1</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="463"/>
<source>info_popup_version_up_to_date_title</source>
<translation>Up to date</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="465"/>
<source>info_popup_version_up_to_date_message</source>
<extracomment>Your version is up to date</extracomment>
<translation>Up to date Your version is up to date</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="691"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>not reachable</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="926"/>
<location filename="../../core/App.cpp" line="964"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="928"/>
<location filename="../../core/App.cpp" line="966"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="932"/>
<location filename="../../core/App.cpp" line="970"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="937"/>
<location filename="../../core/App.cpp" line="975"/>
<source>command_line_option_show_app_version</source>
<translation>Show app version</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="945"/>
<location filename="../../core/App.cpp" line="983"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="947"/>
<location filename="../../core/App.cpp" line="985"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="952"/>
<location filename="../../core/App.cpp" line="990"/>
<source>command_line_option_minimized</source>
<translation>Minimize</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="955"/>
<location filename="../../core/App.cpp" line="993"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="958"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1329"/>
<location filename="../../core/App.cpp" line="1367"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Hide</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1329"/>
<location filename="../../core/App.cpp" line="1367"/>
<source>show_action</source>
<translation>Show</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1344"/>
<location filename="../../core/App.cpp" line="1382"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quit</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1459"/>
<location filename="../../core/App.cpp" line="1400"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Check for update</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1514"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>
@ -1998,13 +2039,13 @@
<context>
<name>ChatCore</name>
<message>
<location filename="../../core/chat/ChatCore.cpp" line="144"/>
<location filename="../../core/chat/ChatCore.cpp" line="145"/>
<source>info_toast_deleted_title</source>
<extracomment>Deleted</extracomment>
<translation>Deleted</translation>
</message>
<message>
<location filename="../../core/chat/ChatCore.cpp" line="146"/>
<location filename="../../core/chat/ChatCore.cpp" line="147"/>
<source>info_toast_deleted_message_history</source>
<extracomment>Message history has been deleted</extracomment>
<translation>Message history has been deleted</translation>
@ -3795,50 +3836,56 @@ Expiration : %1</translation>
<context>
<name>HelpPage</name>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="42"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="43"/>
<source>help_title</source>
<extracomment>&quot;Aide&quot;</extracomment>
<translation>Help</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="72"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="130"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="73"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="142"/>
<source>help_about_title</source>
<extracomment>&quot;À propos de %1&quot;</extracomment>
<translation>About %1</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="86"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="87"/>
<source>help_about_privacy_policy_title</source>
<extracomment>&quot;Règles de confidentialité&quot;</extracomment>
<translation>Privacy Policy</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="88"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="89"/>
<source>help_about_privacy_policy_subtitle</source>
<extracomment>Quelles informations %1 collecte et utilise</extracomment>
<translation>What information does %1 collect and use</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="98"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="101"/>
<source>help_about_version_title</source>
<extracomment>&quot;Version&quot;</extracomment>
<translation>Version</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="106"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="110"/>
<source>help_check_for_update_button_label</source>
<extracomment>Check update</extracomment>
<translation>Check for update</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="118"/>
<source>help_about_gpl_licence_title</source>
<extracomment>&quot;Licences GPLv3&quot;</extracomment>
<translation>GPLv3 licences</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="117"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="129"/>
<source>help_about_contribute_translations_title</source>
<extracomment>&quot;Contribuer à la traduction de %1&quot;</extracomment>
<translation>Contribute to the translation of %1</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="142"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="154"/>
<source>help_troubleshooting_title</source>
<extracomment>&quot;Dépannage&quot;</extracomment>
<translation>Troubleshooting</translation>

View file

@ -636,93 +636,134 @@
</message>
<message>
<location filename="../../core/App.cpp" line="393"/>
<location filename="../../core/App.cpp" line="658"/>
<location filename="../../core/App.cpp" line="443"/>
<location filename="../../core/App.cpp" line="695"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Erreur</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="394"/>
<location filename="../../core/App.cpp" line="660"/>
<location filename="../../core/App.cpp" line="697"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>La configuration distante a échoué : %1</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="654"/>
<location filename="../../core/App.cpp" line="446"/>
<source>info_popup_error_checking_update</source>
<extracomment>An error occured while trying to check update. Please try again later or contact support team.</extracomment>
<translation>Une erreur est survenue lors de la recherche de mise à jour. Merci de réessayer plus tard ou de contacter l&apos;équipe de support.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="452"/>
<source>info_popup_new_version_download_label</source>
<translation>Téléchargez- !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="455"/>
<source>info_popup_new_version_available_title</source>
<extracomment>New version available !</extracomment>
<translation>Nouvelle version disponible !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="457"/>
<source>info_popup_new_version_available_message</source>
<extracomment>A new version of Linphone (%1) is available. %2</extracomment>
<translation>Une nouvelle version de Linphone (%1) est disponible. %2</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="463"/>
<source>info_popup_version_up_to_date_title</source>
<translation>À jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="465"/>
<source>info_popup_version_up_to_date_message</source>
<extracomment>Your version is up to date</extracomment>
<translation>Votre version est à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="691"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>indisponible</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="926"/>
<location filename="../../core/App.cpp" line="964"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="928"/>
<location filename="../../core/App.cpp" line="966"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="932"/>
<location filename="../../core/App.cpp" line="970"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="937"/>
<location filename="../../core/App.cpp" line="975"/>
<source>command_line_option_show_app_version</source>
<translation>Afficher la version de l&apos;application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="945"/>
<location filename="../../core/App.cpp" line="983"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="947"/>
<location filename="../../core/App.cpp" line="985"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="952"/>
<location filename="../../core/App.cpp" line="990"/>
<source>command_line_option_minimized</source>
<translation>Minimiser</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="955"/>
<location filename="../../core/App.cpp" line="993"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="958"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1329"/>
<location filename="../../core/App.cpp" line="1367"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Cacher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1329"/>
<location filename="../../core/App.cpp" line="1367"/>
<source>show_action</source>
<translation>Afficher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1344"/>
<location filename="../../core/App.cpp" line="1382"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quitter</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1459"/>
<location filename="../../core/App.cpp" line="1400"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Rechercher une mise à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1514"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>
@ -1998,13 +2039,13 @@
<context>
<name>ChatCore</name>
<message>
<location filename="../../core/chat/ChatCore.cpp" line="144"/>
<location filename="../../core/chat/ChatCore.cpp" line="145"/>
<source>info_toast_deleted_title</source>
<extracomment>Deleted</extracomment>
<translation>Supprimé</translation>
</message>
<message>
<location filename="../../core/chat/ChatCore.cpp" line="146"/>
<location filename="../../core/chat/ChatCore.cpp" line="147"/>
<source>info_toast_deleted_message_history</source>
<extracomment>Message history has been deleted</extracomment>
<translation>L&apos;historique des messages a é supprimé</translation>
@ -3795,50 +3836,56 @@ Expiration : %1</translation>
<context>
<name>HelpPage</name>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="42"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="43"/>
<source>help_title</source>
<extracomment>&quot;Aide&quot;</extracomment>
<translation>Aide</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="72"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="130"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="73"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="142"/>
<source>help_about_title</source>
<extracomment>&quot;À propos de %1&quot;</extracomment>
<translation>À propos de %1</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="86"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="87"/>
<source>help_about_privacy_policy_title</source>
<extracomment>&quot;Règles de confidentialité&quot;</extracomment>
<translation>Règles de confidentialité</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="88"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="89"/>
<source>help_about_privacy_policy_subtitle</source>
<extracomment>Quelles informations %1 collecte et utilise</extracomment>
<translation>Quelles informations %1 collecte et utilise</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="98"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="101"/>
<source>help_about_version_title</source>
<extracomment>&quot;Version&quot;</extracomment>
<translation>Version</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="106"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="110"/>
<source>help_check_for_update_button_label</source>
<extracomment>Check update</extracomment>
<translation>Rechercher une mise à jour</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="118"/>
<source>help_about_gpl_licence_title</source>
<extracomment>&quot;Licences GPLv3&quot;</extracomment>
<translation>Licences GPLv3</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="117"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="129"/>
<source>help_about_contribute_translations_title</source>
<extracomment>&quot;Contribuer à la traduction de %1&quot;</extracomment>
<translation>Contribuer à la traduction de %1</translation>
</message>
<message>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="142"/>
<location filename="../../view/Page/Main/Help/HelpPage.qml" line="154"/>
<source>help_troubleshooting_title</source>
<extracomment>&quot;Dépannage&quot;</extracomment>
<translation>Dépannage</translation>

View file

@ -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<linphone::Core> &core,
@ -585,7 +596,7 @@ void CoreModel::onVersionUpdateCheckResultReceived(const std::shared_ptr<linphon
linphone::VersionUpdateCheckResult result,
const std::string &version,
const std::string &url) {
emit versionUpdateCheckResultReceived(core, result, version, url);
emit versionUpdateCheckResultReceived(core, result, version, url, mCheckVersionRequestedByUser);
}
void CoreModel::onFriendListRemoved(const std::shared_ptr<linphone::Core> &core,

View file

@ -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<QString, OIDCModel *> mOpenIdConnections;
std::shared_ptr<MagicSearchModel> mMagicSearch;
bool mStarted = false;
bool mCheckVersionRequestedByUser = false;
void setPathBeforeCreation();
void setPathsAfterCreation();
@ -281,7 +285,8 @@ signals:
void versionUpdateCheckResultReceived(const std::shared_ptr<linphone::Core> &core,
linphone::VersionUpdateCheckResult result,
const std::string &version,
const std::string &url);
const std::string &url,
bool checkRequestedByUser);
void friendListRemoved(const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::FriendList> &friendList);
};

View file

@ -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));

View file

@ -22,6 +22,7 @@
#define SETTINGS_MODEL_H_
#include "MediastreamerUtils.hpp"
#include "tool/LinphoneEnums.hpp"
#include <QFont>
#include <QObject>
#include <QVariantMap>
@ -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);

View file

@ -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/";

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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"

View file

@ -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)