Added warning for x86 java
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
27d662e642
commit
c0fb053ccc
@ -40,6 +40,7 @@ struct JavaInstall : public BaseVersion {
|
|||||||
QString arch;
|
QString arch;
|
||||||
QString path;
|
QString path;
|
||||||
bool recommended = false;
|
bool recommended = false;
|
||||||
|
bool is_64bit = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
using JavaInstallPtr = std::shared_ptr<JavaInstall>;
|
using JavaInstallPtr = std::shared_ptr<JavaInstall>;
|
||||||
|
@ -193,6 +193,7 @@ void JavaListLoadTask::javaCheckerFinished()
|
|||||||
javaVersion->id = result.javaVersion;
|
javaVersion->id = result.javaVersion;
|
||||||
javaVersion->arch = result.realPlatform;
|
javaVersion->arch = result.realPlatform;
|
||||||
javaVersion->path = result.path;
|
javaVersion->path = result.path;
|
||||||
|
javaVersion->is_64bit = result.is_64bit;
|
||||||
candidates.append(javaVersion);
|
candidates.append(javaVersion);
|
||||||
|
|
||||||
qDebug() << " " << javaVersion->id.toString() << javaVersion->arch << javaVersion->path;
|
qDebug() << " " << javaVersion->id.toString() << javaVersion->arch << javaVersion->path;
|
||||||
|
@ -145,6 +145,14 @@ void JavaPage::on_javaDetectBtn_clicked()
|
|||||||
if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) {
|
if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) {
|
||||||
java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion());
|
java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion());
|
||||||
ui->javaPathTextBox->setText(java->path);
|
ui->javaPathTextBox->setText(java->path);
|
||||||
|
if (!java->is_64bit && APPLICATION->settings()->get("MaxMemAlloc").toInt() > 2048) {
|
||||||
|
CustomMessageBox::selectable(this, tr("Confirm Selection"),
|
||||||
|
tr("You selected an x86 java version.\n"
|
||||||
|
"This means that will not support more than 2Gb(2048Mb) of ram.\n"
|
||||||
|
"Please make sure that the maximum memory value is lower."),
|
||||||
|
QMessageBox::Warning, QMessageBox::Ok, QMessageBox::Ok)
|
||||||
|
->exec();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "InstanceSettingsPage.h"
|
#include "InstanceSettingsPage.h"
|
||||||
|
#include "ui/dialogs/CustomMessageBox.h"
|
||||||
#include "ui/java/JavaDownloader.h"
|
#include "ui/java/JavaDownloader.h"
|
||||||
#include "ui_InstanceSettingsPage.h"
|
#include "ui_InstanceSettingsPage.h"
|
||||||
|
|
||||||
@ -412,6 +413,15 @@ void InstanceSettingsPage::on_javaDetectBtn_clicked()
|
|||||||
ui->labelPermGen->setVisible(visible);
|
ui->labelPermGen->setVisible(visible);
|
||||||
ui->labelPermgenNote->setVisible(visible);
|
ui->labelPermgenNote->setVisible(visible);
|
||||||
m_settings->set("PermGenVisible", visible);
|
m_settings->set("PermGenVisible", visible);
|
||||||
|
|
||||||
|
if (!java->is_64bit && m_settings->get("MaxMemAlloc").toInt() > 2048) {
|
||||||
|
CustomMessageBox::selectable(this, tr("Confirm Selection"),
|
||||||
|
tr("You selected an x86 java version.\n"
|
||||||
|
"This means that will not support more than 2Gb(2048Mb) of ram.\n"
|
||||||
|
"Please make sure that the maximum memory value is lower."),
|
||||||
|
QMessageBox::Warning, QMessageBox::Ok, QMessageBox::Ok)
|
||||||
|
->exec();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,6 +433,10 @@ void JavaSettingsWidget::updateThresholds()
|
|||||||
} else if (observedMaxMemory < observedMinMemory) {
|
} else if (observedMaxMemory < observedMinMemory) {
|
||||||
iconName = "status-yellow";
|
iconName = "status-yellow";
|
||||||
m_labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation is smaller than the minimum value"));
|
m_labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation is smaller than the minimum value"));
|
||||||
|
} else if (observedMaxMemory > 2048 && m_result.is_64bit) {
|
||||||
|
iconName = "status-bad";
|
||||||
|
m_labelMaxMemIcon->setToolTip(
|
||||||
|
tr("Your maximum memory allocation exceeds selected java posible memory(due to x86 applicatiion limitations)."));
|
||||||
} else {
|
} else {
|
||||||
iconName = "status-good";
|
iconName = "status-good";
|
||||||
m_labelMaxMemIcon->setToolTip("");
|
m_labelMaxMemIcon->setToolTip("");
|
||||||
|
Loading…
Reference in New Issue
Block a user