2013-09-07 03:00:58 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QApplication>
|
2013-09-22 03:21:36 +01:00
|
|
|
#include <QSharedPointer>
|
2013-09-07 03:00:58 +01:00
|
|
|
#include "MultiMCVersion.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
2013-09-15 23:54:39 +01:00
|
|
|
class MinecraftVersionList;
|
|
|
|
class LWJGLVersionList;
|
2013-09-08 01:15:20 +01:00
|
|
|
class HttpMetaCache;
|
2013-09-07 03:00:58 +01:00
|
|
|
class SettingsObject;
|
|
|
|
class InstanceList;
|
|
|
|
class IconList;
|
|
|
|
class QNetworkAccessManager;
|
2013-09-15 23:54:39 +01:00
|
|
|
class ForgeVersionList;
|
2013-09-07 03:00:58 +01:00
|
|
|
|
|
|
|
#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 03:21:36 +01:00
|
|
|
QSharedPointer<SettingsObject> settings()
|
2013-09-07 03:00:58 +01:00
|
|
|
{
|
|
|
|
return m_settings;
|
|
|
|
};
|
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<InstanceList> instances()
|
2013-09-07 03:00:58 +01:00
|
|
|
{
|
|
|
|
return m_instances;
|
|
|
|
};
|
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<IconList> icons();
|
2013-09-07 03:00:58 +01:00
|
|
|
|
|
|
|
Status status()
|
|
|
|
{
|
|
|
|
return m_status;
|
|
|
|
}
|
|
|
|
|
|
|
|
MultiMCVersion version()
|
|
|
|
{
|
|
|
|
return m_version;
|
|
|
|
}
|
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<QNetworkAccessManager> qnam()
|
2013-09-07 03:00:58 +01:00
|
|
|
{
|
|
|
|
return m_qnam;
|
|
|
|
}
|
2013-09-08 01:15:20 +01:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<HttpMetaCache> metacache()
|
2013-09-08 01:15:20 +01:00
|
|
|
{
|
|
|
|
return m_metacache;
|
|
|
|
}
|
2013-09-15 23:54:39 +01:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<LWJGLVersionList> lwjgllist();
|
2013-09-15 23:54:39 +01:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<ForgeVersionList> forgelist();
|
2013-09-15 23:54:39 +01:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
QSharedPointer<MinecraftVersionList> minecraftlist();
|
2013-09-22 23:23:50 +01:00
|
|
|
|
2013-09-07 03:00:58 +01:00
|
|
|
private:
|
|
|
|
void initGlobalSettings();
|
|
|
|
|
2013-09-08 01:15:20 +01:00
|
|
|
void initHttpMetaCache();
|
2013-09-09 00:20:17 +01:00
|
|
|
|
|
|
|
void initTranslations();
|
2013-09-07 03:00:58 +01:00
|
|
|
private:
|
2013-09-22 03:21:36 +01:00
|
|
|
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-15 23:54:39 +01:00
|
|
|
|
2013-09-22 03:21:36 +01:00
|
|
|
Status m_status = MultiMC::Failed;
|
2013-09-07 03:00:58 +01:00
|
|
|
MultiMCVersion m_version = {VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD};
|
|
|
|
};
|