feat: add version to update menu

This commit is contained in:
2021-11-14 15:27:09 +01:00
parent 11a517a41a
commit 6a79f2b490
3 changed files with 33 additions and 7 deletions

View File

@@ -44,9 +44,20 @@ void UpdateMenu::render() {
}
} else {
ImGui::Text("An update is available!");
ImGui::Separator();
ImGui::Text("Current version : %s", m_Updater.getCurrentVersion().c_str());
ImGui::Text("Last version : %s", m_Updater.getLastVersion().c_str());
bool canDownloadFile = m_Updater.canUpdate();
if(!canDownloadFile) ImGui::BeginDisabled();
if (ImGui::Button("Download")) {
m_Updater.downloadUpdate();
}
if(!canDownloadFile) ImGui::EndDisabled();
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
m_Opened = false;
@@ -55,6 +66,9 @@ void UpdateMenu::render() {
}
} else {
ImGui::Text("No update available!");
ImGui::Separator();
ImGui::Text("Current version : %s", m_Updater.getCurrentVersion().c_str());
ImGui::Text("Last version : %s", m_Updater.getLastVersion().c_str());
}
} else {
ImGui::Text("Checking updates ...");