2021-12-06 21:15:31 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "launchercore.h"
|
|
|
|
|
|
|
|
#if defined(Q_OS_LINUX)
|
2023-07-30 08:49:34 -04:00
|
|
|
#include "gameparser.h"
|
2021-12-06 21:15:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
class Watchdog : public QObject
|
|
|
|
{
|
2021-12-06 21:15:31 -05:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-07-30 08:49:34 -04:00
|
|
|
Watchdog(LauncherCore &core)
|
|
|
|
: core(core)
|
|
|
|
, QObject(&core)
|
|
|
|
{
|
|
|
|
}
|
2021-12-06 21:15:31 -05:00
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
void launchGame(const ProfileSettings &settings, const LoginAuth &auth);
|
2021-12-06 21:15:31 -05:00
|
|
|
|
|
|
|
private:
|
2023-07-30 08:49:34 -04:00
|
|
|
LauncherCore &core;
|
|
|
|
QSystemTrayIcon *icon = nullptr;
|
2021-12-06 21:15:31 -05:00
|
|
|
|
|
|
|
int processWindowId = -1;
|
|
|
|
|
|
|
|
#if defined(Q_OS_LINUX)
|
|
|
|
GameParseResult lastResult;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
std::unique_ptr<GameParser> parser;
|
|
|
|
};
|