2018-02-11 05:10:01 +05:30
|
|
|
/* Copyright 2013-2018 MultiMC Contributors
|
2013-11-04 01:58:04 +05:30
|
|
|
*
|
|
|
|
* 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
|
2014-07-13 02:32:52 +05:30
|
|
|
|
2014-06-09 04:59:18 +05:30
|
|
|
#include <QWidget>
|
2013-11-04 01:58:04 +05:30
|
|
|
|
2015-02-09 06:21:14 +05:30
|
|
|
#include "java/JavaChecker.h"
|
|
|
|
#include "BaseInstance.h"
|
2015-05-04 04:50:48 +05:30
|
|
|
#include <QObjectPtr.h>
|
2014-06-09 04:59:18 +05:30
|
|
|
#include "BasePage.h"
|
2015-05-04 04:50:48 +05:30
|
|
|
#include "JavaCommon.h"
|
2015-03-02 02:50:57 +05:30
|
|
|
#include "MultiMC.h"
|
2013-11-04 01:58:04 +05:30
|
|
|
|
2014-06-09 04:59:18 +05:30
|
|
|
class JavaChecker;
|
2013-11-04 01:58:04 +05:30
|
|
|
namespace Ui
|
|
|
|
{
|
2014-06-09 04:59:18 +05:30
|
|
|
class InstanceSettingsPage;
|
2013-11-04 01:58:04 +05:30
|
|
|
}
|
|
|
|
|
2014-06-09 04:59:18 +05:30
|
|
|
class InstanceSettingsPage : public QWidget, public BasePage
|
2013-11-04 01:58:04 +05:30
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-06-30 05:32:57 +05:30
|
|
|
explicit InstanceSettingsPage(BaseInstance *inst, QWidget *parent = 0);
|
2014-06-09 04:59:18 +05:30
|
|
|
virtual ~InstanceSettingsPage();
|
2014-07-13 02:32:52 +05:30
|
|
|
virtual QString displayName() const override
|
|
|
|
{
|
|
|
|
return tr("Settings");
|
|
|
|
}
|
|
|
|
virtual QIcon icon() const override
|
|
|
|
{
|
2015-03-02 02:50:57 +05:30
|
|
|
return MMC->getThemedIcon("instance-settings");
|
2014-07-13 02:32:52 +05:30
|
|
|
}
|
|
|
|
virtual QString id() const override
|
|
|
|
{
|
|
|
|
return "settings";
|
|
|
|
}
|
2015-09-26 07:34:09 +05:30
|
|
|
virtual bool apply() override;
|
2014-07-13 02:32:52 +05:30
|
|
|
virtual QString helpPage() const override
|
|
|
|
{
|
|
|
|
return "Instance-settings";
|
|
|
|
}
|
2015-09-26 07:34:09 +05:30
|
|
|
virtual bool shouldDisplay() const override;
|
2015-05-04 04:50:48 +05:30
|
|
|
|
2014-06-09 04:59:18 +05:30
|
|
|
private slots:
|
2013-11-25 05:44:30 +05:30
|
|
|
void on_javaDetectBtn_clicked();
|
|
|
|
void on_javaTestBtn_clicked();
|
|
|
|
void on_javaBrowseBtn_clicked();
|
|
|
|
|
2014-06-09 04:59:18 +05:30
|
|
|
void applySettings();
|
|
|
|
void loadSettings();
|
2014-07-13 02:32:52 +05:30
|
|
|
|
2015-05-04 04:50:48 +05:30
|
|
|
void checkerFinished();
|
|
|
|
|
2013-11-04 01:58:04 +05:30
|
|
|
private:
|
2014-06-09 04:59:18 +05:30
|
|
|
Ui::InstanceSettingsPage *ui;
|
2014-06-30 05:32:57 +05:30
|
|
|
BaseInstance *m_instance;
|
2015-05-23 19:37:47 +05:30
|
|
|
SettingsObjectPtr m_settings;
|
2015-10-20 20:48:53 +05:30
|
|
|
unique_qobject_ptr<JavaCommon::TestCheck> checker;
|
2013-11-04 01:58:04 +05:30
|
|
|
};
|