Auto Update (#1006)

* Updater

* clang

* Adding Updater icon

* Updater

* TR

* settings_dialog.ui

* Changelog for Pre-release only

* Adding Dump and Download icons

* Forgot this...

* fix linux and resize

* powershell_unzip | changelog fix

Does not use zlin-ng to unpack, now uses powershell on windows and on linux/mac uses unzip or 7z, and if it does not find it, it will ask if you want to install it before extracting.

Do not show the changelog button if: The current version is a pre-release and the version to be downloaded is a release.

* Clang

* formatting

* links fixed

---------

Co-authored-by: Xphalnos <164882787+Xphalnos@users.noreply.github.com>
This commit is contained in:
DanielSvoboda 2024-09-24 17:03:15 -03:00 committed by GitHub
parent cec9275c85
commit f79da986e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 5890 additions and 244 deletions

View file

@ -6,6 +6,7 @@
#include "about_dialog.h"
#include "cheats_patches.h"
#include "check_update.h"
#include "common/io_file.h"
#include "common/string_util.h"
#include "common/version.h"
@ -46,6 +47,7 @@ bool MainWindow::Init() {
this->show();
// load game list
LoadGameLists();
CheckUpdateMain(true);
auto end = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
@ -160,6 +162,16 @@ void MainWindow::LoadGameLists() {
}
}
void MainWindow::CheckUpdateMain(bool checkSave) {
if (checkSave) {
if (!Config::autoUpdate()) {
return;
}
}
auto checkUpdate = new CheckUpdate(false);
checkUpdate->exec();
}
void MainWindow::GetPhysicalDevices() {
Vulkan::Instance instance(false, false);
auto physical_devices = instance.GetPhysicalDevices();
@ -221,6 +233,11 @@ void MainWindow::CreateConnects() {
settingsDialog->exec();
});
connect(ui->updaterAct, &QAction::triggered, this, [this]() {
auto checkUpdate = new CheckUpdate(true);
checkUpdate->exec();
});
connect(ui->aboutAct, &QAction::triggered, this, [this]() {
auto aboutDialog = new AboutDialog(this);
aboutDialog->exec();
@ -876,6 +893,10 @@ void MainWindow::SetUiIcons(bool isWhite) {
ui->bootInstallPkgAct->setIcon(RecolorIcon(ui->bootInstallPkgAct->icon(), isWhite));
ui->bootGameAct->setIcon(RecolorIcon(ui->bootGameAct->icon(), isWhite));
ui->exitAct->setIcon(RecolorIcon(ui->exitAct->icon(), isWhite));
ui->updaterAct->setIcon(RecolorIcon(ui->updaterAct->icon(), isWhite));
ui->downloadCheatsPatchesAct->setIcon(
RecolorIcon(ui->downloadCheatsPatchesAct->icon(), isWhite));
ui->dumpGameListAct->setIcon(RecolorIcon(ui->dumpGameListAct->icon(), isWhite));
ui->aboutAct->setIcon(RecolorIcon(ui->aboutAct->icon(), isWhite));
ui->setlistModeListAct->setIcon(RecolorIcon(ui->setlistModeListAct->icon(), isWhite));
ui->setlistModeGridAct->setIcon(RecolorIcon(ui->setlistModeGridAct->icon(), isWhite));
@ -984,4 +1005,4 @@ void MainWindow::OnLanguageChanged(const std::string& locale) {
Config::setEmulatorLanguage(locale);
LoadTranslation();
}
}