Merge branch 'develop' into feature/java-downloader
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
commit
5f37e339fb
879 changed files with 49762 additions and 21479 deletions
|
@ -59,9 +59,8 @@ JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
|
|||
ui->setupUi(this);
|
||||
ui->tabWidget->tabBar()->hide();
|
||||
|
||||
auto sysMiB = Sys::getSystemRam() / Sys::mebibyte;
|
||||
ui->maxMemSpinBox->setMaximum(sysMiB);
|
||||
loadSettings();
|
||||
updateThresholds();
|
||||
}
|
||||
|
||||
JavaPage::~JavaPage()
|
||||
|
@ -183,6 +182,11 @@ void JavaPage::on_javaDownloadBtn_clicked()
|
|||
JavaDownloader::showPrompts(this);
|
||||
}
|
||||
|
||||
void JavaPage::on_maxMemSpinBox_valueChanged(int i)
|
||||
{
|
||||
updateThresholds();
|
||||
}
|
||||
|
||||
void JavaPage::checkerFinished()
|
||||
{
|
||||
checker.reset();
|
||||
|
@ -192,3 +196,29 @@ void JavaPage::retranslate()
|
|||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
|
||||
void JavaPage::updateThresholds()
|
||||
{
|
||||
auto sysMiB = Sys::getSystemRam() / Sys::mebibyte;
|
||||
unsigned int maxMem = ui->maxMemSpinBox->value();
|
||||
|
||||
QString iconName;
|
||||
|
||||
if (maxMem >= sysMiB) {
|
||||
iconName = "status-bad";
|
||||
ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation exceeds your system memory capacity."));
|
||||
} else if (maxMem > (sysMiB * 0.9)) {
|
||||
iconName = "status-yellow";
|
||||
ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation approaches your system memory capacity."));
|
||||
} else {
|
||||
iconName = "status-good";
|
||||
ui->labelMaxMemIcon->setToolTip("");
|
||||
}
|
||||
|
||||
{
|
||||
auto height = ui->labelMaxMemIcon->fontInfo().pixelSize();
|
||||
QIcon icon = APPLICATION->getThemedIcon(iconName);
|
||||
QPixmap pix = icon.pixmap(height, height);
|
||||
ui->labelMaxMemIcon->setPixmap(pix);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue