mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-30 18:36:58 +03:00
SCRATCH move icons over to Env, instance proxy model to gui
This commit is contained in:
parent
154d19bb74
commit
aa70ed2244
22 changed files with 92 additions and 74 deletions
29
MultiMC.cpp
29
MultiMC.cpp
|
|
@ -194,6 +194,9 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
|
|||
|
||||
m_translationChecker.reset(new TranslationDownloader());
|
||||
|
||||
// load icons
|
||||
initIcons();
|
||||
|
||||
// and instances
|
||||
auto InstDirSetting = m_settings->getSetting("InstanceDir");
|
||||
// instance path: check for problems with '!' in instance path and warn the user in the log
|
||||
|
|
@ -307,6 +310,17 @@ void MultiMC::initTranslations()
|
|||
}
|
||||
}
|
||||
|
||||
void MultiMC::initIcons()
|
||||
{
|
||||
auto setting = MMC->settings()->getSetting("IconsDir");
|
||||
ENV.m_icons.reset(new IconList(QString(":/icons/instances/"), setting->get().toString()));
|
||||
connect(setting.get(), &Setting::SettingChanged,[&](const Setting &, QVariant value)
|
||||
{
|
||||
ENV.m_icons->directoryChanged(value.toString());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void moveFile(const QString &oldName, const QString &newName)
|
||||
{
|
||||
QFile::remove(newName);
|
||||
|
|
@ -448,21 +462,6 @@ void MultiMC::initGlobalSettings(bool test_mode)
|
|||
m_settings->registerSetting("PagedGeometry", "");
|
||||
}
|
||||
|
||||
std::shared_ptr<IconList> MultiMC::icons()
|
||||
{
|
||||
if (!m_icons)
|
||||
{
|
||||
|
||||
auto setting = MMC->settings()->getSetting("IconsDir");
|
||||
m_icons.reset(new IconList(setting->get().toString()));
|
||||
connect(setting.get(), &Setting::SettingChanged,[&](const Setting &, QVariant value)
|
||||
{
|
||||
m_icons->directoryChanged(value.toString());
|
||||
});
|
||||
}
|
||||
return m_icons;
|
||||
}
|
||||
|
||||
std::shared_ptr<LWJGLVersionList> MultiMC::lwjgllist()
|
||||
{
|
||||
if (!m_lwjgllist)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue