2023-08-18 23:27:29 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-07-04 20:53:06 -04:00
|
|
|
#include <QtQml>
|
2023-08-18 23:27:29 -04:00
|
|
|
|
|
|
|
class LauncherCore;
|
|
|
|
|
|
|
|
class CompatibilityToolInstaller : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-09-16 18:01:02 -04:00
|
|
|
QML_ELEMENT
|
|
|
|
QML_UNCREATABLE("Use LauncherCore.createCompatInstaller")
|
|
|
|
|
2025-04-29 15:12:07 -04:00
|
|
|
Q_PROPERTY(bool isInstalled READ isInstalled NOTIFY isInstalledChanged)
|
2025-04-29 15:12:07 -04:00
|
|
|
Q_PROPERTY(bool hasSteam READ hasSteam CONSTANT)
|
2025-04-29 15:12:07 -04:00
|
|
|
|
2023-08-18 23:27:29 -04:00
|
|
|
public:
|
2023-09-16 21:26:46 -04:00
|
|
|
explicit CompatibilityToolInstaller(LauncherCore &launcher, QObject *parent = nullptr);
|
2023-08-18 23:27:29 -04:00
|
|
|
|
|
|
|
Q_INVOKABLE void installCompatibilityTool();
|
|
|
|
Q_INVOKABLE void removeCompatibilityTool();
|
|
|
|
|
2025-04-29 15:12:07 -04:00
|
|
|
bool isInstalled() const;
|
2025-04-29 15:12:07 -04:00
|
|
|
bool hasSteam() const;
|
2025-04-29 15:12:07 -04:00
|
|
|
|
2023-08-18 23:27:29 -04:00
|
|
|
Q_SIGNALS:
|
|
|
|
void installFinished();
|
|
|
|
void error(QString message);
|
2025-04-29 15:12:07 -04:00
|
|
|
void removalFinished();
|
2025-04-29 15:12:07 -04:00
|
|
|
void isInstalledChanged();
|
2023-08-18 23:27:29 -04:00
|
|
|
|
|
|
|
private:
|
2025-04-29 15:12:07 -04:00
|
|
|
QDir steamDir() const;
|
|
|
|
|
2023-08-18 23:27:29 -04:00
|
|
|
LauncherCore &m_launcher;
|
|
|
|
};
|