logic: handle java not found on windows and mac
* implemented java will not be used if it is not found on system * add jni libraries weak linked for Mac * use dlopen for lazy library loading * added java path to preferences
This commit is contained in:
@@ -41,6 +41,11 @@ void QtLocationPicker::paintEvent(QPaintEvent*)
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
}
|
||||
|
||||
void QtLocationPicker::setPlaceholderText(QString text)
|
||||
{
|
||||
m_data->setPlaceholderText(text);
|
||||
}
|
||||
|
||||
QString QtLocationPicker::getText()
|
||||
{
|
||||
return m_data->text();
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
|
||||
virtual void paintEvent(QPaintEvent*) override;
|
||||
|
||||
void setPlaceholderText(QString text);
|
||||
QString getText();
|
||||
void setText(QString text);
|
||||
void clearText();
|
||||
|
||||
@@ -133,6 +133,32 @@ void QtProjectWizzardContentPreferences::populateForm(QGridLayout* layout, int&
|
||||
);
|
||||
|
||||
row++;
|
||||
|
||||
layout->setRowMinimumHeight(row++, 20);
|
||||
|
||||
// Java
|
||||
layout->addWidget(createFormTitle("JAVA"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignLeft);
|
||||
row++;
|
||||
|
||||
// java path
|
||||
m_javaPath = new QtLocationPicker(this);
|
||||
m_javaPath->setPickDirectory(true);
|
||||
m_javaPath->setPlaceholderText("<jdk_root>");
|
||||
|
||||
layout->addWidget(createFormLabel("Java Path"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_javaPath, row, QtProjectWizzardWindow::BACK_COL);
|
||||
|
||||
addHelpButton(
|
||||
"Location of your java installation so that dynamic libraries of JVM can be found."
|
||||
, layout, row
|
||||
);
|
||||
row++;
|
||||
|
||||
layout->setRowMinimumHeight(row++, 20);
|
||||
|
||||
// C/C++
|
||||
layout->addWidget(createFormTitle("C/C++"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignLeft);
|
||||
row++;
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentPreferences::load()
|
||||
@@ -159,6 +185,11 @@ void QtProjectWizzardContentPreferences::load()
|
||||
|
||||
m_threads->setCurrentIndex(appSettings->getIndexerThreadCount() - 1);
|
||||
m_fatalErrors->setChecked(appSettings->getShowExternalNonFatalErrors());
|
||||
|
||||
if (m_javaPath)
|
||||
{
|
||||
m_javaPath->setText(QString::fromStdString(appSettings->getJavaPath()));
|
||||
}
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentPreferences::save()
|
||||
@@ -181,6 +212,11 @@ void QtProjectWizzardContentPreferences::save()
|
||||
|
||||
appSettings->setIndexerThreadCount(m_threads->currentIndex() + 1);
|
||||
appSettings->setShowExternalNonFatalErrors(m_fatalErrors->isChecked());
|
||||
|
||||
if (m_javaPath)
|
||||
{
|
||||
appSettings->setJavaPath(m_javaPath->getText().toStdString());
|
||||
}
|
||||
}
|
||||
|
||||
bool QtProjectWizzardContentPreferences::check()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "qt/element/QtLocationPicker.h"
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContent.h"
|
||||
|
||||
class QtProjectWizzardContentPreferences
|
||||
@@ -31,14 +32,16 @@ private:
|
||||
QLineEdit* m_fontFace;
|
||||
QComboBox* m_fontSize;
|
||||
QComboBox* m_tabWidth;
|
||||
|
||||
QComboBox* m_colorSchemes;
|
||||
QLineEdit* m_scrollSpeed;
|
||||
std::vector<FilePath> m_colorSchemePaths;
|
||||
int m_oldColorSchemeIndex;
|
||||
|
||||
QComboBox* m_threads;
|
||||
QCheckBox* m_fatalErrors;
|
||||
|
||||
std::vector<FilePath> m_colorSchemePaths;
|
||||
int m_oldColorSchemeIndex;
|
||||
QtLocationPicker* m_javaPath;
|
||||
};
|
||||
|
||||
#endif // QT_PROJECT_WIZZARD_CONTENT_PREFERENCES_H
|
||||
|
||||
Reference in New Issue
Block a user