mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-17 11:58:27 +00:00
add auto check for update on start config setting
This commit is contained in:
parent
4221518dc1
commit
4e27f3528a
5 changed files with 22 additions and 1 deletions
|
|
@ -860,7 +860,7 @@ void App::initCore() {
|
|||
Qt::SingleShotConnection);
|
||||
}
|
||||
}
|
||||
checkForUpdate();
|
||||
if (mSettings->autoCheckForUpdateOnStart()) checkForUpdate();
|
||||
setIsRestarting(false);
|
||||
window->show();
|
||||
window->requestActivate();
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) {
|
|||
|
||||
// Check for update
|
||||
mIsCheckForUpdateAvailable = settingsModel->isCheckForUpdateAvailable();
|
||||
mAutoCheckForUpdateOnStart = settingsModel->autoCheckForUpdateOnStart();
|
||||
|
||||
// Ui
|
||||
INIT_CORE_MEMBER(DisableChatFeature, settingsModel)
|
||||
|
|
@ -314,6 +315,7 @@ void SettingsCore::reloadSettings() {
|
|||
|
||||
// Check for update
|
||||
mIsCheckForUpdateAvailable = settingsModel->isCheckForUpdateAvailable();
|
||||
mAutoCheckForUpdateOnStart = settingsModel->autoCheckForUpdateOnStart();
|
||||
|
||||
setDisableChatFeature(settingsModel->getDisableChatFeature());
|
||||
setDisableMeetingsFeature(settingsModel->getDisableMeetingsFeature());
|
||||
|
|
@ -1408,6 +1410,7 @@ void SettingsCore::writeFromModel(const std::shared_ptr<SettingsModel> &model) {
|
|||
|
||||
// Check update
|
||||
mIsCheckForUpdateAvailable = model->isCheckForUpdateAvailable();
|
||||
mAutoCheckForUpdateOnStart = model->autoCheckForUpdateOnStart();
|
||||
|
||||
// UI
|
||||
mDisableChatFeature = model->getDisableChatFeature();
|
||||
|
|
@ -1445,6 +1448,10 @@ bool SettingsCore::isCheckForUpdateAvailable() const {
|
|||
return mIsCheckForUpdateAvailable;
|
||||
}
|
||||
|
||||
bool SettingsCore::autoCheckForUpdateOnStart() const {
|
||||
return mAutoCheckForUpdateOnStart;
|
||||
}
|
||||
|
||||
void SettingsCore::save() {
|
||||
mustBeInMainThread(getClassName() + Q_FUNC_INFO);
|
||||
SettingsCore *thisCopy = new SettingsCore(*this);
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@ public:
|
|||
void setCardDAVMinCharForResearch(int min);
|
||||
|
||||
bool isCheckForUpdateAvailable() const;
|
||||
bool autoCheckForUpdateOnStart() const;
|
||||
Q_INVOKABLE void save();
|
||||
Q_INVOKABLE void undo();
|
||||
|
||||
|
|
@ -489,6 +490,7 @@ private:
|
|||
|
||||
// Check update
|
||||
bool mIsCheckForUpdateAvailable = false;
|
||||
bool mAutoCheckForUpdateOnStart = false;
|
||||
|
||||
DECLARE_ABSTRACT_OBJECT
|
||||
};
|
||||
|
|
|
|||
|
|
@ -940,6 +940,15 @@ void SettingsModel::setShowPastMeetings(bool show) {
|
|||
emit showPastMeetingsChanged(show);
|
||||
}
|
||||
|
||||
bool SettingsModel::autoCheckForUpdateOnStart() const {
|
||||
return !!mConfig->getInt(UiSection, "auto_check_for_update_on_start", isCheckForUpdateAvailable());
|
||||
}
|
||||
|
||||
void SettingsModel::setAutoCheckForUpdateOnStart(bool check) {
|
||||
mConfig->setInt(UiSection, "auto_check_for_update_on_start", check);
|
||||
emit autoCheckForUpdateOnStartChanged();
|
||||
}
|
||||
|
||||
bool SettingsModel::isCheckForUpdateAvailable() const {
|
||||
#ifdef ENABLE_UPDATE_CHECK
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -198,6 +198,8 @@ public:
|
|||
bool getShowPastMeetings() const;
|
||||
void setShowPastMeetings(bool show);
|
||||
|
||||
bool autoCheckForUpdateOnStart() const;
|
||||
void setAutoCheckForUpdateOnStart(bool check);
|
||||
bool isCheckForUpdateAvailable() const;
|
||||
bool isCheckForUpdateEnabled() const;
|
||||
void setCheckForUpdateEnabled(bool enable);
|
||||
|
|
@ -291,6 +293,7 @@ signals:
|
|||
|
||||
void showPastMeetingsChanged(bool value);
|
||||
|
||||
void autoCheckForUpdateOnStartChanged();
|
||||
void checkForUpdateEnabledChanged();
|
||||
void versionCheckUrlChanged();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue