mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T41, prg version can be checked when it is not new
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ee75d5f900
commit
420e80a437
@@ -389,7 +389,7 @@ namespace BlackGui
|
||||
});
|
||||
|
||||
a = menu.addAction(CIcons::swift24(), "Check for updates");
|
||||
c = connect(a, &QAction::triggered, this, &CGuiApplication::checkNewVersion);
|
||||
c = connect(a, &QAction::triggered, this, &CGuiApplication::checkNewVersionMenu);
|
||||
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
|
||||
Q_UNUSED(c);
|
||||
@@ -627,7 +627,7 @@ namespace BlackGui
|
||||
return true;
|
||||
}
|
||||
|
||||
void CGuiApplication::checkNewVersion()
|
||||
void CGuiApplication::checkNewVersion(bool onlyIfNew)
|
||||
{
|
||||
if (!m_installDialog)
|
||||
{
|
||||
@@ -635,7 +635,7 @@ namespace BlackGui
|
||||
m_installDialog = new CDownloadAndInstallDialog(this->mainApplicationWindow());
|
||||
}
|
||||
|
||||
if (!m_installDialog->isNewVersionAvailable()) return;
|
||||
if (onlyIfNew && !m_installDialog->isNewVersionAvailable()) return;
|
||||
const int result = m_installDialog->exec();
|
||||
if (result != QDialog::Accepted) { return; }
|
||||
}
|
||||
@@ -645,7 +645,7 @@ namespace BlackGui
|
||||
QTimer::singleShot(delayedMs, this, [ = ]
|
||||
{
|
||||
if (this->m_installDialog) { return; }
|
||||
this->checkNewVersion();
|
||||
this->checkNewVersion(true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -671,4 +671,9 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGuiApplication::checkNewVersionMenu()
|
||||
{
|
||||
this->checkNewVersion(false);
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace BlackGui
|
||||
virtual bool parsingHookIn() override;
|
||||
|
||||
//! Check for a new version (update)
|
||||
void checkNewVersion();
|
||||
void checkNewVersion(bool onlyIfNew);
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
@@ -224,6 +224,9 @@ namespace BlackGui
|
||||
|
||||
//! Reload widget style from settings
|
||||
void settingsChanged();
|
||||
|
||||
//! Check new from menu
|
||||
void checkNewVersionMenu();
|
||||
};
|
||||
} // ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user