mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-26 00:15:16 +00:00
NOISSUE set max of java heap spinboxes to detected physical memory
This commit is contained in:
parent
5ea170db78
commit
afb0db24a8
@ -11,12 +11,15 @@
|
||||
|
||||
#include <java/JavaInstallList.h>
|
||||
#include <FileSystem.h>
|
||||
#include <sys.h>
|
||||
|
||||
InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst)
|
||||
{
|
||||
m_settings = inst->settings();
|
||||
ui->setupUi(this);
|
||||
auto sysMB = Sys::getSystemRam() / Sys::megabyte;
|
||||
ui->maxMemSpinBox->setMaximum(sysMB);
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "settings/SettingsObject.h"
|
||||
#include <FileSystem.h>
|
||||
#include "MultiMC.h"
|
||||
#include <sys.h>
|
||||
|
||||
JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
|
||||
{
|
||||
@ -40,6 +41,8 @@ JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
|
||||
resizer->addWidgetsFromLayout(ui->javaSettingsGroupBox->layout(), 0);
|
||||
resizer->addWidgetsFromLayout(ui->customCommandsGroupBox->layout(), 0);
|
||||
|
||||
auto sysMB = Sys::getSystemRam() / Sys::megabyte;
|
||||
ui->maxMemSpinBox->setMaximum(sysMB);
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
JavaWizardPage::JavaWizardPage(QWidget *parent)
|
||||
:BaseWizardPage(parent)
|
||||
{
|
||||
m_availableMemory = Sys::getSystemRam() / (1024ull * 1024ull);
|
||||
m_availableMemory = Sys::getSystemRam() / Sys::megabyte;
|
||||
|
||||
goodIcon = MMC->getThemedIcon("status-good");
|
||||
yellowIcon = MMC->getThemedIcon("status-yellow");
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
namespace Sys
|
||||
{
|
||||
const uint64_t megabyte = 1024ull * 1024ull;
|
||||
struct KernelInfo
|
||||
{
|
||||
QString kernelName;
|
||||
|
Loading…
Reference in New Issue
Block a user