1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-05-14 13:27:46 +00:00
astra/launcher/include/compatibilitytoolinstaller.h
Joshua Goins bf4f44e8fb Add instructions to allow the Steam Flatpak to launch Astra
Currently Flatpak doesn't have a good way for apps to launch other apps
(even legitimately) so we have to tell the user to punch a hole in the
Steam Flatpak's sandbox.

Oh well, at least now we guide them on how to do it.
2025-05-07 17:37:24 -04:00

43 lines
1,022 B
C++

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QtQml>
class LauncherCore;
class CompatibilityToolInstaller : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("Use LauncherCore.createCompatInstaller")
Q_PROPERTY(bool isInstalled READ isInstalled NOTIFY isInstalledChanged)
Q_PROPERTY(bool hasSteam READ hasSteam CONSTANT)
public:
explicit CompatibilityToolInstaller(LauncherCore &launcher, QObject *parent = nullptr);
Q_INVOKABLE void installCompatibilityTool();
Q_INVOKABLE void removeCompatibilityTool();
bool isInstalled() const;
bool hasSteam() const;
Q_SIGNALS:
void installFinished(bool flatpak);
void error(QString message);
void removalFinished();
void isInstalledChanged();
private:
enum class SteamType {
NotFound,
Native,
Flatpak,
};
std::pair<SteamType, QDir> findSteamType() const;
LauncherCore &m_launcher;
};