mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
- Add a manual update check
- Add option to enable check updates - Fix crash on quit
This commit is contained in:
parent
765f68d18b
commit
e404cafc2b
22 changed files with 198 additions and 6 deletions
|
|
@ -1348,6 +1348,11 @@ Klik her: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Luk</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Klik her: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Klicken Sie hier: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Schließen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Klicken Sie hier: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Click here: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Quit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation>Check for updates</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2539,6 +2544,11 @@ Click here: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation>Select a new font</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation>Check for updates</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Haga clic aquí: <a href="%1">%1 </a>
|
|||
<source>quit</source>
|
||||
<translation>Cerrar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Haga clic aquí: <a href="%1">%1 </a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Cliquez ici : <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Quitter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Cliquez ici : <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation>Sélectionnez une nouvelle police</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1339,6 +1339,11 @@ Kattintson ide: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Kilépés</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2506,6 +2511,11 @@ Kattintson ide: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation>Új betűkészlet kijelölése</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Clicca: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Esci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Clicca: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1339,6 +1339,11 @@
|
|||
<source>quit</source>
|
||||
<translation>終了</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2506,6 +2511,11 @@
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1357,6 +1357,11 @@ Spustelėkite čia: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Išeiti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2526,6 +2531,11 @@ Spustelėkite čia: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Clique aqui: <a href="%1">%1 </a>
|
|||
<source>quit</source>
|
||||
<translation>Desistir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Clique aqui: <a href="%1">%1 </a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1357,6 +1357,11 @@
|
|||
<source>quit</source>
|
||||
<translation>Выйти</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2526,6 +2531,11 @@
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1348,6 +1348,11 @@ Klicka här: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Avsluta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2516,6 +2521,11 @@ Klicka här: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1339,6 +1339,11 @@ Buraya tıklayın: <a href="%1">%1</a>
|
|||
<source>quit</source>
|
||||
<translation>Çıkış</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2506,6 +2511,11 @@ Buraya tıklayın: <a href="%1">%1</a>
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1357,6 +1357,11 @@
|
|||
<source>quit</source>
|
||||
<translation>Вийти</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2526,6 +2531,11 @@
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -1339,6 +1339,11 @@
|
|||
<source>quit</source>
|
||||
<translation>退出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdates</source>
|
||||
<extracomment>'Check for updates' : Item menu for checking updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindowTopMenuBar</name>
|
||||
|
|
@ -2506,6 +2511,11 @@
|
|||
<extracomment>'Select a new font' : Popup title for choosing new fonts</extracomment>
|
||||
<translation>选择新字体</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>checkForUpdateLabel</source>
|
||||
<extracomment>'Check for updates' : Label switch for enabling check for updates</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsVideo</name>
|
||||
|
|
|
|||
|
|
@ -950,7 +950,7 @@ void App::openAppAfterInit (bool mustBeIconified) {
|
|||
QObject::connect(timer, &QTimer::timeout, this, &App::checkForUpdate);
|
||||
timer->start();
|
||||
|
||||
checkForUpdate();
|
||||
checkForUpdates();
|
||||
#endif // ifdef ENABLE_UPDATE_CHECK
|
||||
|
||||
if(setFetchConfig(mParser))
|
||||
|
|
@ -999,8 +999,12 @@ QString App::getStrippedApplicationVersion(){// x.y.z but if 'z-*' then x.y.z-1
|
|||
}
|
||||
return currentVersion;
|
||||
}
|
||||
void App::checkForUpdate () {
|
||||
CoreManager::getInstance()->getCore()->checkForUpdate(
|
||||
Utils::appStringToCoreString(getStrippedApplicationVersion())
|
||||
);
|
||||
void App::checkForUpdate() {
|
||||
checkForUpdates(false);
|
||||
}
|
||||
void App::checkForUpdates(bool force) {
|
||||
if(force || CoreManager::getInstance()->getSettingsModel()->isCheckForUpdateEnabled())
|
||||
CoreManager::getInstance()->getCore()->checkForUpdate(
|
||||
Utils::appStringToCoreString(getStrippedApplicationVersion())
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ public:
|
|||
Q_INVOKABLE QQuickWindow *getSettingsWindow () const;
|
||||
|
||||
Q_INVOKABLE static void smartShowWindow (QQuickWindow *window);
|
||||
Q_INVOKABLE static void checkForUpdates(bool force = false);
|
||||
|
||||
public slots:
|
||||
void stateChanged(Qt::ApplicationState);
|
||||
|
|
|
|||
|
|
@ -99,5 +99,9 @@ AppController::AppController (int &argc, char *argv[]) {
|
|||
}
|
||||
|
||||
AppController::~AppController () {
|
||||
delete mApp;
|
||||
try{
|
||||
delete mApp;
|
||||
}
|
||||
catch(...){
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1255,6 +1255,15 @@ void SettingsModel::setExitOnClose (bool value) {
|
|||
emit exitOnCloseChanged(value);
|
||||
}
|
||||
|
||||
bool SettingsModel::isCheckForUpdateEnabled() const{
|
||||
return !!mConfig->getInt(UiSection, "check_for_update_enabled", 1);
|
||||
}
|
||||
|
||||
void SettingsModel::setCheckForUpdateEnabled(bool enable){
|
||||
mConfig->setInt(UiSection, "check_for_update_enabled", enable);
|
||||
emit checkForUpdateEnabledChanged();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool SettingsModel::getShowLocalSipAccount()const{
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ class SettingsModel : public QObject {
|
|||
Q_PROPERTY(QString downloadFolder READ getDownloadFolder WRITE setDownloadFolder NOTIFY downloadFolderChanged)
|
||||
|
||||
Q_PROPERTY(bool exitOnClose READ getExitOnClose WRITE setExitOnClose NOTIFY exitOnCloseChanged)
|
||||
Q_PROPERTY(bool checkForUpdateEnabled READ isCheckForUpdateEnabled WRITE setCheckForUpdateEnabled NOTIFY checkForUpdateEnabledChanged)
|
||||
|
||||
Q_PROPERTY(bool showLocalSipAccount READ getShowLocalSipAccount CONSTANT)
|
||||
Q_PROPERTY(bool showStartChatButton READ getShowStartChatButton CONSTANT)
|
||||
|
|
@ -457,6 +458,9 @@ public:
|
|||
bool getExitOnClose () const;
|
||||
void setExitOnClose (bool value);
|
||||
|
||||
bool isCheckForUpdateEnabled() const;
|
||||
void setCheckForUpdateEnabled(bool enable);
|
||||
|
||||
Q_INVOKABLE bool getShowLocalSipAccount () const;
|
||||
Q_INVOKABLE bool getShowStartChatButton () const;
|
||||
Q_INVOKABLE bool getShowStartVideoCallButton () const;
|
||||
|
|
@ -629,6 +633,8 @@ signals:
|
|||
|
||||
void exitOnCloseChanged (bool value);
|
||||
|
||||
void checkForUpdateEnabledChanged();
|
||||
|
||||
// Advanced. -----------------------------------------------------------------
|
||||
|
||||
void logsFolderChanged (const QString &folder);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import QtQuick 2.7
|
|||
import Linphone 1.0
|
||||
import Common 1.0
|
||||
import Utils 1.0
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Item {
|
||||
|
|
@ -58,6 +59,13 @@ Item {
|
|||
|
||||
onTriggered: settingsShortcut.onActivated()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
//: 'Check for updates' : Item menu for checking updates
|
||||
text: qsTr('checkForUpdates')
|
||||
|
||||
onTriggered: App.checkForUpdates(true)
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: qsTr('about')
|
||||
|
|
|
|||
|
|
@ -203,6 +203,16 @@ TabContainer {
|
|||
onClicked: App.autoStart = !checked
|
||||
}
|
||||
}
|
||||
FormGroup {
|
||||
//: 'Check for updates' : Label switch for enabling check for updates
|
||||
label: qsTr('checkForUpdateLabel')
|
||||
|
||||
Switch {
|
||||
checked: SettingsModel.checkForUpdateEnabled
|
||||
|
||||
onClicked: SettingsModel.checkForUpdateEnabled = !checked
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue