diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-07-25 19:11:59 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-07-25 19:50:44 +0200 |
commit | 20b9f2b42a3b58b6081af271774fbcc34025dccb (patch) | |
tree | 064fa59facb3357139b47bd4e60bfc8edb35ca11 /launcher/Env.h | |
parent | dd133680858351e3e07690e286882327a4f42ba5 (diff) | |
download | PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.tar.gz PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.tar.bz2 PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.zip |
NOISSUE Flatten gui and logic libraries into MultiMC
Diffstat (limited to 'launcher/Env.h')
-rw-r--r-- | launcher/Env.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/launcher/Env.h b/launcher/Env.h new file mode 100644 index 00000000..7d1a8bc9 --- /dev/null +++ b/launcher/Env.h @@ -0,0 +1,63 @@ +#pragma once + +#include <memory> +#include "icons/IIconList.h" +#include <QString> +#include <QMap> + +#include "QObjectPtr.h" + +class QNetworkAccessManager; +class HttpMetaCache; +class BaseVersionList; +class BaseVersion; + +namespace Meta +{ +class Index; +} + +#if defined(ENV) + #undef ENV +#endif +#define ENV (Env::getInstance()) + + +class Env +{ + friend class MultiMC; +private: + struct Private; + Env(); + ~Env(); + static void dispose(); +public: + static Env& getInstance(); + + QNetworkAccessManager &qnam() const; + + shared_qobject_ptr<HttpMetaCache> metacache(); + + std::shared_ptr<IIconList> icons(); + + /// init the cache. FIXME: possible future hook point + void initHttpMetaCache(); + + /// Updates the application proxy settings from the settings object. + void updateProxySettings(QString proxyTypeStr, QString addr, int port, QString user, QString password); + + void registerIconList(std::shared_ptr<IIconList> iconlist); + + shared_qobject_ptr<Meta::Index> metadataIndex(); + + QString getJarsPath(); + void setJarsPath(const QString & path); + + bool isFeatureEnabled(const QString & featureName) const; + void enableFeature(const QString & featureName, bool state = true); + void getEnabledFeatures(QSet<QString> & features) const; + void setEnabledFeatures(const QSet<QString> & features) const; + +protected: + Private * d; +}; |