mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +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");
|
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_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
|
||||||
Q_UNUSED(c);
|
Q_UNUSED(c);
|
||||||
@@ -627,7 +627,7 @@ namespace BlackGui
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiApplication::checkNewVersion()
|
void CGuiApplication::checkNewVersion(bool onlyIfNew)
|
||||||
{
|
{
|
||||||
if (!m_installDialog)
|
if (!m_installDialog)
|
||||||
{
|
{
|
||||||
@@ -635,7 +635,7 @@ namespace BlackGui
|
|||||||
m_installDialog = new CDownloadAndInstallDialog(this->mainApplicationWindow());
|
m_installDialog = new CDownloadAndInstallDialog(this->mainApplicationWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_installDialog->isNewVersionAvailable()) return;
|
if (onlyIfNew && !m_installDialog->isNewVersionAvailable()) return;
|
||||||
const int result = m_installDialog->exec();
|
const int result = m_installDialog->exec();
|
||||||
if (result != QDialog::Accepted) { return; }
|
if (result != QDialog::Accepted) { return; }
|
||||||
}
|
}
|
||||||
@@ -645,7 +645,7 @@ namespace BlackGui
|
|||||||
QTimer::singleShot(delayedMs, this, [ = ]
|
QTimer::singleShot(delayedMs, this, [ = ]
|
||||||
{
|
{
|
||||||
if (this->m_installDialog) { return; }
|
if (this->m_installDialog) { return; }
|
||||||
this->checkNewVersion();
|
this->checkNewVersion(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,4 +671,9 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGuiApplication::checkNewVersionMenu()
|
||||||
|
{
|
||||||
|
this->checkNewVersion(false);
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ namespace BlackGui
|
|||||||
virtual bool parsingHookIn() override;
|
virtual bool parsingHookIn() override;
|
||||||
|
|
||||||
//! Check for a new version (update)
|
//! Check for a new version (update)
|
||||||
void checkNewVersion();
|
void checkNewVersion(bool onlyIfNew);
|
||||||
|
|
||||||
//! Register metadata
|
//! Register metadata
|
||||||
static void registerMetadata();
|
static void registerMetadata();
|
||||||
@@ -224,6 +224,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
//! Reload widget style from settings
|
//! Reload widget style from settings
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
|
//! Check new from menu
|
||||||
|
void checkNewVersionMenu();
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user