Added more logs for auto java install
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
703470e57d
commit
1c809f0fb1
@ -91,7 +91,21 @@ void AutoInstallJava::executeTask()
|
||||
emit progressReportingRequest();
|
||||
return;
|
||||
}
|
||||
if (m_supported_arch.isEmpty()) {
|
||||
emit logLine(tr("Your system(%1 %2) is not compatible with auto java download. Using the default java path.")
|
||||
.arg(SysInfo::currentSystem(), SysInfo::useQTForArch()),
|
||||
MessageLevel::Warning);
|
||||
emitSucceeded();
|
||||
return;
|
||||
}
|
||||
auto wantedJavaName = packProfile->getProfile()->getCompatibleJavaName();
|
||||
if (wantedJavaName.isEmpty()) {
|
||||
emit logLine(tr("Your meta informtation is old or doesn't have the information necesary to determine what java should be used. "
|
||||
"Using the default java path."),
|
||||
MessageLevel::Warning);
|
||||
emitSucceeded();
|
||||
return;
|
||||
}
|
||||
QDir javaDir(APPLICATION->javaPath());
|
||||
auto wantedJavaPath = javaDir.absoluteFilePath(wantedJavaName);
|
||||
if (QFileInfo::exists(wantedJavaPath)) {
|
||||
@ -136,7 +150,8 @@ void AutoInstallJava::setJavaPathFromPartial()
|
||||
if (QFileInfo::exists(finalPath)) {
|
||||
setJavaPath(finalPath);
|
||||
} else {
|
||||
emit logLine(tr("No compatible java version was found. Using the default one."), MessageLevel::Warning);
|
||||
emit logLine(tr("No compatible java version was found(the binary file doesn't exists). Using the default one."),
|
||||
MessageLevel::Warning);
|
||||
emitSucceeded();
|
||||
}
|
||||
return;
|
||||
@ -188,6 +203,8 @@ void AutoInstallJava::tryNextMajorJava()
|
||||
auto wantedJavaName = packProfile->getProfile()->getCompatibleJavaName();
|
||||
auto majorJavaVersions = packProfile->getProfile()->getCompatibleJavaMajors();
|
||||
if (m_majorJavaVersionIndex >= majorJavaVersions.length()) {
|
||||
emit logLine(tr("No Java versions found for your operating system: %1 %2").arg(SysInfo::currentSystem(), SysInfo::useQTForArch()),
|
||||
MessageLevel::Warning);
|
||||
emit logLine(tr("No compatible java version was found. Using the default one."), MessageLevel::Warning);
|
||||
emitSucceeded();
|
||||
return;
|
||||
|
@ -72,6 +72,7 @@ class InstallJavaPage : public QWidget, public BasePage {
|
||||
void initialize(Meta::VersionList::Ptr vlist)
|
||||
{
|
||||
vlist->setProvidedRoles({ BaseVersionList::VersionRole, BaseVersionList::RecommendedRole, BaseVersionList::VersionPointerRole });
|
||||
vlist->sort(1);
|
||||
majorVersionSelect->initialize(vlist.get());
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ class PackProfile;
|
||||
class QDialogButtonBox;
|
||||
|
||||
namespace Java {
|
||||
class InstallDialog final : public QDialog, public BasePageProvider {
|
||||
class InstallDialog final : public QDialog, private BasePageProvider {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
@ -66,8 +66,8 @@ JavaPage::JavaPage(QWidget* parent) : QWidget(parent), ui(new Ui::JavaPage)
|
||||
if (BuildConfig.JAVA_DOWNLOADER_ENABLED) {
|
||||
ui->managedJavaList->initialize(new JavaInstallList(this, true));
|
||||
ui->managedJavaList->selectCurrent();
|
||||
ui->managedJavaList->setEmptyString(tr("No java versions are currently available in the meta"));
|
||||
ui->managedJavaList->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
||||
ui->managedJavaList->setEmptyString(tr("No managed java versions are installed"));
|
||||
ui->managedJavaList->setEmptyErrorString(tr("Couldn't load the managed java list!"));
|
||||
connect(ui->autodetectJavaCheckBox, &QCheckBox::stateChanged, this, [this] {
|
||||
ui->autodownloadCheckBox->setEnabled(ui->autodetectJavaCheckBox->isChecked());
|
||||
if (!ui->autodetectJavaCheckBox->isChecked())
|
||||
@ -75,7 +75,6 @@ JavaPage::JavaPage(QWidget* parent) : QWidget(parent), ui(new Ui::JavaPage)
|
||||
});
|
||||
} else {
|
||||
ui->autodownloadCheckBox->setHidden(true);
|
||||
ui->javaDownloadBtn->setHidden(true);
|
||||
ui->tabWidget->tabBar()->hide();
|
||||
}
|
||||
|
||||
|
@ -178,13 +178,6 @@
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="javaDownloadBtn">
|
||||
<property name="text">
|
||||
<string>Download Java</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="javaDetectBtn">
|
||||
<property name="sizePolicy">
|
||||
@ -424,7 +417,6 @@
|
||||
<tabstop>permGenSpinBox</tabstop>
|
||||
<tabstop>javaPathTextBox</tabstop>
|
||||
<tabstop>javaBrowseBtn</tabstop>
|
||||
<tabstop>javaDownloadBtn</tabstop>
|
||||
<tabstop>javaDetectBtn</tabstop>
|
||||
<tabstop>javaTestBtn</tabstop>
|
||||
<tabstop>skipCompatibilityCheckbox</tabstop>
|
||||
|
Loading…
Reference in New Issue
Block a user