aboutsummaryrefslogtreecommitdiff
path: root/gui/pages
diff options
context:
space:
mode:
Diffstat (limited to 'gui/pages')
-rw-r--r--gui/pages/global/AccountListPage.cpp3
-rw-r--r--gui/pages/global/AccountListPage.h2
-rw-r--r--gui/pages/global/AccountListPage.ui142
-rw-r--r--gui/pages/global/BaseSettingsPage.cpp28
-rw-r--r--gui/pages/global/BaseSettingsPage.h35
-rw-r--r--gui/pages/global/ExternalToolsPage.cpp77
-rw-r--r--gui/pages/global/ExternalToolsPage.h12
-rw-r--r--gui/pages/global/ExternalToolsPage.ui296
-rw-r--r--gui/pages/global/JavaPage.cpp146
-rw-r--r--gui/pages/global/JavaPage.h72
-rw-r--r--gui/pages/global/JavaPage.ui303
-rw-r--r--gui/pages/global/MinecraftPage.cpp104
-rw-r--r--gui/pages/global/MinecraftPage.h69
-rw-r--r--gui/pages/global/MinecraftPage.ui184
-rw-r--r--gui/pages/global/MultiMCPage.cpp (renamed from gui/pages/global/SettingsPage.cpp)259
-rw-r--r--gui/pages/global/MultiMCPage.h (renamed from gui/pages/global/SettingsPage.h)43
-rw-r--r--gui/pages/global/MultiMCPage.ui399
-rw-r--r--gui/pages/global/ProxyPage.cpp95
-rw-r--r--gui/pages/global/ProxyPage.h66
-rw-r--r--gui/pages/global/ProxyPage.ui197
-rw-r--r--gui/pages/global/SettingsPage.ui985
21 files changed, 2012 insertions, 1505 deletions
diff --git a/gui/pages/global/AccountListPage.cpp b/gui/pages/global/AccountListPage.cpp
index cad7d5bc..00487d57 100644
--- a/gui/pages/global/AccountListPage.cpp
+++ b/gui/pages/global/AccountListPage.cpp
@@ -34,9 +34,10 @@
#include <MultiMC.h>
AccountListPage::AccountListPage(QWidget *parent)
- : QDialog(parent), ui(new Ui::AccountListPage)
+ : QWidget(parent), ui(new Ui::AccountListPage)
{
ui->setupUi(this);
+ ui->tabWidget->tabBar()->hide();
m_accounts = MMC->accounts();
diff --git a/gui/pages/global/AccountListPage.h b/gui/pages/global/AccountListPage.h
index fd4724d1..fd2c96e3 100644
--- a/gui/pages/global/AccountListPage.h
+++ b/gui/pages/global/AccountListPage.h
@@ -29,7 +29,7 @@ class AccountListPage;
class AuthenticateTask;
-class AccountListPage : public QDialog, public BasePage
+class AccountListPage : public QWidget, public BasePage
{
Q_OBJECT
public:
diff --git a/gui/pages/global/AccountListPage.ui b/gui/pages/global/AccountListPage.ui
index 1e5b07eb..8ad78cf4 100644
--- a/gui/pages/global/AccountListPage.ui
+++ b/gui/pages/global/AccountListPage.ui
@@ -6,81 +6,107 @@
<rect>
<x>0</x>
<y>0</y>
- <width>400</width>
- <height>300</height>
+ <width>694</width>
+ <height>609</height>
</rect>
</property>
<property name="windowTitle">
<string>Manage Accounts</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
+ <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="QLabel" name="welcomeLabel">
- <property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Welcome! If you're new here, you can click the &amp;quot;Add&amp;quot; button to add your Mojang or Minecraft account.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QTreeView" name="listView"/>
- </item>
- <item>
- <layout class="QVBoxLayout" name="manageAcctsBtnBox">
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QPushButton" name="addAccountBtn">
+ <widget class="QLabel" name="welcomeLabel">
<property name="text">
- <string>&amp;Add</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Welcome! If you're new here, you can click the &amp;quot;Add&amp;quot; button to add your Mojang or Minecraft account.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="rmAccountBtn">
- <property name="text">
- <string>&amp;Remove</string>
+ <property name="wordWrap">
+ <bool>true</bool>
</property>
</widget>
</item>
<item>
- <spacer name="buttonSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="setDefaultBtn">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the currently selected account as the active account. The active account is the account that is used to log in (unless it is overridden in an instance-specific setting).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="text">
- <string>&amp;Set Default</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="noDefaultBtn">
- <property name="toolTip">
- <string>Set no default account. This will cause MultiMC to prompt you to select an account every time you launch an instance that doesn't have its own default set.</string>
- </property>
- <property name="text">
- <string>&amp;No Default</string>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="listView"/>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="manageAcctsBtnBox">
+ <item>
+ <widget class="QPushButton" name="addAccountBtn">
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="rmAccountBtn">
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="buttonSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="setDefaultBtn">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set the currently selected account as the active account. The active account is the account that is used to log in (unless it is overridden in an instance-specific setting).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="text">
+ <string>&amp;Set Default</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="noDefaultBtn">
+ <property name="toolTip">
+ <string>Set no default account. This will cause MultiMC to prompt you to select an account every time you launch an instance that doesn't have its own default set.</string>
+ </property>
+ <property name="text">
+ <string>&amp;No Default</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
</item>
</layout>
- </item>
- </layout>
+ </widget>
+ </widget>
</item>
</layout>
</widget>
diff --git a/gui/pages/global/BaseSettingsPage.cpp b/gui/pages/global/BaseSettingsPage.cpp
deleted file mode 100644
index 167b23c0..00000000
--- a/gui/pages/global/BaseSettingsPage.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright 2014 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "BaseSettingsPage.h"
-
-#include "MultiMC.h"
-
-void BaseSettingsPage::opened()
-{
- loadSettings(MMC->settings().get());
-}
-bool BaseSettingsPage::apply()
-{
- applySettings(MMC->settings().get());
- return true;
-}
diff --git a/gui/pages/global/BaseSettingsPage.h b/gui/pages/global/BaseSettingsPage.h
deleted file mode 100644
index 55e5f2a4..00000000
--- a/gui/pages/global/BaseSettingsPage.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright 2014 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include "gui/pages/BasePage.h"
-
-class SettingsObject;
-
-class BaseSettingsPage : public BasePage
-{
-public:
- virtual ~BaseSettingsPage()
- {
- }
-
- void opened() override;
- bool apply() override;
-
-protected:
- virtual void loadSettings(SettingsObject *object) = 0;
- virtual void applySettings(SettingsObject *object) = 0;
-};
diff --git a/gui/pages/global/ExternalToolsPage.cpp b/gui/pages/global/ExternalToolsPage.cpp
index e0312ee5..417a13e3 100644
--- a/gui/pages/global/ExternalToolsPage.cpp
+++ b/gui/pages/global/ExternalToolsPage.cpp
@@ -18,6 +18,7 @@
#include <QMessageBox>
#include <QFileDialog>
+#include <QStandardPaths>
#include <pathutils.h>
@@ -30,10 +31,16 @@ ExternalToolsPage::ExternalToolsPage(QWidget *parent) :
ui(new Ui::ExternalToolsPage)
{
ui->setupUi(this);
+ ui->tabWidget->tabBar()->hide();
+
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
+ ui->jsonEditorTextBox->setClearButtonEnabled(true);
+ #endif
ui->mceditLink->setOpenExternalLinks(true);
ui->jvisualvmLink->setOpenExternalLinks(true);
ui->jprofilerLink->setOpenExternalLinks(true);
+ loadSettings();
}
ExternalToolsPage::~ExternalToolsPage()
@@ -41,17 +48,35 @@ ExternalToolsPage::~ExternalToolsPage()
delete ui;
}
-void ExternalToolsPage::loadSettings(SettingsObject *object)
+void ExternalToolsPage::loadSettings()
{
- ui->jprofilerPathEdit->setText(object->get("JProfilerPath").toString());
- ui->jvisualvmPathEdit->setText(object->get("JVisualVMPath").toString());
- ui->mceditPathEdit->setText(object->get("MCEditPath").toString());
+ auto s = MMC->settings();
+ ui->jprofilerPathEdit->setText(s->get("JProfilerPath").toString());
+ ui->jvisualvmPathEdit->setText(s->get("JVisualVMPath").toString());
+ ui->mceditPathEdit->setText(s->get("MCEditPath").toString());
+
+ // Editors
+ ui->jsonEditorTextBox->setText(s->get("JsonEditor").toString());
}
-void ExternalToolsPage::applySettings(SettingsObject *object)
+void ExternalToolsPage::applySettings()
{
- object->set("JProfilerPath", ui->jprofilerPathEdit->text());
- object->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
- object->set("MCEditPath", ui->mceditPathEdit->text());
+ auto s = MMC->settings();
+ s->set("JProfilerPath", ui->jprofilerPathEdit->text());
+ s->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
+ s->set("MCEditPath", ui->mceditPathEdit->text());
+
+ // Editors
+ QString jsonEditor = ui->jsonEditorTextBox->text();
+ if (!jsonEditor.isEmpty() &&
+ (!QFileInfo(jsonEditor).exists() || !QFileInfo(jsonEditor).isExecutable()))
+ {
+ QString found = QStandardPaths::findExecutable(jsonEditor);
+ if (!found.isEmpty())
+ {
+ jsonEditor = found;
+ }
+ }
+ s->set("JsonEditor", jsonEditor);
}
void ExternalToolsPage::on_jprofilerPathBtn_clicked()
@@ -175,3 +200,39 @@ void ExternalToolsPage::on_mceditCheckBtn_clicked()
QMessageBox::information(this, tr("OK"), tr("MCEdit setup seems to be OK"));
}
}
+
+void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked()
+{
+ QString raw_file = QFileDialog::getOpenFileName(
+ this, tr("JSON Editor"),
+ ui->jsonEditorTextBox->text().isEmpty()
+#if defined(Q_OS_LINUX)
+ ? QString("/usr/bin")
+#else
+ ? QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation).first()
+#endif
+ : ui->jsonEditorTextBox->text());
+ QString cooked_file = NormalizePath(raw_file);
+
+ if (cooked_file.isEmpty())
+ {
+ return;
+ }
+
+ // it has to exist and be an executable
+ if (QFileInfo(cooked_file).exists() && QFileInfo(cooked_file).isExecutable())
+ {
+ ui->jsonEditorTextBox->setText(cooked_file);
+ }
+ else
+ {
+ QMessageBox::warning(this, tr("Invalid"),
+ tr("The file chosen does not seem to be an executable"));
+ }
+}
+
+bool ExternalToolsPage::apply()
+{
+ applySettings();
+ return true;
+}
diff --git a/gui/pages/global/ExternalToolsPage.h b/gui/pages/global/ExternalToolsPage.h
index 1b35a92b..027e164e 100644
--- a/gui/pages/global/ExternalToolsPage.h
+++ b/gui/pages/global/ExternalToolsPage.h
@@ -17,13 +17,13 @@
#include <QWidget>
-#include "BaseSettingsPage.h"
+#include "gui/pages/BasePage.h"
namespace Ui {
class ExternalToolsPage;
}
-class ExternalToolsPage : public QWidget, public BaseSettingsPage
+class ExternalToolsPage : public QWidget, public BasePage
{
Q_OBJECT
@@ -47,10 +47,11 @@ public:
{
return "External-tools";
}
+ virtual bool apply();
-protected:
- void loadSettings(SettingsObject *object) override;
- void applySettings(SettingsObject *object) override;
+private:
+ void loadSettings();
+ void applySettings();
private:
Ui::ExternalToolsPage *ui;
@@ -63,4 +64,5 @@ slots:
void on_jvisualvmCheckBtn_clicked();
void on_mceditPathBtn_clicked();
void on_mceditCheckBtn_clicked();
+ void on_jsonEditorBrowseBtn_clicked();
};
diff --git a/gui/pages/global/ExternalToolsPage.ui b/gui/pages/global/ExternalToolsPage.ui
index 96650f0f..ba1b6f01 100644
--- a/gui/pages/global/ExternalToolsPage.ui
+++ b/gui/pages/global/ExternalToolsPage.ui
@@ -6,138 +6,190 @@
<rect>
<x>0</x>
<y>0</y>
- <width>494</width>
- <height>562</height>
+ <width>673</width>
+ <height>751</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</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="QGroupBox" name="groupBox_2">
- <property name="title">
- <string>JProfiler</string>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_10">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="QLineEdit" name="jprofilerPathEdit"/>
- </item>
- <item>
- <widget class="QPushButton" name="jprofilerPathBtn">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QPushButton" name="jprofilerCheckBtn">
- <property name="text">
- <string>Check</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="jprofilerLink">
- <property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://www.ej-technologies.com/products/jprofiler/overview.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.ej-technologies.com/products/jprofiler/overview.html&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- </widget>
- </item>
- </layout>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Tab 1</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>JProfiler</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLineEdit" name="jprofilerPathEdit"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="jprofilerPathBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="jprofilerCheckBtn">
+ <property name="text">
+ <string>Check</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="jprofilerLink">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://www.ej-technologies.com/products/jprofiler/overview.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.ej-technologies.com/products/jprofiler/overview.html&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>JVisualVM</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_11">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QLineEdit" name="jvisualvmPathEdit"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="jvisualvmPathBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="jvisualvmCheckBtn">
+ <property name="text">
+ <string>Check</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="jvisualvmLink">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://visualvm.java.net/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://visualvm.java.net/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>MCEdit</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_12">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLineEdit" name="mceditPathEdit"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mceditPathBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mceditCheckBtn">
+ <property name="text">
+ <string>Check</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="mceditLink">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://www.mcedit.net/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.mcedit.net/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="editorsBox">
+ <property name="title">
+ <string>External Editors (leave empty for system default)</string>
+ </property>
+ <layout class="QGridLayout" name="foldersBoxLayout_2">
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="jsonEditorTextBox"/>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelJsonEditor">
+ <property name="text">
+ <string>Text Editor:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QToolButton" name="jsonEditorBrowseBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>216</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="groupBox_3">
- <property name="title">
- <string>JVisualVM</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_11">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="QLineEdit" name="jvisualvmPathEdit"/>
- </item>
- <item>
- <widget class="QPushButton" name="jvisualvmPathBtn">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QPushButton" name="jvisualvmCheckBtn">
- <property name="text">
- <string>Check</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="jvisualvmLink">
- <property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://visualvm.java.net/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://visualvm.java.net/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_4">
- <property name="title">
- <string>MCEdit</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_12">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_6">
- <item>
- <widget class="QLineEdit" name="mceditPathEdit"/>
- </item>
- <item>
- <widget class="QPushButton" name="mceditPathBtn">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QPushButton" name="mceditCheckBtn">
- <property name="text">
- <string>Check</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="mceditLink">
- <property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;http://www.mcedit.net/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.mcedit.net/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>160</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<resources/>
diff --git a/gui/pages/global/JavaPage.cpp b/gui/pages/global/JavaPage.cpp
new file mode 100644
index 00000000..86451411
--- /dev/null
+++ b/gui/pages/global/JavaPage.cpp
@@ -0,0 +1,146 @@
+/* Copyright 2013 MultiMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "JavaPage.h"
+#include "ui_JavaPage.h"
+
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QDir>
+
+#include <pathutils.h>
+
+#include "logic/NagUtils.h"
+
+#include "gui/Platform.h"
+#include "gui/dialogs/VersionSelectDialog.h"
+#include <gui/ColumnResizer.h>
+
+#include "logic/java/JavaUtils.h"
+#include "logic/java/JavaVersionList.h"
+#include "logic/java/JavaChecker.h"
+
+#include "logic/settings/SettingsObject.h"
+#include "MultiMC.h"
+
+JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
+{
+ ui->setupUi(this);
+ ui->tabWidget->tabBar()->hide();
+
+ auto resizer = new ColumnResizer(this);
+ resizer->addWidgetsFromLayout(ui->javaSettingsGroupBox->layout(), 0);
+ resizer->addWidgetsFromLayout(ui->customCommandsGroupBox->layout(), 0);
+
+ loadSettings();
+}
+
+JavaPage::~JavaPage()
+{
+ delete ui;
+}
+
+bool JavaPage::apply()
+{
+ applySettings();
+ return true;
+}
+
+void JavaPage::applySettings()
+{
+ auto s = MMC->settings();
+ // Memory
+ s->set("MinMemAlloc", ui->minMemSpinBox->value());
+ s->set("MaxMemAlloc", ui->maxMemSpinBox->value());
+ s->set("PermGen", ui->permGenSpinBox->value());
+
+ // Java Settings
+ s->set("JavaPath", ui->javaPathTextBox->text());
+ s->set("JvmArgs", ui->jvmArgsTextBox->text());
+ NagUtils::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget());
+
+ // Custom Commands
+ s->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text());
+ s->set("PostExitCommand", ui->postExitCmdTextBox->text());
+}
+void JavaPage::loadSettings()
+{