2013-09-07 07:30:58 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QApplication>
|
2013-09-22 07:51:36 +05:30
|
|
|
#include <QSharedPointer>
|
2013-09-07 07:30:58 +05:30
|
|
|
#include "MultiMCVersion.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
2013-09-16 04:24:39 +05:30
|
|
|
class MinecraftVersionList;
|
|
|
|
class LWJGLVersionList;
|
2013-09-08 05:45:20 +05:30
|
|
|
class HttpMetaCache;
|
2013-09-07 07:30:58 +05:30
|
|
|
class SettingsObject;
|
|
|
|
class InstanceList;
|
|
|
|
class IconList;
|
|
|
|
class QNetworkAccessManager;
|
2013-09-16 04:24:39 +05:30
|
|
|
class ForgeVersionList;
|
2013-09-07 07:30:58 +05:30
|
|
|
|
|
|
|
#if defined(MMC)
|
|
|
|
#undef MMC
|
|
|
|
#endif
|
|
|
|
#define MMC (static_cast<MultiMC *>(QCoreApplication::instance()))
|
|
|
|
|
|
|
|
class MultiMC : public QApplication
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum Status
|
|
|
|
{
|
|
|
|
Failed,
|
|
|
|
Succeeded,
|
|
|
|
Initialized,
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
MultiMC ( int& argc, char** argv );
|
|
|
|
virtual ~MultiMC();
|
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<SettingsObject> settings()
|
2013-09-07 07:30:58 +05:30
|
|
|
{
|
|
|
|
return m_settings;
|
|
|
|
};
|
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<InstanceList> instances()
|
2013-09-07 07:30:58 +05:30
|
|
|
{
|
|
|
|
return m_instances;
|
|
|
|
};
|
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<IconList> icons();
|
2013-09-07 07:30:58 +05:30
|
|
|
|
|
|
|
Status status()
|
|
|
|
{
|
|
|
|
return m_status;
|
|
|
|
}
|
|
|
|
|
|
|
|
MultiMCVersion version()
|
|
|
|
{
|
|
|
|
return m_version;
|
|
|
|
}
|
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<QNetworkAccessManager> qnam()
|
2013-09-07 07:30:58 +05:30
|
|
|
{
|
|
|
|
return m_qnam;
|
|
|
|
}
|
2013-09-08 05:45:20 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<HttpMetaCache> metacache()
|
2013-09-08 05:45:20 +05:30
|
|
|
{
|
|
|
|
return m_metacache;
|
|
|
|
}
|
2013-09-16 04:24:39 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<LWJGLVersionList> lwjgllist();
|
2013-09-16 04:24:39 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<ForgeVersionList> forgelist();
|
2013-09-16 04:24:39 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<MinecraftVersionList> minecraftlist();
|
2013-09-07 07:30:58 +05:30
|
|
|
private:
|
|
|
|
void initGlobalSettings();
|
|
|
|
|
2013-09-08 05:45:20 +05:30
|
|
|
void initHttpMetaCache();
|
2013-09-09 04:50:17 +05:30
|
|
|
|
|
|
|
void initTranslations();
|
2013-09-07 07:30:58 +05:30
|
|
|
private:
|
2013-09-22 07:51:36 +05:30
|
|
|
QSharedPointer<QTranslator> m_qt_translator;
|
|
|
|
QSharedPointer<QTranslator> m_mmc_translator;
|
|
|
|
QSharedPointer<SettingsObject> m_settings;
|
|
|
|
QSharedPointer<InstanceList> m_instances;
|
|
|
|
QSharedPointer<IconList> m_icons;
|
|
|
|
QSharedPointer<QNetworkAccessManager> m_qnam;
|
|
|
|
QSharedPointer<HttpMetaCache> m_metacache;
|
|
|
|
QSharedPointer<LWJGLVersionList> m_lwjgllist;
|
|
|
|
QSharedPointer<ForgeVersionList> m_forgelist;
|
|
|
|
QSharedPointer<MinecraftVersionList> m_minecraftlist;
|
2013-09-16 04:24:39 +05:30
|
|
|
|
2013-09-22 07:51:36 +05:30
|
|
|
Status m_status = MultiMC::Failed;
|
2013-09-07 07:30:58 +05:30
|
|
|
MultiMCVersion m_version = {VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD};
|
|
|
|
};
|