summaryrefslogtreecommitdiffstats
path: root/application/pages/instance
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-06-01 12:28:53 +0200
committerPetr Mrázek <peterix@gmail.com>2019-06-01 12:28:53 +0200
commit932160818e8e15dc124e1ce281749d28e10c5e66 (patch)
tree1924f82fffccf54ef14cbfcd8a7f25ccda53daaf /application/pages/instance
parent59e1ed3d8750b499b6d515a82bc08f6f72cc456a (diff)
downloadMultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar.gz
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar.lz
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.tar.xz
MultiMC-932160818e8e15dc124e1ce281749d28e10c5e66.zip
NOISSUE add option to open global settings from instance settings
This should hopefully giude people towards using the right thing.
Diffstat (limited to 'application/pages/instance')
-rw-r--r--application/pages/instance/InstanceSettingsPage.cpp8
-rw-r--r--application/pages/instance/InstanceSettingsPage.h2
-rw-r--r--application/pages/instance/InstanceSettingsPage.ui27
3 files changed, 23 insertions, 14 deletions
diff --git a/application/pages/instance/InstanceSettingsPage.cpp b/application/pages/instance/InstanceSettingsPage.cpp
index 61911f67..210820fc 100644
--- a/application/pages/instance/InstanceSettingsPage.cpp
+++ b/application/pages/instance/InstanceSettingsPage.cpp
@@ -21,6 +21,9 @@ InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
ui->setupUi(this);
auto sysMB = Sys::getSystemRam() / Sys::megabyte;
ui->maxMemSpinBox->setMaximum(sysMB);
+ connect(ui->openGlobalJavaSettingsButton, &QCommandLinkButton::clicked, this, &InstanceSettingsPage::globalSettingsButtonClicked);
+ connect(MMC, &MultiMC::globalSettingsAboutToOpen, this, &InstanceSettingsPage::applySettings);
+ connect(MMC, &MultiMC::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
loadSettings();
}
@@ -34,6 +37,11 @@ InstanceSettingsPage::~InstanceSettingsPage()
delete ui;
}
+void InstanceSettingsPage::globalSettingsButtonClicked(bool)
+{
+ MMC->ShowGlobalSettings(this, "global-settings");
+}
+
bool InstanceSettingsPage::apply()
{
applySettings();
diff --git a/application/pages/instance/InstanceSettingsPage.h b/application/pages/instance/InstanceSettingsPage.h
index 18687ede..c3c78fd5 100644
--- a/application/pages/instance/InstanceSettingsPage.h
+++ b/application/pages/instance/InstanceSettingsPage.h
@@ -66,6 +66,8 @@ private slots:
void checkerFinished();
+ void globalSettingsButtonClicked(bool checked);
+
private:
Ui::InstanceSettingsPage *ui;
BaseInstance *m_instance;
diff --git a/application/pages/instance/InstanceSettingsPage.ui b/application/pages/instance/InstanceSettingsPage.ui
index 0c180df3..ad4dcfcf 100644
--- a/application/pages/instance/InstanceSettingsPage.ui
+++ b/application/pages/instance/InstanceSettingsPage.ui
@@ -6,23 +6,21 @@
<rect>
<x>0</x>
<y>0</y>
- <width>553</width>
- <height>522</height>
+ <width>738</width>
+ <height>804</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
+ <item>
+ <widget class="QCommandLinkButton" name="openGlobalJavaSettingsButton">
+ <property name="text">
+ <string>Open Global Settings</string>
+ </property>
+ <property name="description">
+ <string>The settings here are overrides for global settings.</string>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QTabWidget" name="settingsTabs">
<property name="tabShape">
@@ -367,6 +365,7 @@
</customwidget>
</customwidgets>
<tabstops>
+ <tabstop>openGlobalJavaSettingsButton</tabstop>
<tabstop>settingsTabs</tabstop>
<tabstop>javaSettingsGroupBox</tabstop>
<tabstop>javaPathTextBox</tabstop>