2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-02-18 10:36:52 +01:00
|
|
|
|
2010-08-16 18:23:30 +02:00
|
|
|
#include "addlibrarywizard.h"
|
2022-07-28 13:02:49 +02:00
|
|
|
|
2010-08-16 18:23:30 +02:00
|
|
|
#include "librarydetailscontroller.h"
|
2022-09-25 22:42:53 +02:00
|
|
|
#include "qmakeprojectmanagertr.h"
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2022-07-28 13:02:49 +02:00
|
|
|
#include <utils/filepath.h>
|
2012-08-23 15:53:58 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2022-07-28 13:02:49 +02:00
|
|
|
#include <utils/layoutbuilder.h>
|
|
|
|
|
#include <utils/pathchooser.h>
|
2020-06-17 06:35:31 +02:00
|
|
|
#include <utils/stringutils.h>
|
2012-08-23 15:53:58 +02:00
|
|
|
|
2022-07-28 13:02:49 +02:00
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QGroupBox>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QLabel>
|
2022-07-28 13:02:49 +02:00
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QRadioButton>
|
2019-10-22 17:36:32 +02:00
|
|
|
#include <QRadioButton>
|
|
|
|
|
#include <QScrollArea>
|
2016-08-08 15:16:24 +02:00
|
|
|
#include <QTextStream>
|
2020-06-17 06:35:31 +02:00
|
|
|
#include <QVBoxLayout>
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
using namespace Utils;
|
|
|
|
|
|
2022-07-28 13:02:49 +02:00
|
|
|
namespace QmakeProjectManager::Internal {
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2013-09-26 13:01:29 +02:00
|
|
|
const char qt_file_dialog_filter_reg_exp[] =
|
2010-08-16 18:23:30 +02:00
|
|
|
"^(.*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$";
|
|
|
|
|
|
2020-06-23 13:00:43 +02:00
|
|
|
static QStringList qt_clean_filter_list(const QString &filter)
|
2010-08-16 18:23:30 +02:00
|
|
|
{
|
2020-06-23 13:00:43 +02:00
|
|
|
const QRegularExpression regexp(qt_file_dialog_filter_reg_exp);
|
|
|
|
|
const QRegularExpressionMatch match = regexp.match(filter);
|
2010-08-16 18:23:30 +02:00
|
|
|
QString f = filter;
|
2020-06-23 13:00:43 +02:00
|
|
|
if (match.hasMatch())
|
|
|
|
|
f = match.captured(2);
|
2020-07-21 10:19:36 +02:00
|
|
|
return f.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
2023-06-29 08:23:45 +02:00
|
|
|
static FancyLineEdit::AsyncValidationResult validateLibraryPath(const QString &input,
|
|
|
|
|
const QString &promptDialogFilter)
|
2010-08-16 18:23:30 +02:00
|
|
|
{
|
2023-06-29 08:23:45 +02:00
|
|
|
const FilePath filePath = FilePath::fromUserInput(input);
|
2016-08-08 15:16:24 +02:00
|
|
|
if (!filePath.exists())
|
2023-06-29 08:23:45 +02:00
|
|
|
return make_unexpected(Tr::tr("File does not exist."));
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2016-08-08 15:16:24 +02:00
|
|
|
const QString fileName = filePath.fileName();
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2020-06-23 13:00:43 +02:00
|
|
|
QRegularExpression::PatternOption option =
|
2022-09-30 12:42:20 +02:00
|
|
|
HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive
|
2020-06-23 13:00:43 +02:00
|
|
|
? QRegularExpression::CaseInsensitiveOption
|
|
|
|
|
: QRegularExpression::NoPatternOption;
|
|
|
|
|
|
2023-06-29 08:23:45 +02:00
|
|
|
const QStringList filters = qt_clean_filter_list(promptDialogFilter);
|
2020-06-23 13:00:43 +02:00
|
|
|
for (const QString &filter : filters) {
|
|
|
|
|
QString pattern = QRegularExpression::wildcardToRegularExpression(filter);
|
|
|
|
|
QRegularExpression regExp(pattern, option);
|
|
|
|
|
if (regExp.match(fileName).hasMatch())
|
2023-06-29 08:23:45 +02:00
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
return make_unexpected(Tr::tr("File does not match filter."));
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
AddLibraryWizard::AddLibraryWizard(const FilePath &proFile, QWidget *parent)
|
|
|
|
|
: Wizard(parent)
|
|
|
|
|
, m_proFile(proFile)
|
2010-08-16 18:23:30 +02:00
|
|
|
{
|
2022-09-25 22:42:53 +02:00
|
|
|
setWindowTitle(Tr::tr("Add Library"));
|
2010-08-16 18:23:30 +02:00
|
|
|
m_libraryTypePage = new LibraryTypePage(this);
|
2014-05-30 11:38:08 +02:00
|
|
|
addPage(m_libraryTypePage);
|
2010-08-16 18:23:30 +02:00
|
|
|
m_detailsPage = new DetailsPage(this);
|
2014-05-30 11:38:08 +02:00
|
|
|
addPage(m_detailsPage);
|
2010-08-16 18:23:30 +02:00
|
|
|
m_summaryPage = new SummaryPage(this);
|
2014-05-30 11:38:08 +02:00
|
|
|
addPage(m_summaryPage);
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
2018-07-12 23:59:51 +02:00
|
|
|
AddLibraryWizard::~AddLibraryWizard() = default;
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
FilePath AddLibraryWizard::proFile() const
|
2010-08-16 18:23:30 +02:00
|
|
|
{
|
|
|
|
|
return m_proFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AddLibraryWizard::LibraryKind AddLibraryWizard::libraryKind() const
|
|
|
|
|
{
|
|
|
|
|
return m_libraryTypePage->libraryKind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString AddLibraryWizard::snippet() const
|
|
|
|
|
{
|
|
|
|
|
return m_detailsPage->snippet();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////
|
|
|
|
|
|
|
|
|
|
LibraryTypePage::LibraryTypePage(AddLibraryWizard *parent)
|
|
|
|
|
: QWizardPage(parent)
|
|
|
|
|
{
|
2022-09-25 22:42:53 +02:00
|
|
|
setTitle(Tr::tr("Library Type"));
|
|
|
|
|
setSubTitle(Tr::tr("Choose the type of the library to link to"));
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2018-07-12 23:59:51 +02:00
|
|
|
auto *layout = new QVBoxLayout(this);
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
m_internalRadio = new QRadioButton(Tr::tr("Internal library"), this);
|
2010-11-10 12:50:02 +01:00
|
|
|
layout->addWidget(m_internalRadio);
|
2010-09-16 14:39:12 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
QLabel *internalLabel = new QLabel(Tr::tr("Links to a library "
|
|
|
|
|
"that is located in your build "
|
|
|
|
|
"tree.\nAdds the library and "
|
|
|
|
|
"include paths to the .pro file."));
|
2010-09-16 14:39:12 +02:00
|
|
|
|
2010-11-10 12:50:02 +01:00
|
|
|
internalLabel->setWordWrap(true);
|
|
|
|
|
internalLabel->setAttribute(Qt::WA_MacSmallSize, true);
|
|
|
|
|
layout->addWidget(internalLabel);
|
2010-08-16 18:23:30 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
m_externalRadio = new QRadioButton(Tr::tr("External library"), this);
|
2010-08-16 18:23:30 +02:00
|
|
|
layout->addWidget(m_externalRadio);
|
2010-09-16 14:39:12 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
QLabel *externalLabel = new QLabel(Tr::tr("Links to a library "
|
|
|
|
|
"that is not located in your "
|
|
|
|
|
"build tree.\nAdds the library "
|
|
|
|
|
"and include paths to the .pro file."));
|
2010-09-16 14:39:12 +02:00
|
|
|
|
2010-08-16 18:23:30 +02:00
|
|
|
externalLabel->setWordWrap(true);
|
|
|
|
|
externalLabel->setAttribute(Qt::WA_MacSmallSize, true);
|
|
|
|
|
layout->addWidget(externalLabel);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
m_systemRadio = new QRadioButton(Tr::tr("System library"), this);
|
2010-11-10 12:50:02 +01:00
|
|
|
layout->addWidget(m_systemRadio);
|
2010-09-16 14:39:12 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
QLabel *systemLabel = new QLabel(Tr::tr("Links to a system library."
|
|
|
|
|
"\nNeither the path to the "
|
|
|
|
|
"library nor the path to its "
|
|
|
|
|
"includes is added to the .pro file."));
|
2010-09-16 14:39:12 +02:00
|
|
|
|
2010-11-10 12:50:02 +01:00
|
|
|
systemLabel->setWordWrap(true);
|
|
|
|
|
systemLabel->setAttribute(Qt::WA_MacSmallSize, true);
|
|
|
|
|
layout->addWidget(systemLabel);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
m_packageRadio = new QRadioButton(Tr::tr("System package"), this);
|
2010-11-10 12:50:02 +01:00
|
|
|
layout->addWidget(m_packageRadio);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
QLabel *packageLabel = new QLabel(Tr::tr("Links to a system library using pkg-config."));
|
2010-11-10 12:50:02 +01:00
|
|
|
|
|
|
|
|
packageLabel->setWordWrap(true);
|
|
|
|
|
packageLabel->setAttribute(Qt::WA_MacSmallSize, true);
|
|
|
|
|
layout->addWidget(packageLabel);
|
|
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
if (HostOsInfo::isWindowsHost()) {
|
2012-08-23 15:53:58 +02:00
|
|
|
m_packageRadio->setVisible(false);
|
|
|
|
|
packageLabel->setVisible(false);
|
|
|
|
|
}
|
2010-11-10 12:50:02 +01:00
|
|
|
|
|
|
|
|
// select the default
|
|
|
|
|
m_internalRadio->setChecked(true);
|
2014-05-30 11:38:08 +02:00
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Type"));
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AddLibraryWizard::LibraryKind LibraryTypePage::libraryKind() const
|
|
|
|
|
{
|
|
|
|
|
if (m_internalRadio->isChecked())
|
|
|
|
|
return AddLibraryWizard::InternalLibrary;
|
2010-11-10 12:50:02 +01:00
|
|
|
if (m_externalRadio->isChecked())
|
|
|
|
|
return AddLibraryWizard::ExternalLibrary;
|
2010-08-16 18:23:30 +02:00
|
|
|
if (m_systemRadio->isChecked())
|
|
|
|
|
return AddLibraryWizard::SystemLibrary;
|
2010-11-10 12:50:02 +01:00
|
|
|
return AddLibraryWizard::PackageLibrary;
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////
|
|
|
|
|
|
|
|
|
|
DetailsPage::DetailsPage(AddLibraryWizard *parent)
|
2015-06-18 15:14:06 +02:00
|
|
|
: QWizardPage(parent), m_libraryWizard(parent)
|
2010-08-16 18:23:30 +02:00
|
|
|
{
|
2022-07-28 13:02:49 +02:00
|
|
|
m_libraryDetailsWidget = new LibraryDetailsWidget(this);
|
2016-08-08 14:05:09 +02:00
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
PathChooser * const libPathChooser = m_libraryDetailsWidget->libraryPathChooser;
|
2016-08-08 14:05:09 +02:00
|
|
|
libPathChooser->setHistoryCompleter("Qmake.LibDir.History");
|
|
|
|
|
|
2023-06-29 08:23:45 +02:00
|
|
|
const auto pathValidator =
|
|
|
|
|
[libPathChooser](const QString &text) -> FancyLineEdit::AsyncValidationFuture {
|
|
|
|
|
return libPathChooser->defaultValidationFunction()(text).then(
|
|
|
|
|
[pDialogFilter = libPathChooser->promptDialogFilter()](
|
|
|
|
|
const FancyLineEdit::AsyncValidationResult &result) {
|
|
|
|
|
if (!result)
|
|
|
|
|
return result;
|
|
|
|
|
return validateLibraryPath(result.value(), pDialogFilter);
|
|
|
|
|
});
|
2015-02-27 16:58:52 +01:00
|
|
|
};
|
2015-04-28 14:49:56 +02:00
|
|
|
libPathChooser->setValidationFunction(pathValidator);
|
2022-09-30 12:42:20 +02:00
|
|
|
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Details"));
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool DetailsPage::isComplete() const
|
|
|
|
|
{
|
|
|
|
|
if (m_libraryDetailsController)
|
|
|
|
|
return m_libraryDetailsController->isComplete();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString DetailsPage::snippet() const
|
|
|
|
|
{
|
|
|
|
|
if (m_libraryDetailsController)
|
|
|
|
|
return m_libraryDetailsController->snippet();
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DetailsPage::initializePage()
|
|
|
|
|
{
|
|
|
|
|
if (m_libraryDetailsController) {
|
|
|
|
|
delete m_libraryDetailsController;
|
2018-07-12 23:59:51 +02:00
|
|
|
m_libraryDetailsController = nullptr;
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
QString title;
|
|
|
|
|
QString subTitle;
|
|
|
|
|
switch (m_libraryWizard->libraryKind()) {
|
2010-11-10 12:50:02 +01:00
|
|
|
case AddLibraryWizard::InternalLibrary:
|
2022-09-25 22:42:53 +02:00
|
|
|
title = Tr::tr("Internal Library");
|
|
|
|
|
subTitle = Tr::tr("Choose the project file of the library to link to");
|
2010-11-10 12:50:02 +01:00
|
|
|
m_libraryDetailsController = new InternalLibraryDetailsController(
|
2010-08-24 12:47:12 +02:00
|
|
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
2010-08-16 18:23:30 +02:00
|
|
|
break;
|
|
|
|
|
case AddLibraryWizard::ExternalLibrary:
|
2022-09-25 22:42:53 +02:00
|
|
|
title = Tr::tr("External Library");
|
|
|
|
|
subTitle = Tr::tr("Specify the library to link to and the includes path");
|
2010-08-24 12:47:12 +02:00
|
|
|
m_libraryDetailsController = new ExternalLibraryDetailsController(
|
|
|
|
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
2010-08-16 18:23:30 +02:00
|
|
|
break;
|
2010-11-10 12:50:02 +01:00
|
|
|
case AddLibraryWizard::SystemLibrary:
|
2022-09-25 22:42:53 +02:00
|
|
|
title = Tr::tr("System Library");
|
|
|
|
|
subTitle = Tr::tr("Specify the library to link to");
|
2010-11-10 12:50:02 +01:00
|
|
|
m_libraryDetailsController = new SystemLibraryDetailsController(
|
|
|
|
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
|
|
|
|
break;
|
|
|
|
|
case AddLibraryWizard::PackageLibrary:
|
2022-09-25 22:42:53 +02:00
|
|
|
title = Tr::tr("System Package");
|
|
|
|
|
subTitle = Tr::tr("Specify the package to link to");
|
2010-11-10 12:50:02 +01:00
|
|
|
m_libraryDetailsController = new PackageLibraryDetailsController(
|
2010-08-24 12:47:12 +02:00
|
|
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
2010-08-16 18:23:30 +02:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
setTitle(title);
|
|
|
|
|
setSubTitle(subTitle);
|
|
|
|
|
if (m_libraryDetailsController) {
|
2016-05-24 23:21:57 +03:00
|
|
|
connect(m_libraryDetailsController, &LibraryDetailsController::completeChanged,
|
|
|
|
|
this, &QWizardPage::completeChanged);
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////
|
|
|
|
|
|
|
|
|
|
SummaryPage::SummaryPage(AddLibraryWizard *parent)
|
|
|
|
|
: QWizardPage(parent), m_libraryWizard(parent)
|
|
|
|
|
{
|
2022-09-25 22:42:53 +02:00
|
|
|
setTitle(Tr::tr("Summary"));
|
2010-08-16 18:23:30 +02:00
|
|
|
setFinalPage(true);
|
|
|
|
|
|
2018-07-12 23:59:51 +02:00
|
|
|
auto *layout = new QVBoxLayout(this);
|
2019-10-22 17:36:32 +02:00
|
|
|
const auto scrollArea = new QScrollArea;
|
|
|
|
|
const auto snippetWidget = new QWidget;
|
|
|
|
|
const auto snippetLayout = new QVBoxLayout(snippetWidget);
|
2010-08-16 18:23:30 +02:00
|
|
|
m_summaryLabel = new QLabel(this);
|
|
|
|
|
m_snippetLabel = new QLabel(this);
|
2013-10-22 12:46:12 +02:00
|
|
|
m_snippetLabel->setWordWrap(true);
|
2010-08-16 18:23:30 +02:00
|
|
|
layout->addWidget(m_summaryLabel);
|
2019-10-22 17:36:32 +02:00
|
|
|
snippetLayout->addWidget(m_snippetLabel);
|
|
|
|
|
snippetLayout->addStretch(1);
|
|
|
|
|
scrollArea->setWidget(snippetWidget);
|
|
|
|
|
scrollArea->setWidgetResizable(true);
|
|
|
|
|
layout->addWidget(scrollArea);
|
2010-08-16 18:23:30 +02:00
|
|
|
m_summaryLabel->setTextFormat(Qt::RichText);
|
|
|
|
|
m_snippetLabel->setTextFormat(Qt::RichText);
|
|
|
|
|
m_snippetLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
2014-05-30 11:38:08 +02:00
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
|
2010-08-16 18:23:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SummaryPage::initializePage()
|
|
|
|
|
{
|
|
|
|
|
m_snippet = m_libraryWizard->snippet();
|
|
|
|
|
m_summaryLabel->setText(
|
2022-09-25 22:42:53 +02:00
|
|
|
Tr::tr("The following snippet will be added to the<br><b>%1</b> file:")
|
2021-09-30 13:09:18 +02:00
|
|
|
.arg(m_libraryWizard->proFile().fileName()));
|
2010-08-16 18:23:30 +02:00
|
|
|
QString richSnippet;
|
|
|
|
|
{
|
|
|
|
|
QTextStream str(&richSnippet);
|
|
|
|
|
str << "<code>";
|
|
|
|
|
QString text = m_snippet;
|
|
|
|
|
text.replace(QLatin1Char('\n'), QLatin1String("<br>"));
|
2010-11-10 12:50:02 +01:00
|
|
|
text.replace(QLatin1Char(' '), QLatin1String(" "));
|
2010-08-16 18:23:30 +02:00
|
|
|
str << text;
|
|
|
|
|
str << "</code>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_snippetLabel->setText(richSnippet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString SummaryPage::snippet() const
|
|
|
|
|
{
|
|
|
|
|
return m_snippet;
|
|
|
|
|
}
|
2021-09-30 13:09:18 +02:00
|
|
|
|
2022-07-28 13:02:49 +02:00
|
|
|
LibraryDetailsWidget::LibraryDetailsWidget(QWidget *parent)
|
|
|
|
|
{
|
2022-09-30 12:42:20 +02:00
|
|
|
includePathChooser = new PathChooser(parent);
|
2022-07-28 13:02:49 +02:00
|
|
|
packageLineEdit = new QLineEdit(parent);
|
2022-09-30 12:42:20 +02:00
|
|
|
libraryPathChooser = new PathChooser(parent);
|
2022-07-28 13:02:49 +02:00
|
|
|
libraryComboBox = new QComboBox(parent);
|
|
|
|
|
libraryTypeComboBox = new QComboBox(parent);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
platformGroupBox = new QGroupBox(Tr::tr("Platform:"));
|
2022-07-28 13:02:49 +02:00
|
|
|
platformGroupBox->setFlat(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
linkageGroupBox = new QGroupBox(Tr::tr("Linkage:"));
|
2022-07-28 13:02:49 +02:00
|
|
|
linkageGroupBox->setFlat(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
macGroupBox = new QGroupBox(Tr::tr("Mac:"));
|
2022-07-28 13:02:49 +02:00
|
|
|
macGroupBox->setFlat(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
winGroupBox = new QGroupBox(Tr::tr("Windows:"));
|
2022-07-28 13:02:49 +02:00
|
|
|
winGroupBox->setFlat(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
linCheckBox = new QCheckBox(Tr::tr("Linux"));
|
2022-07-28 13:02:49 +02:00
|
|
|
linCheckBox->setChecked(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
macCheckBox = new QCheckBox(Tr::tr("Mac"));
|
2022-07-28 13:02:49 +02:00
|
|
|
macCheckBox->setChecked(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
winCheckBox = new QCheckBox(Tr::tr("Windows"));
|
2022-07-28 13:02:49 +02:00
|
|
|
winCheckBox->setChecked(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
dynamicRadio = new QRadioButton(Tr::tr("Dynamic"), linkageGroupBox);
|
|
|
|
|
staticRadio = new QRadioButton(Tr::tr("Static"), linkageGroupBox);
|
2022-07-28 13:02:49 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
libraryRadio = new QRadioButton(Tr::tr("Library"), macGroupBox);
|
|
|
|
|
frameworkRadio = new QRadioButton(Tr::tr("Framework"), macGroupBox);
|
2022-07-28 13:02:49 +02:00
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
useSubfoldersCheckBox = new QCheckBox(Tr::tr("Library inside \"debug\" or \"release\" subfolder"),
|
2022-07-28 13:02:49 +02:00
|
|
|
winGroupBox);
|
|
|
|
|
useSubfoldersCheckBox->setChecked(true);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
addSuffixCheckBox = new QCheckBox(Tr::tr("Add \"d\" suffix for debug version"), winGroupBox);
|
|
|
|
|
removeSuffixCheckBox = new QCheckBox(Tr::tr("Remove \"d\" suffix for release version"), winGroupBox);
|
2022-07-28 13:02:49 +02:00
|
|
|
|
2022-09-30 12:42:20 +02:00
|
|
|
using namespace Layouting;
|
2022-07-28 13:02:49 +02:00
|
|
|
|
|
|
|
|
Column { linCheckBox, macCheckBox, winCheckBox, st }.attachTo(platformGroupBox);
|
|
|
|
|
|
|
|
|
|
Row { dynamicRadio, staticRadio }.attachTo(linkageGroupBox);
|
|
|
|
|
|
|
|
|
|
Row { libraryRadio, frameworkRadio }.attachTo(macGroupBox);
|
|
|
|
|
|
|
|
|
|
Column { useSubfoldersCheckBox, addSuffixCheckBox, removeSuffixCheckBox }.attachTo(winGroupBox);
|
|
|
|
|
|
2022-09-25 22:42:53 +02:00
|
|
|
libraryLabel = new QLabel(Tr::tr("Library:"));
|
|
|
|
|
libraryFileLabel = new QLabel(Tr::tr("Library file:"));
|
|
|
|
|
libraryTypeLabel = new QLabel(Tr::tr("Library type:"));
|
|
|
|
|
packageLabel = new QLabel(Tr::tr("Package:"));
|
|
|
|
|
includeLabel = new QLabel(Tr::tr("Include path:"));
|
2022-07-28 13:02:49 +02:00
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
Form {
|
|
|
|
|
libraryLabel, libraryComboBox, br,
|
|
|
|
|
libraryTypeLabel, libraryTypeComboBox, br,
|
|
|
|
|
libraryFileLabel, libraryPathChooser, br,
|
|
|
|
|
packageLabel, packageLineEdit, br,
|
|
|
|
|
includeLabel, includePathChooser
|
|
|
|
|
},
|
|
|
|
|
Row {
|
|
|
|
|
platformGroupBox,
|
|
|
|
|
Column {
|
|
|
|
|
linkageGroupBox,
|
|
|
|
|
macGroupBox,
|
|
|
|
|
winGroupBox,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
st
|
|
|
|
|
}.attachTo(parent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // QmakeProjectManager::Internal
|