mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-30 06:34:27 +02:00
Implement open global settings
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
223b6b3b2b
commit
e06b3e7a7a
@ -972,7 +972,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
default: {
|
default: {
|
||||||
qDebug() << "Exiting because update lockfile is present";
|
qDebug() << "Exiting because update lockfile is present";
|
||||||
QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(
|
||||||
|
this, []() { exit(1); }, Qt::QueuedConnection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1004,7 +1005,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
default: {
|
default: {
|
||||||
qDebug() << "Exiting because update lockfile is present";
|
qDebug() << "Exiting because update lockfile is present";
|
||||||
QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(
|
||||||
|
this, []() { exit(1); }, Qt::QueuedConnection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1734,7 +1736,8 @@ QString Application::getJarPath(QString jarFile)
|
|||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||||
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
|
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
|
||||||
#endif
|
#endif
|
||||||
FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars"),
|
FS::PathCombine(m_rootPath, "jars"),
|
||||||
|
FS::PathCombine(applicationDirPath(), "jars"),
|
||||||
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
|
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
|
||||||
};
|
};
|
||||||
for (QString p : potentialPaths) {
|
for (QString p : potentialPaths) {
|
||||||
|
@ -51,7 +51,7 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(InstancePtr instance, QWidget*
|
|||||||
m_ui->settingsTabs->removeTab(1);
|
m_ui->settingsTabs->removeTab(1);
|
||||||
// Launch
|
// Launch
|
||||||
m_ui->settingsTabs->removeTab(2);
|
m_ui->settingsTabs->removeTab(2);
|
||||||
m_ui->openGlobalJavaSettingsButton->setVisible(false);
|
m_ui->openGlobalSettingsButton->setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
m_ui->showGameTime->setText(tr("Show time &playing this instance"));
|
m_ui->showGameTime->setText(tr("Show time &playing this instance"));
|
||||||
m_ui->recordGameTime->setText(tr("&Record time playing this instance"));
|
m_ui->recordGameTime->setText(tr("&Record time playing this instance"));
|
||||||
@ -61,6 +61,8 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(InstancePtr instance, QWidget*
|
|||||||
m_ui->maximizedWarning->setText(
|
m_ui->maximizedWarning->setText(
|
||||||
tr("<span style=\" font-weight:600; color:#f5c211;\">Warning</span><span style=\" color:#f5c211;\">: The maximized option is "
|
tr("<span style=\" font-weight:600; color:#f5c211;\">Warning</span><span style=\" color:#f5c211;\">: The maximized option is "
|
||||||
"not fully supported on this Minecraft version.</span>"));
|
"not fully supported on this Minecraft version.</span>"));
|
||||||
|
|
||||||
|
connect(m_ui->openGlobalSettingsButton, &QCommandLinkButton::clicked, this, &MinecraftSettingsWidget::openGlobalSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->maximizedWarning->hide();
|
m_ui->maximizedWarning->hide();
|
||||||
@ -68,6 +70,10 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(InstancePtr instance, QWidget*
|
|||||||
connect(m_ui->maximizedCheckBox, &QCheckBox::toggled, this,
|
connect(m_ui->maximizedCheckBox, &QCheckBox::toggled, this,
|
||||||
[this](const bool value) { m_ui->maximizedWarning->setVisible(value && (m_instance == nullptr || !m_instance->isLegacy())); });
|
[this](const bool value) { m_ui->maximizedWarning->setVisible(value && (m_instance == nullptr || !m_instance->isLegacy())); });
|
||||||
|
|
||||||
|
#if !defined(Q_OS_LINUX)
|
||||||
|
m_ui->perfomanceGroupBox->hide();
|
||||||
|
#endif
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,10 +142,6 @@ void MinecraftSettingsWidget::loadSettings()
|
|||||||
m_ui->useDiscreteGpuCheck->setChecked(settings->get("UseDiscreteGpu").toBool());
|
m_ui->useDiscreteGpuCheck->setChecked(settings->get("UseDiscreteGpu").toBool());
|
||||||
m_ui->useZink->setChecked(settings->get("UseZink").toBool());
|
m_ui->useZink->setChecked(settings->get("UseZink").toBool());
|
||||||
|
|
||||||
#if !defined(Q_OS_LINUX)
|
|
||||||
m_ui->perfomanceGroupBox->hide();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(APPLICATION->capabilities() & Application::SupportsGameMode)) {
|
if (!(APPLICATION->capabilities() & Application::SupportsGameMode)) {
|
||||||
m_ui->enableFeralGamemodeCheck->setDisabled(true);
|
m_ui->enableFeralGamemodeCheck->setDisabled(true);
|
||||||
m_ui->enableFeralGamemodeCheck->setToolTip(tr("Feral Interactive's GameMode could not be found on your system."));
|
m_ui->enableFeralGamemodeCheck->setToolTip(tr("Feral Interactive's GameMode could not be found on your system."));
|
||||||
@ -311,6 +313,16 @@ void MinecraftSettingsWidget::saveSettings()
|
|||||||
m_instance->updateRuntimeContext();
|
m_instance->updateRuntimeContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MinecraftSettingsWidget::openGlobalSettings()
|
||||||
|
{
|
||||||
|
const QString id = m_ui->settingsTabs->currentWidget()->objectName();
|
||||||
|
|
||||||
|
if (id == "javaPage")
|
||||||
|
APPLICATION->ShowGlobalSettings(this, "java-settings");
|
||||||
|
else // TODO select tab
|
||||||
|
APPLICATION->ShowGlobalSettings(this, "minecraft-settings");
|
||||||
|
}
|
||||||
|
|
||||||
SettingsObjectPtr MinecraftSettingsWidget::getSettings() const
|
SettingsObjectPtr MinecraftSettingsWidget::getSettings() const
|
||||||
{
|
{
|
||||||
if (m_instance != nullptr)
|
if (m_instance != nullptr)
|
||||||
|
@ -51,6 +51,8 @@ class MinecraftSettingsWidget : public QWidget {
|
|||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
|
|
||||||
|
void openGlobalSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SettingsObjectPtr getSettings() const;
|
SettingsObjectPtr getSettings() const;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCommandLinkButton" name="openGlobalJavaSettingsButton">
|
<widget class="QCommandLinkButton" name="openGlobalSettingsButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open &Global Settings</string>
|
<string>Open &Global Settings</string>
|
||||||
</property>
|
</property>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-131</y>
|
<y>0</y>
|
||||||
<width>610</width>
|
<width>610</width>
|
||||||
<height>607</height>
|
<height>607</height>
|
||||||
</rect>
|
</rect>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user