forked from qt-creator/qt-creator
Fix AddLibraryWizard when developing on Windows for Maemo build
Task-number: QTCREATORBUG-125
This commit is contained in:
@@ -196,17 +196,20 @@ void DetailsPage::initializePage()
|
|||||||
case AddLibraryWizard::SystemLibrary:
|
case AddLibraryWizard::SystemLibrary:
|
||||||
title = tr("System Library");
|
title = tr("System Library");
|
||||||
subTitle = tr("Specify the library which you want to link against");
|
subTitle = tr("Specify the library which you want to link against");
|
||||||
m_libraryDetailsController = new SystemLibraryDetailsController(m_libraryDetailsWidget, this);
|
m_libraryDetailsController = new SystemLibraryDetailsController(
|
||||||
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
||||||
break;
|
break;
|
||||||
case AddLibraryWizard::ExternalLibrary:
|
case AddLibraryWizard::ExternalLibrary:
|
||||||
title = tr("External Library");
|
title = tr("External Library");
|
||||||
subTitle = tr("Specify the library which you want to link against and the includes path");
|
subTitle = tr("Specify the library which you want to link against and the includes path");
|
||||||
m_libraryDetailsController = new ExternalLibraryDetailsController(m_libraryDetailsWidget, this);
|
m_libraryDetailsController = new ExternalLibraryDetailsController(
|
||||||
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
||||||
break;
|
break;
|
||||||
case AddLibraryWizard::InternalLibrary:
|
case AddLibraryWizard::InternalLibrary:
|
||||||
title = tr("Internal Library");
|
title = tr("Internal Library");
|
||||||
subTitle = tr("Choose the project file of the library which you want to link against");
|
subTitle = tr("Choose the project file of the library which you want to link against");
|
||||||
m_libraryDetailsController = new InternalLibraryDetailsController(m_libraryDetailsWidget, this);
|
m_libraryDetailsController = new InternalLibraryDetailsController(
|
||||||
|
m_libraryDetailsWidget, m_libraryWizard->proFile(), this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -214,7 +217,6 @@ void DetailsPage::initializePage()
|
|||||||
setTitle(title);
|
setTitle(title);
|
||||||
setSubTitle(subTitle);
|
setSubTitle(subTitle);
|
||||||
if (m_libraryDetailsController) {
|
if (m_libraryDetailsController) {
|
||||||
m_libraryDetailsController->setProFile(m_libraryWizard->proFile());
|
|
||||||
connect(m_libraryDetailsController, SIGNAL(completeChanged()),
|
connect(m_libraryDetailsController, SIGNAL(completeChanged()),
|
||||||
this, SIGNAL(completeChanged()));
|
this, SIGNAL(completeChanged()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "ui_librarydetailswidget.h"
|
#include "ui_librarydetailswidget.h"
|
||||||
#include "findqt4profiles.h"
|
#include "findqt4profiles.h"
|
||||||
#include "qt4nodes.h"
|
#include "qt4nodes.h"
|
||||||
|
#include "qt4buildconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
@@ -16,7 +17,8 @@ using namespace Qt4ProjectManager;
|
|||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
|
||||||
LibraryDetailsController::LibraryDetailsController(
|
LibraryDetailsController::LibraryDetailsController(
|
||||||
Ui::LibraryDetailsWidget *libraryDetails, QObject *parent) :
|
Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
|
const QString &proFile, QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_platforms(AddLibraryWizard::LinuxPlatform
|
m_platforms(AddLibraryWizard::LinuxPlatform
|
||||||
| AddLibraryWizard::MacPlatform
|
| AddLibraryWizard::MacPlatform
|
||||||
@@ -24,6 +26,7 @@ LibraryDetailsController::LibraryDetailsController(
|
|||||||
| AddLibraryWizard::SymbianPlatform),
|
| AddLibraryWizard::SymbianPlatform),
|
||||||
m_linkageType(AddLibraryWizard::NoLinkage),
|
m_linkageType(AddLibraryWizard::NoLinkage),
|
||||||
m_macLibraryType(AddLibraryWizard::NoLibraryType),
|
m_macLibraryType(AddLibraryWizard::NoLibraryType),
|
||||||
|
m_proFile(proFile),
|
||||||
m_ignoreGuiSignals(false),
|
m_ignoreGuiSignals(false),
|
||||||
m_includePathChanged(false),
|
m_includePathChanged(false),
|
||||||
m_linkageRadiosVisible(true),
|
m_linkageRadiosVisible(true),
|
||||||
@@ -33,12 +36,28 @@ LibraryDetailsController::LibraryDetailsController(
|
|||||||
m_libraryDetailsWidget(libraryDetails)
|
m_libraryDetailsWidget(libraryDetails)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
setMacLibraryRadiosVisible(false);
|
m_creatorPlatform = CreatorMac;
|
||||||
|
#endif
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
m_creatorPlatform = CreatorLinux;
|
||||||
|
#endif
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
m_creatorPlatform = CreatorWindows;
|
||||||
|
|
||||||
|
// project for which we are going to insert the snippet
|
||||||
|
const ProjectExplorer::Project *project =
|
||||||
|
ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projectForFile(proFile);
|
||||||
|
Qt4BuildConfiguration *qt4BuildConfiguration =
|
||||||
|
qobject_cast<Qt4BuildConfiguration *>(project->activeTarget()->activeBuildConfiguration());
|
||||||
|
if (qt4BuildConfiguration && qt4BuildConfiguration->toolChainType() == ProjectExplorer::ToolChain::GCC_MAEMO)
|
||||||
|
m_creatorPlatform = CreatorLinux;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
if (creatorPlatform() == CreatorMac)
|
||||||
setLinkageRadiosVisible(false);
|
setMacLibraryRadiosVisible(false);
|
||||||
#endif
|
|
||||||
|
if (creatorPlatform() != CreatorWindows)
|
||||||
|
setLinkageRadiosVisible(false);
|
||||||
|
|
||||||
connect(m_libraryDetailsWidget->includePathChooser, SIGNAL(changed(QString)),
|
connect(m_libraryDetailsWidget->includePathChooser, SIGNAL(changed(QString)),
|
||||||
this, SLOT(slotIncludePathChanged()));
|
this, SLOT(slotIncludePathChanged()));
|
||||||
@@ -60,13 +79,9 @@ LibraryDetailsController::LibraryDetailsController(
|
|||||||
this, SLOT(slotPlatformChanged()));
|
this, SLOT(slotPlatformChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibraryDetailsController::setProFile(const QString &proFile)
|
LibraryDetailsController::CreatorPlatform LibraryDetailsController::creatorPlatform() const
|
||||||
{
|
{
|
||||||
m_proFile = proFile;
|
return m_creatorPlatform;
|
||||||
proFileChanged();
|
|
||||||
updateGui();
|
|
||||||
|
|
||||||
emit completeChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::LibraryDetailsWidget *LibraryDetailsController::libraryDetailsWidget() const
|
Ui::LibraryDetailsWidget *LibraryDetailsController::libraryDetailsWidget() const
|
||||||
@@ -491,35 +506,35 @@ static QString generatePreTargetDepsSnippet(AddLibraryWizard::Platforms platform
|
|||||||
}
|
}
|
||||||
|
|
||||||
NonInternalLibraryDetailsController::NonInternalLibraryDetailsController(
|
NonInternalLibraryDetailsController::NonInternalLibraryDetailsController(
|
||||||
Ui::LibraryDetailsWidget *libraryDetails, QObject *parent) :
|
Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
LibraryDetailsController(libraryDetails, parent)
|
const QString &proFile, QObject *parent) :
|
||||||
|
LibraryDetailsController(libraryDetails, proFile, parent)
|
||||||
{
|
{
|
||||||
setLibraryComboBoxVisible(false);
|
setLibraryComboBoxVisible(false);
|
||||||
setLibraryPathChooserVisible(true);
|
setLibraryPathChooserVisible(true);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
if (creatorPlatform() == CreatorWindows) {
|
||||||
libraryDetailsWidget()->libraryPathChooser->setPromptDialogFilter(
|
libraryDetailsWidget()->libraryPathChooser->setPromptDialogFilter(
|
||||||
QLatin1String("Library file (*.lib)"));
|
QLatin1String("Library file (*.lib)"));
|
||||||
setLinkageRadiosVisible(true);
|
setLinkageRadiosVisible(true);
|
||||||
setRemoveSuffixVisible(true);
|
setRemoveSuffixVisible(true);
|
||||||
#else
|
} else {
|
||||||
setLinkageRadiosVisible(false);
|
setLinkageRadiosVisible(false);
|
||||||
setRemoveSuffixVisible(false);
|
setRemoveSuffixVisible(false);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
if (creatorPlatform() == CreatorLinux)
|
||||||
libraryDetailsWidget()->libraryPathChooser->setPromptDialogFilter(
|
libraryDetailsWidget()->libraryPathChooser->setPromptDialogFilter(
|
||||||
QLatin1String("Library file (lib*.so lib*.a)"));
|
QLatin1String("Library file (lib*.so lib*.a)"));
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
if (creatorPlatform() == CreatorMac) {
|
||||||
libraryDetailsWidget()->libraryPathChooser->setPromptDialogFilter(
|
libraryDetailsWidget()->libraryPathChooser->setPromptDialogFilter(
|
||||||
QLatin1String("Library file (*.dylib *.a *.framework)"));
|
QLatin1String("Library file (*.dylib *.a *.framework)"));
|
||||||
// QLatin1String("Library file (lib*.dylib lib*.a *.framework)"));
|
// QLatin1String("Library file (lib*.dylib lib*.a *.framework)"));
|
||||||
libraryDetailsWidget()->libraryPathChooser->setExpectedKind(Utils::PathChooser::Any);
|
libraryDetailsWidget()->libraryPathChooser->setExpectedKind(Utils::PathChooser::Any);
|
||||||
#else
|
} else {
|
||||||
libraryDetailsWidget()->libraryPathChooser->setExpectedKind(Utils::PathChooser::File);
|
libraryDetailsWidget()->libraryPathChooser->setExpectedKind(Utils::PathChooser::File);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
connect(libraryDetailsWidget()->libraryPathChooser, SIGNAL(validChanged()),
|
connect(libraryDetailsWidget()->libraryPathChooser, SIGNAL(validChanged()),
|
||||||
this, SIGNAL(completeChanged()));
|
this, SIGNAL(completeChanged()));
|
||||||
@@ -536,30 +551,30 @@ NonInternalLibraryDetailsController::NonInternalLibraryDetailsController(
|
|||||||
AddLibraryWizard::LinkageType NonInternalLibraryDetailsController::suggestedLinkageType() const
|
AddLibraryWizard::LinkageType NonInternalLibraryDetailsController::suggestedLinkageType() const
|
||||||
{
|
{
|
||||||
AddLibraryWizard::LinkageType type = AddLibraryWizard::NoLinkage;
|
AddLibraryWizard::LinkageType type = AddLibraryWizard::NoLinkage;
|
||||||
#ifndef Q_OS_WIN
|
if (creatorPlatform() != CreatorWindows) {
|
||||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||||
if (fi.suffix() == QLatin1String("a"))
|
if (fi.suffix() == QLatin1String("a"))
|
||||||
type = AddLibraryWizard::StaticLinkage;
|
type = AddLibraryWizard::StaticLinkage;
|
||||||
else
|
else
|
||||||
type = AddLibraryWizard::DynamicLinkage;
|
type = AddLibraryWizard::DynamicLinkage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLibraryWizard::MacLibraryType NonInternalLibraryDetailsController::suggestedMacLibraryType() const
|
AddLibraryWizard::MacLibraryType NonInternalLibraryDetailsController::suggestedMacLibraryType() const
|
||||||
{
|
{
|
||||||
AddLibraryWizard::MacLibraryType type = AddLibraryWizard::NoLibraryType;
|
AddLibraryWizard::MacLibraryType type = AddLibraryWizard::NoLibraryType;
|
||||||
#ifdef Q_OS_MAC
|
if (creatorPlatform() == CreatorMac) {
|
||||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||||
if (fi.suffix() == QLatin1String("framework"))
|
if (fi.suffix() == QLatin1String("framework"))
|
||||||
type = AddLibraryWizard::FrameworkType;
|
type = AddLibraryWizard::FrameworkType;
|
||||||
else
|
else
|
||||||
type = AddLibraryWizard::LibraryType;
|
type = AddLibraryWizard::LibraryType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,10 +600,10 @@ QString NonInternalLibraryDetailsController::suggestedIncludePath() const
|
|||||||
void NonInternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
void NonInternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
||||||
{
|
{
|
||||||
bool ena = platforms() & AddLibraryWizard::WindowsPlatform;
|
bool ena = platforms() & AddLibraryWizard::WindowsPlatform;
|
||||||
#ifdef Q_OS_WIN
|
if (creatorPlatform() == CreatorWindows) {
|
||||||
libraryDetailsWidget()->addSuffixCheckBox->setEnabled(ena);
|
libraryDetailsWidget()->addSuffixCheckBox->setEnabled(ena);
|
||||||
ena = true;
|
ena = true;
|
||||||
#endif
|
}
|
||||||
libraryDetailsWidget()->winGroupBox->setEnabled(ena);
|
libraryDetailsWidget()->winGroupBox->setEnabled(ena);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,29 +632,29 @@ void NonInternalLibraryDetailsController::slotRemoveSuffixChanged(bool ena)
|
|||||||
|
|
||||||
void NonInternalLibraryDetailsController::slotLibraryPathChanged()
|
void NonInternalLibraryDetailsController::slotLibraryPathChanged()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
if (creatorPlatform() == CreatorWindows) {
|
||||||
bool subfoldersEnabled = true;
|
bool subfoldersEnabled = true;
|
||||||
bool removeSuffixEnabled = true;
|
bool removeSuffixEnabled = true;
|
||||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||||
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
QFileInfo fi(libraryDetailsWidget()->libraryPathChooser->path());
|
||||||
QFileInfo dfi(fi.absolutePath());
|
QFileInfo dfi(fi.absolutePath());
|
||||||
const QString parentFolderName = dfi.fileName().toLower();
|
const QString parentFolderName = dfi.fileName().toLower();
|
||||||
if (parentFolderName != QLatin1String("debug") &&
|
if (parentFolderName != QLatin1String("debug") &&
|
||||||
parentFolderName != QLatin1String("release"))
|
parentFolderName != QLatin1String("release"))
|
||||||
subfoldersEnabled = false;
|
subfoldersEnabled = false;
|
||||||
const QString baseName = fi.baseName();
|
const QString baseName = fi.baseName();
|
||||||
|
|
||||||
if (baseName.isEmpty() || baseName.at(baseName.size() - 1).toLower() != QLatin1Char('d'))
|
if (baseName.isEmpty() || baseName.at(baseName.size() - 1).toLower() != QLatin1Char('d'))
|
||||||
removeSuffixEnabled = false;
|
removeSuffixEnabled = false;
|
||||||
|
|
||||||
if (subfoldersEnabled)
|
if (subfoldersEnabled)
|
||||||
libraryDetailsWidget()->useSubfoldersCheckBox->setChecked(true);
|
libraryDetailsWidget()->useSubfoldersCheckBox->setChecked(true);
|
||||||
else if (removeSuffixEnabled)
|
else if (removeSuffixEnabled)
|
||||||
libraryDetailsWidget()->removeSuffixCheckBox->setChecked(true);
|
libraryDetailsWidget()->removeSuffixCheckBox->setChecked(true);
|
||||||
else
|
else
|
||||||
libraryDetailsWidget()->addSuffixCheckBox->setChecked(true);
|
libraryDetailsWidget()->addSuffixCheckBox->setChecked(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
updateGui();
|
updateGui();
|
||||||
|
|
||||||
@@ -659,29 +674,28 @@ QString NonInternalLibraryDetailsController::snippet() const
|
|||||||
QString libName;
|
QString libName;
|
||||||
const bool removeSuffix = isWindowsGroupVisible()
|
const bool removeSuffix = isWindowsGroupVisible()
|
||||||
&& libraryDetailsWidget()->removeSuffixCheckBox->isChecked();
|
&& libraryDetailsWidget()->removeSuffixCheckBox->isChecked();
|
||||||
#if defined (Q_OS_WIN)
|
if (creatorPlatform() == CreatorWindows) {
|
||||||
libName = fi.baseName();
|
|
||||||
if (removeSuffix && !libName.isEmpty()) // remove last letter which needs to be "d"
|
|
||||||
libName = libName.left(libName.size() - 1);
|
|
||||||
#elif defined (Q_OS_MAC)
|
|
||||||
if (macLibraryType() == AddLibraryWizard::FrameworkType)
|
|
||||||
libName = fi.baseName();
|
libName = fi.baseName();
|
||||||
else
|
if (removeSuffix && !libName.isEmpty()) // remove last letter which needs to be "d"
|
||||||
|
libName = libName.left(libName.size() - 1);
|
||||||
|
} else if (creatorPlatform() == CreatorMac) {
|
||||||
|
if (macLibraryType() == AddLibraryWizard::FrameworkType)
|
||||||
|
libName = fi.baseName();
|
||||||
|
else
|
||||||
|
libName = fi.baseName().mid(3); // cut the "lib" prefix
|
||||||
|
} else {
|
||||||
libName = fi.baseName().mid(3); // cut the "lib" prefix
|
libName = fi.baseName().mid(3); // cut the "lib" prefix
|
||||||
#else
|
}
|
||||||
libName = fi.baseName().mid(3); // cut the "lib" prefix
|
|
||||||
#endif
|
|
||||||
QString targetRelativePath;
|
QString targetRelativePath;
|
||||||
QString includeRelativePath;
|
QString includeRelativePath;
|
||||||
bool useSubfolders = false;
|
bool useSubfolders = false;
|
||||||
bool addSuffix = false;
|
bool addSuffix = false;
|
||||||
if (isWindowsGroupVisible()) {
|
if (isWindowsGroupVisible()) {
|
||||||
const bool useSubfoldersCondition =
|
// when we are on Win but we don't generate the code for Win
|
||||||
#ifdef Q_OS_WIN
|
// we still need to remove "debug" or "release" subfolder
|
||||||
true; // we are on Win but we in case don't generate the code for Win we still need to remove "debug" or "release" subfolder
|
const bool useSubfoldersCondition = (creatorPlatform() == CreatorWindows)
|
||||||
#else
|
? true : platforms() & AddLibraryWizard::WindowsPlatform;
|
||||||
platforms() & AddLibraryWizard::WindowsPlatform;
|
|
||||||
#endif
|
|
||||||
if (useSubfoldersCondition)
|
if (useSubfoldersCondition)
|
||||||
useSubfolders = libraryDetailsWidget()->useSubfoldersCheckBox->isChecked();
|
useSubfolders = libraryDetailsWidget()->useSubfoldersCheckBox->isChecked();
|
||||||
if (platforms() & AddLibraryWizard::WindowsPlatform)
|
if (platforms() & AddLibraryWizard::WindowsPlatform)
|
||||||
@@ -691,12 +705,10 @@ QString NonInternalLibraryDetailsController::snippet() const
|
|||||||
QFileInfo pfi(proFile());
|
QFileInfo pfi(proFile());
|
||||||
QDir pdir = pfi.absoluteDir();
|
QDir pdir = pfi.absoluteDir();
|
||||||
QString absoluteLibraryPath = fi.absolutePath();
|
QString absoluteLibraryPath = fi.absolutePath();
|
||||||
#if defined (Q_OS_WIN)
|
if (creatorPlatform() == CreatorWindows && useSubfolders) { // drop last subfolder which needs to be "debug" or "release"
|
||||||
if (useSubfolders) { // drop last subfolder which needs to be "debug" or "release"
|
|
||||||
QFileInfo libfi(absoluteLibraryPath);
|
QFileInfo libfi(absoluteLibraryPath);
|
||||||
absoluteLibraryPath = libfi.absolutePath();
|
absoluteLibraryPath = libfi.absolutePath();
|
||||||
}
|
}
|
||||||
#endif // Q_OS_WIN
|
|
||||||
targetRelativePath = appendSeparator(pdir.relativeFilePath(absoluteLibraryPath));
|
targetRelativePath = appendSeparator(pdir.relativeFilePath(absoluteLibraryPath));
|
||||||
|
|
||||||
const QString includePath = libraryDetailsWidget()->includePathChooser->path();
|
const QString includePath = libraryDetailsWidget()->includePathChooser->path();
|
||||||
@@ -722,27 +734,36 @@ QString NonInternalLibraryDetailsController::snippet() const
|
|||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
SystemLibraryDetailsController::SystemLibraryDetailsController(
|
SystemLibraryDetailsController::SystemLibraryDetailsController(
|
||||||
Ui::LibraryDetailsWidget *libraryDetails, QObject *parent)
|
Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
: NonInternalLibraryDetailsController(libraryDetails, parent)
|
const QString &proFile, QObject *parent)
|
||||||
|
: NonInternalLibraryDetailsController(libraryDetails, proFile, parent)
|
||||||
{
|
{
|
||||||
setIncludePathVisible(false);
|
setIncludePathVisible(false);
|
||||||
setWindowsGroupVisible(false);
|
setWindowsGroupVisible(false);
|
||||||
|
|
||||||
|
updateGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
ExternalLibraryDetailsController::ExternalLibraryDetailsController(
|
ExternalLibraryDetailsController::ExternalLibraryDetailsController(
|
||||||
Ui::LibraryDetailsWidget *libraryDetails, QObject *parent)
|
Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
: NonInternalLibraryDetailsController(libraryDetails, parent)
|
const QString &proFile, QObject *parent)
|
||||||
|
: NonInternalLibraryDetailsController(libraryDetails, proFile, parent)
|
||||||
{
|
{
|
||||||
setIncludePathVisible(true);
|
setIncludePathVisible(true);
|
||||||
setWindowsGroupVisible(true);
|
setWindowsGroupVisible(true);
|
||||||
|
|
||||||
|
updateGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
void ExternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
||||||
{
|
{
|
||||||
NonInternalLibraryDetailsController::updateWindowsOptionsEnablement();
|
NonInternalLibraryDetailsController::updateWindowsOptionsEnablement();
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
|
if (creatorPlatform() != CreatorWindows)
|
||||||
|
return;
|
||||||
|
|
||||||
bool subfoldersEnabled = true;
|
bool subfoldersEnabled = true;
|
||||||
bool removeSuffixEnabled = true;
|
bool removeSuffixEnabled = true;
|
||||||
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
if (libraryDetailsWidget()->libraryPathChooser->isValid()) {
|
||||||
@@ -760,14 +781,14 @@ void ExternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
|||||||
}
|
}
|
||||||
libraryDetailsWidget()->useSubfoldersCheckBox->setEnabled(subfoldersEnabled);
|
libraryDetailsWidget()->useSubfoldersCheckBox->setEnabled(subfoldersEnabled);
|
||||||
libraryDetailsWidget()->removeSuffixCheckBox->setEnabled(removeSuffixEnabled);
|
libraryDetailsWidget()->removeSuffixCheckBox->setEnabled(removeSuffixEnabled);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
InternalLibraryDetailsController::InternalLibraryDetailsController(
|
InternalLibraryDetailsController::InternalLibraryDetailsController(
|
||||||
Ui::LibraryDetailsWidget *libraryDetails, QObject *parent)
|
Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
: LibraryDetailsController(libraryDetails, parent)
|
const QString &proFile, QObject *parent)
|
||||||
|
: LibraryDetailsController(libraryDetails, proFile, parent)
|
||||||
{
|
{
|
||||||
setLinkageRadiosVisible(false);
|
setLinkageRadiosVisible(false);
|
||||||
setLibraryPathChooserVisible(false);
|
setLibraryPathChooserVisible(false);
|
||||||
@@ -776,12 +797,14 @@ InternalLibraryDetailsController::InternalLibraryDetailsController(
|
|||||||
setWindowsGroupVisible(true);
|
setWindowsGroupVisible(true);
|
||||||
setRemoveSuffixVisible(false);
|
setRemoveSuffixVisible(false);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
if (creatorPlatform() == CreatorWindows)
|
||||||
libraryDetailsWidget()->useSubfoldersCheckBox->setEnabled(true);
|
libraryDetailsWidget()->useSubfoldersCheckBox->setEnabled(true);
|
||||||
#endif
|
|
||||||
|
|
||||||
connect(libraryDetailsWidget()->libraryComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(libraryDetailsWidget()->libraryComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
this, SLOT(slotCurrentLibraryChanged()));
|
this, SLOT(slotCurrentLibraryChanged()));
|
||||||
|
|
||||||
|
updateProFile();
|
||||||
|
updateGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLibraryWizard::LinkageType InternalLibraryDetailsController::suggestedLinkageType() const
|
AddLibraryWizard::LinkageType InternalLibraryDetailsController::suggestedLinkageType() const
|
||||||
@@ -829,14 +852,13 @@ QString InternalLibraryDetailsController::suggestedIncludePath() const
|
|||||||
|
|
||||||
void InternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
void InternalLibraryDetailsController::updateWindowsOptionsEnablement()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
if (creatorPlatform() == CreatorWindows)
|
||||||
libraryDetailsWidget()->addSuffixCheckBox->setEnabled(true);
|
libraryDetailsWidget()->addSuffixCheckBox->setEnabled(true);
|
||||||
#endif
|
|
||||||
libraryDetailsWidget()->winGroupBox->setEnabled(platforms()
|
libraryDetailsWidget()->winGroupBox->setEnabled(platforms()
|
||||||
& AddLibraryWizard::WindowsPlatform);
|
& AddLibraryWizard::WindowsPlatform);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InternalLibraryDetailsController::proFileChanged()
|
void InternalLibraryDetailsController::updateProFile()
|
||||||
{
|
{
|
||||||
m_rootProjectPath.clear();
|
m_rootProjectPath.clear();
|
||||||
m_proFileNodes.clear();
|
m_proFileNodes.clear();
|
||||||
@@ -884,14 +906,14 @@ void InternalLibraryDetailsController::slotCurrentLibraryChanged()
|
|||||||
currentIndex, Qt::ToolTipRole).toString());
|
currentIndex, Qt::ToolTipRole).toString());
|
||||||
Qt4ProFileNode *proFileNode = m_proFileNodes.at(currentIndex);
|
Qt4ProFileNode *proFileNode = m_proFileNodes.at(currentIndex);
|
||||||
const QStringList configVar = proFileNode->variableValue(ConfigVar);
|
const QStringList configVar = proFileNode->variableValue(ConfigVar);
|
||||||
#ifdef Q_OS_WIN
|
if (creatorPlatform() == CreatorWindows) {
|
||||||
bool useSubfolders = false;
|
bool useSubfolders = false;
|
||||||
if (configVar.contains(QLatin1String("debug_and_release"))
|
if (configVar.contains(QLatin1String("debug_and_release"))
|
||||||
&& configVar.contains(QLatin1String("debug_and_release_target")))
|
&& configVar.contains(QLatin1String("debug_and_release_target")))
|
||||||
useSubfolders = true;
|
useSubfolders = true;
|
||||||
libraryDetailsWidget()->useSubfoldersCheckBox->setChecked(useSubfolders);
|
libraryDetailsWidget()->useSubfoldersCheckBox->setChecked(useSubfolders);
|
||||||
libraryDetailsWidget()->addSuffixCheckBox->setChecked(!useSubfolders);
|
libraryDetailsWidget()->addSuffixCheckBox->setChecked(!useSubfolders);
|
||||||
#endif // Q_OS_WIN
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guiSignalsIgnored())
|
if (guiSignalsIgnored())
|
||||||
|
|||||||
@@ -18,14 +18,22 @@ class LibraryDetailsController : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit LibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
explicit LibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
|
const QString &proFile,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
virtual bool isComplete() const = 0;
|
virtual bool isComplete() const = 0;
|
||||||
void setProFile(const QString &proFile);
|
|
||||||
virtual QString snippet() const = 0;
|
virtual QString snippet() const = 0;
|
||||||
signals:
|
signals:
|
||||||
void completeChanged();
|
void completeChanged();
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
enum CreatorPlatform {
|
||||||
|
CreatorLinux,
|
||||||
|
CreatorMac,
|
||||||
|
CreatorWindows
|
||||||
|
};
|
||||||
|
|
||||||
|
CreatorPlatform creatorPlatform() const;
|
||||||
|
|
||||||
Ui::LibraryDetailsWidget *libraryDetailsWidget() const;
|
Ui::LibraryDetailsWidget *libraryDetailsWidget() const;
|
||||||
|
|
||||||
AddLibraryWizard::Platforms platforms() const;
|
AddLibraryWizard::Platforms platforms() const;
|
||||||
@@ -35,8 +43,6 @@ protected:
|
|||||||
bool isIncludePathChanged() const;
|
bool isIncludePathChanged() const;
|
||||||
bool guiSignalsIgnored() const;
|
bool guiSignalsIgnored() const;
|
||||||
|
|
||||||
virtual void proFileChanged() {}
|
|
||||||
|
|
||||||
void updateGui();
|
void updateGui();
|
||||||
virtual AddLibraryWizard::LinkageType suggestedLinkageType() const = 0;
|
virtual AddLibraryWizard::LinkageType suggestedLinkageType() const = 0;
|
||||||
virtual AddLibraryWizard::MacLibraryType suggestedMacLibraryType() const = 0;
|
virtual AddLibraryWizard::MacLibraryType suggestedMacLibraryType() const = 0;
|
||||||
@@ -74,6 +80,8 @@ private:
|
|||||||
|
|
||||||
QString m_proFile;
|
QString m_proFile;
|
||||||
|
|
||||||
|
CreatorPlatform m_creatorPlatform;
|
||||||
|
|
||||||
bool m_ignoreGuiSignals;
|
bool m_ignoreGuiSignals;
|
||||||
bool m_includePathChanged;
|
bool m_includePathChanged;
|
||||||
|
|
||||||
@@ -90,6 +98,7 @@ class NonInternalLibraryDetailsController : public LibraryDetailsController
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit NonInternalLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
explicit NonInternalLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
|
const QString &proFile,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
virtual bool isComplete() const;
|
virtual bool isComplete() const;
|
||||||
virtual QString snippet() const;
|
virtual QString snippet() const;
|
||||||
@@ -109,7 +118,8 @@ class SystemLibraryDetailsController : public NonInternalLibraryDetailsControlle
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SystemLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
explicit SystemLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
QObject *parent = 0);
|
const QString &proFile,
|
||||||
|
QObject *parent = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExternalLibraryDetailsController : public NonInternalLibraryDetailsController
|
class ExternalLibraryDetailsController : public NonInternalLibraryDetailsController
|
||||||
@@ -117,7 +127,8 @@ class ExternalLibraryDetailsController : public NonInternalLibraryDetailsControl
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ExternalLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
explicit ExternalLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
QObject *parent = 0);
|
const QString &proFile,
|
||||||
|
QObject *parent = 0);
|
||||||
protected:
|
protected:
|
||||||
virtual void updateWindowsOptionsEnablement();
|
virtual void updateWindowsOptionsEnablement();
|
||||||
};
|
};
|
||||||
@@ -127,7 +138,8 @@ class InternalLibraryDetailsController : public LibraryDetailsController
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit InternalLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
explicit InternalLibraryDetailsController(Ui::LibraryDetailsWidget *libraryDetails,
|
||||||
QObject *parent = 0);
|
const QString &proFile,
|
||||||
|
QObject *parent = 0);
|
||||||
virtual bool isComplete() const;
|
virtual bool isComplete() const;
|
||||||
virtual QString snippet() const;
|
virtual QString snippet() const;
|
||||||
protected:
|
protected:
|
||||||
@@ -135,9 +147,9 @@ protected:
|
|||||||
virtual AddLibraryWizard::MacLibraryType suggestedMacLibraryType() const;
|
virtual AddLibraryWizard::MacLibraryType suggestedMacLibraryType() const;
|
||||||
virtual QString suggestedIncludePath() const;
|
virtual QString suggestedIncludePath() const;
|
||||||
virtual void updateWindowsOptionsEnablement();
|
virtual void updateWindowsOptionsEnablement();
|
||||||
virtual void proFileChanged();
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotCurrentLibraryChanged();
|
void slotCurrentLibraryChanged();
|
||||||
|
void updateProFile();
|
||||||
private:
|
private:
|
||||||
QString m_rootProjectPath;
|
QString m_rootProjectPath;
|
||||||
QVector<Qt4ProFileNode *> m_proFileNodes;
|
QVector<Qt4ProFileNode *> m_proFileNodes;
|
||||||
|
|||||||
Reference in New Issue
Block a user