mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-03 11:56:57 +03:00
Rework the update checking system
This commit is contained in:
parent
6aa9bd0f77
commit
bf94aaea75
11 changed files with 394 additions and 176 deletions
|
|
@ -84,7 +84,8 @@
|
|||
#include "logic/SkinUtils.h"
|
||||
|
||||
#include "logic/LegacyInstance.h"
|
||||
#include <logic/GoUpdate.h>
|
||||
|
||||
#include <logic/updater/UpdateChecker.h>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
|
||||
{
|
||||
|
|
@ -239,8 +240,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
}
|
||||
|
||||
// set up the updater object.
|
||||
auto updater = MMC->goupdate();
|
||||
connect(updater.get(), SIGNAL(updateAvailable()), SLOT(updateAvailable()));
|
||||
auto updater = MMC->updateChecker();
|
||||
QObject::connect(updater.get(), &UpdateChecker::updateAvailable, this, &MainWindow::updateAvailable);
|
||||
// if automatic update checks are allowed, start one.
|
||||
if(MMC->settings()->get("AutoUpdate").toBool())
|
||||
on_actionCheckUpdate_triggered();
|
||||
|
|
@ -426,7 +427,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *ev)
|
|||
return QMainWindow::eventFilter(obj, ev);
|
||||
}
|
||||
|
||||
void MainWindow::updateAvailable()
|
||||
void MainWindow::updateAvailable(QString repo, QString versionName, int versionId)
|
||||
{
|
||||
UpdateDialog dlg;
|
||||
UpdateAction action = (UpdateAction) dlg.exec();
|
||||
|
|
@ -631,7 +632,7 @@ void MainWindow::on_actionConfig_Folder_triggered()
|
|||
|
||||
void MainWindow::on_actionCheckUpdate_triggered()
|
||||
{
|
||||
auto updater = MMC->goupdate();
|
||||
auto updater = MMC->updateChecker();
|
||||
updater->checkForUpdate();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue