Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into feature/java-downloader
This commit is contained in:
commit
a09742a406
@ -667,6 +667,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
// Minecraft mods
|
// Minecraft mods
|
||||||
m_settings->registerSetting("ModMetadataDisabled", false);
|
m_settings->registerSetting("ModMetadataDisabled", false);
|
||||||
m_settings->registerSetting("ModDependenciesDisabled", false);
|
m_settings->registerSetting("ModDependenciesDisabled", false);
|
||||||
|
m_settings->registerSetting("SkipModpackUpdatePrompt", false);
|
||||||
|
|
||||||
// Minecraft offline player name
|
// Minecraft offline player name
|
||||||
m_settings->registerSetting("LastOfflinePlayerName", "");
|
m_settings->registerSetting("LastOfflinePlayerName", "");
|
||||||
|
@ -710,6 +710,12 @@ void InstanceList::saveGroupList()
|
|||||||
groupsArr.insert(name, groupObj);
|
groupsArr.insert(name, groupObj);
|
||||||
}
|
}
|
||||||
toplevel.insert("groups", groupsArr);
|
toplevel.insert("groups", groupsArr);
|
||||||
|
// empty string represents ungrouped "group"
|
||||||
|
if (m_collapsedGroups.contains("")) {
|
||||||
|
QJsonObject ungrouped;
|
||||||
|
ungrouped.insert("hidden", QJsonValue(true));
|
||||||
|
toplevel.insert("ungrouped", ungrouped);
|
||||||
|
}
|
||||||
QJsonDocument doc(toplevel);
|
QJsonDocument doc(toplevel);
|
||||||
try {
|
try {
|
||||||
FS::write(groupFileName, doc.toJson());
|
FS::write(groupFileName, doc.toJson());
|
||||||
@ -805,6 +811,16 @@ void InstanceList::loadGroupList()
|
|||||||
increaseGroupCount(groupName);
|
increaseGroupCount(groupName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ungroupedHidden = false;
|
||||||
|
if (rootObj.value("ungrouped").isObject()) {
|
||||||
|
QJsonObject ungrouped = rootObj.value("ungrouped").toObject();
|
||||||
|
ungroupedHidden = ungrouped.value("hidden").toBool(false);
|
||||||
|
}
|
||||||
|
if (ungroupedHidden) {
|
||||||
|
// empty string represents ungrouped "group"
|
||||||
|
m_collapsedGroups.insert("");
|
||||||
|
}
|
||||||
m_groupsLoaded = true;
|
m_groupsLoaded = true;
|
||||||
qDebug() << "Group list loaded.";
|
qDebug() << "Group list loaded.";
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "InstanceTask.h"
|
#include "InstanceTask.h"
|
||||||
|
|
||||||
|
#include "Application.h"
|
||||||
|
#include "settings/SettingsObject.h"
|
||||||
#include "ui/dialogs/CustomMessageBox.h"
|
#include "ui/dialogs/CustomMessageBox.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@ -22,6 +24,9 @@ InstanceNameChange askForChangingInstanceName(QWidget* parent, const QString& ol
|
|||||||
|
|
||||||
ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name)
|
ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name)
|
||||||
{
|
{
|
||||||
|
if (APPLICATION->settings()->get("SkipModpackUpdatePrompt").toBool())
|
||||||
|
return ShouldUpdate::SkipUpdating;
|
||||||
|
|
||||||
auto info = CustomMessageBox::selectable(
|
auto info = CustomMessageBox::selectable(
|
||||||
parent, QObject::tr("Similar modpack was found!"),
|
parent, QObject::tr("Similar modpack was found!"),
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
|
@ -18,8 +18,7 @@ Hasher::Ptr createHasher(QString file_path, ModPlatform::ResourceProvider provid
|
|||||||
case ModPlatform::ResourceProvider::FLAME:
|
case ModPlatform::ResourceProvider::FLAME:
|
||||||
return makeShared<Hasher>(file_path, Algorithm::Murmur2);
|
return makeShared<Hasher>(file_path, Algorithm::Murmur2);
|
||||||
default:
|
default:
|
||||||
qCritical() << "[Hashing]"
|
qCritical() << "[Hashing]" << "Unrecognized mod platform!";
|
||||||
<< "Unrecognized mod platform!";
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,7 +137,8 @@ QString hash(QByteArray data, Algorithm type)
|
|||||||
|
|
||||||
void Hasher::executeTask()
|
void Hasher::executeTask()
|
||||||
{
|
{
|
||||||
m_future = QtConcurrent::run(QThreadPool::globalInstance(), [this]() { return hash(m_path, m_alg); });
|
m_future = QtConcurrent::run(
|
||||||
|
QThreadPool::globalInstance(), [](QString fileName, Algorithm type) { return hash(fileName, type); }, m_path, m_alg);
|
||||||
connect(&m_watcher, &QFutureWatcher<QString>::finished, this, [this] {
|
connect(&m_watcher, &QFutureWatcher<QString>::finished, this, [this] {
|
||||||
if (m_future.isCanceled()) {
|
if (m_future.isCanceled()) {
|
||||||
emitAborted();
|
emitAborted();
|
||||||
|
@ -252,6 +252,7 @@ void LauncherPage::applySettings()
|
|||||||
// Mods
|
// Mods
|
||||||
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
||||||
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
||||||
|
s->set("SkipModpackUpdatePrompt", ui->skipModpackUpdatePromptBtn->isChecked());
|
||||||
}
|
}
|
||||||
void LauncherPage::loadSettings()
|
void LauncherPage::loadSettings()
|
||||||
{
|
{
|
||||||
@ -315,6 +316,7 @@ void LauncherPage::loadSettings()
|
|||||||
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
|
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
|
||||||
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
||||||
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
|
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
|
||||||
|
ui->skipModpackUpdatePromptBtn->setChecked(s->get("SkipModpackUpdatePrompt").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherPage::refreshFontPreview()
|
void LauncherPage::refreshFontPreview()
|
||||||
|
@ -263,6 +263,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="skipModpackUpdatePromptBtn">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>When creating a new modpack instance, do not suggest updating existing instances instead.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Skip modpack update prompt</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user