2015-07-05 05:24:30 +05:30
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
|
|
#include <BaseInstance.h>
|
|
|
|
#include <tools/BaseProfiler.h>
|
|
|
|
|
|
|
|
class ConsoleWindow;
|
2015-10-24 04:27:54 +05:30
|
|
|
class LaunchController: public Task
|
2015-07-05 05:24:30 +05:30
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-10-24 04:27:54 +05:30
|
|
|
virtual void executeTask();
|
|
|
|
|
2015-07-05 05:24:30 +05:30
|
|
|
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 04:41:06 +05:30
|
|
|
std::shared_ptr <LaunchTask> m_launcher;
|
2015-07-05 05:24:30 +05:30
|
|
|
};
|