2015-07-05 00:54:30 +01:00
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
|
|
#include <BaseInstance.h>
|
|
|
|
#include <tools/BaseProfiler.h>
|
|
|
|
|
|
|
|
class ConsoleWindow;
|
2015-10-23 23:57:54 +01:00
|
|
|
class LaunchController: public Task
|
2015-07-05 00:54:30 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-10-23 23:57:54 +01:00
|
|
|
virtual void executeTask();
|
|
|
|
|
2015-07-05 00:54:30 +01:00
|
|
|
LaunchController(QObject * parent = nullptr);
|
|
|
|
virtual ~LaunchController(){};
|
|
|
|
|
|
|
|
void setInstance(InstancePtr instance)
|
|
|
|
{
|
|
|
|
m_instance = instance;
|
|
|
|
}
|
|
|
|
void setOnline(bool online)
|
|
|
|
{
|
|
|
|
m_online = online;
|
|
|
|
}
|
|
|
|
void setProfiler(BaseProfilerFactory *profiler)
|
|
|
|
{
|
|
|
|
m_profiler = profiler;
|
|
|
|
}
|
|
|
|
void setParentWidget(QWidget * widget)
|
|
|
|
{
|
|
|
|
m_parentWidget = widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void login();
|
|
|
|
void launchInstance();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void readyForLaunch();
|
|
|
|
void instanceEnded();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BaseProfilerFactory *m_profiler = nullptr;
|
|
|
|
bool m_online = true;
|
|
|
|
InstancePtr m_instance;
|
|
|
|
QWidget * m_parentWidget = nullptr;
|
|
|
|
ConsoleWindow *m_console = nullptr;
|
|
|
|
AuthSessionPtr m_session;
|
2015-07-10 00:11:06 +01:00
|
|
|
std::shared_ptr <LaunchTask> m_launcher;
|
2015-07-05 00:54:30 +01:00
|
|
|
};
|