forked from qt-creator/qt-creator
Parametrize metroworks tools path.
This commit is contained in:
@@ -8,4 +8,5 @@
|
||||
* WINSCW tool chain:
|
||||
* predefined macros
|
||||
* system includes
|
||||
* get rid of hardcoded carbide path
|
||||
|
||||
* Run WINSCW executables
|
||||
|
||||
@@ -114,5 +114,5 @@ void S60Manager::updateQtVersions()
|
||||
ProjectExplorer::ToolChain *S60Manager::createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const
|
||||
{
|
||||
QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1);
|
||||
return new WINSCWToolChain(m_devices->deviceForId(id));
|
||||
return new WINSCWToolChain(m_devices->deviceForId(id), version->mwcDirectory());
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
WINSCWToolChain::WINSCWToolChain(S60Devices::Device device)
|
||||
WINSCWToolChain::WINSCWToolChain(S60Devices::Device device, const QString &mwcDirectory)
|
||||
// TODO get rid of hardcoded carbide path
|
||||
: m_carbidePath(QLatin1String("C:\\Apps\\Nokia\\Carbide.c++ v2.0")),
|
||||
: m_carbidePath(mwcDirectory),
|
||||
m_deviceId(device.id),
|
||||
m_deviceName(device.name),
|
||||
m_deviceRoot(device.epocRoot)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Internal {
|
||||
class WINSCWToolChain : public ProjectExplorer::ToolChain
|
||||
{
|
||||
public:
|
||||
WINSCWToolChain(S60Devices::Device device);
|
||||
WINSCWToolChain(S60Devices::Device device, const QString &mwcDirectory);
|
||||
QByteArray predefinedMacros();
|
||||
QList<ProjectExplorer::HeaderPath> systemHeaderPaths();
|
||||
void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
|
||||
@@ -81,6 +81,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
|
||||
m_ui->qtPath->setPromptDialogTitle(tr("Select QTDIR"));
|
||||
m_ui->mingwPath->setExpectedKind(Core::Utils::PathChooser::Directory);
|
||||
m_ui->qtPath->setPromptDialogTitle(tr("Select the Qt Directory"));
|
||||
m_ui->mwcPath->setExpectedKind(Core::Utils::PathChooser::Directory);
|
||||
m_ui->mwcPath->setPromptDialogTitle(tr("Select \"x86build\" Directory from Carbide Install"));
|
||||
|
||||
m_ui->addButton->setIcon(QIcon(Core::Constants::ICON_PLUS));
|
||||
m_ui->delButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
|
||||
@@ -126,6 +128,10 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
|
||||
this, SLOT(updateCurrentQtPath()));
|
||||
connect(m_ui->mingwPath, SIGNAL(changed()),
|
||||
this, SLOT(updateCurrentMingwDirectory()));
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
connect(m_ui->mwcPath, SIGNAL(changed()),
|
||||
this, SLOT(updateCurrentMwcDirectory()));
|
||||
#endif
|
||||
|
||||
connect(m_ui->addButton, SIGNAL(clicked()),
|
||||
this, SLOT(addQtDir()));
|
||||
@@ -278,6 +284,12 @@ void QtOptionsPageWidget::makeMSVCVisible(bool visible)
|
||||
m_ui->msvcNotFoundLabel->setVisible(false);
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::makeMWCVisible(bool visible)
|
||||
{
|
||||
m_ui->mwcLabel->setVisible(visible);
|
||||
m_ui->mwcPath->setVisible(visible);
|
||||
}
|
||||
|
||||
void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
{
|
||||
if (item) {
|
||||
@@ -285,6 +297,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
if (index < 0) {
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(false);
|
||||
makeMWCVisible(false);
|
||||
return;
|
||||
}
|
||||
m_ui->errorLabel->setText("");
|
||||
@@ -292,10 +305,12 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
if (t == ProjectExplorer::ToolChain::MinGW) {
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(true);
|
||||
makeMWCVisible(false);
|
||||
m_ui->mingwPath->setPath(m_versions.at(index)->mingwDirectory());
|
||||
} else if (t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE){
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(false);
|
||||
makeMWCVisible(false);
|
||||
QStringList msvcEnvironments = ProjectExplorer::ToolChain::availableMSVCVersions();
|
||||
if (msvcEnvironments.count() == 0) {
|
||||
m_ui->msvcLabel->setVisible(true);
|
||||
@@ -312,9 +327,17 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
}
|
||||
m_ui->msvcComboBox->blockSignals(block);
|
||||
}
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
} else if (t == ProjectExplorer::ToolChain::WINSCW) {
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(false);
|
||||
makeMWCVisible(true);
|
||||
m_ui->mwcPath->setPath(m_versions.at(index)->mwcDirectory());
|
||||
#endif
|
||||
} else if (t == ProjectExplorer::ToolChain::INVALID) {
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(false);
|
||||
makeMWCVisible(false);
|
||||
if (!m_versions.at(index)->isInstalled())
|
||||
m_ui->errorLabel->setText(tr("The Qt Version %1 is not installed. Run make install")
|
||||
.arg(QDir::toNativeSeparators(m_versions.at(index)->path())));
|
||||
@@ -323,6 +346,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
} else { //ProjectExplorer::ToolChain::GCC
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(false);
|
||||
makeMWCVisible(false);
|
||||
m_ui->errorLabel->setText(tr("Found Qt version %1, using mkspec %2")
|
||||
.arg(m_versions.at(index)->qtVersionString(),
|
||||
m_versions.at(index)->mkspec()));
|
||||
@@ -330,6 +354,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
} else {
|
||||
makeMSVCVisible(false);
|
||||
makeMingwVisible(false);
|
||||
makeMWCVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,6 +532,18 @@ void QtOptionsPageWidget::msvcVersionChanged()
|
||||
m_versions[currentItemIndex]->setMsvcVersion(msvcVersion);
|
||||
}
|
||||
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
void QtOptionsPageWidget::updateCurrentMwcDirectory()
|
||||
{
|
||||
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
|
||||
Q_ASSERT(currentItem);
|
||||
int currentItemIndex = indexForTreeItem(currentItem);
|
||||
if (currentItemIndex < 0)
|
||||
return;
|
||||
m_versions[currentItemIndex]->setMwcDirectory(m_ui->mwcPath->path());
|
||||
}
|
||||
#endif
|
||||
|
||||
QList<QtVersion *> QtOptionsPageWidget::versions() const
|
||||
{
|
||||
return m_versions;
|
||||
|
||||
@@ -75,12 +75,16 @@ private slots:
|
||||
void updateState();
|
||||
void makeMingwVisible(bool visible);
|
||||
void makeMSVCVisible(bool visible);
|
||||
void makeMWCVisible(bool visible);
|
||||
void onQtBrowsed();
|
||||
void onMingwBrowsed();
|
||||
void defaultChanged(int index);
|
||||
void updateCurrentQtName();
|
||||
void updateCurrentQtPath();
|
||||
void updateCurrentMingwDirectory();
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
void updateCurrentMwcDirectory();
|
||||
#endif
|
||||
void msvcVersionChanged();
|
||||
void buildDebuggingHelper();
|
||||
void showDebuggingBuildLog();
|
||||
|
||||
@@ -107,6 +107,9 @@ QtVersionManager::QtVersionManager()
|
||||
autodetectionSource);
|
||||
version->setMingwDirectory(s->value("MingwDirectory").toString());
|
||||
version->setMsvcVersion(s->value("msvcVersion").toString());
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
version->setMwcDirectory(s->value("MwcDirectory").toString());
|
||||
#endif
|
||||
m_versions.append(version);
|
||||
}
|
||||
s->endArray();
|
||||
@@ -221,6 +224,9 @@ void QtVersionManager::writeVersionsIntoSettings()
|
||||
s->setValue("isAutodetected", version->isAutodetected());
|
||||
if (version->isAutodetected())
|
||||
s->setValue("autodetectionSource", version->autodetectionSource());
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
s->setValue("MwcDirectory", version->mwcDirectory());
|
||||
#endif
|
||||
}
|
||||
s->endArray();
|
||||
}
|
||||
@@ -1021,6 +1027,19 @@ ProjectExplorer::ToolChain::ToolChainType QtVersion::toolchainType() const
|
||||
return ProjectExplorer::ToolChain::GCC;
|
||||
}
|
||||
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
QString QtVersion::mwcDirectory() const
|
||||
{
|
||||
return m_mwcDirectory;
|
||||
}
|
||||
|
||||
void QtVersion::setMwcDirectory(const QString &directory)
|
||||
{
|
||||
m_mwcDirectory = directory;
|
||||
m_toolChainUpToDate = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
QString QtVersion::mingwDirectory() const
|
||||
{
|
||||
return m_mingwDirectory;
|
||||
|
||||
@@ -83,6 +83,10 @@ public:
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType toolchainType() const;
|
||||
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
QString mwcDirectory() const;
|
||||
void setMwcDirectory(const QString &directory);
|
||||
#endif
|
||||
QString mingwDirectory() const;
|
||||
void setMingwDirectory(const QString &directory);
|
||||
QString msvcVersion() const;
|
||||
@@ -135,6 +139,9 @@ private:
|
||||
bool m_isAutodetected;
|
||||
QString m_autodetectionSource;
|
||||
bool m_hasDebuggingHelper;
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
QString m_mwcDirectory;
|
||||
#endif
|
||||
|
||||
mutable bool m_mkspecUpToDate;
|
||||
mutable QString m_mkspec; // updated lazily
|
||||
|
||||
@@ -162,6 +162,16 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="mwcLabel">
|
||||
<property name="text">
|
||||
<string>MWC Directory:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="Core::Utils::PathChooser" name="mwcPath" native="true"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -208,6 +218,20 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>qtdirList</zorder>
|
||||
<zorder>versionNameLabel</zorder>
|
||||
<zorder>nameEdit</zorder>
|
||||
<zorder>pathLabel</zorder>
|
||||
<zorder>qtPath</zorder>
|
||||
<zorder>mingwLabel</zorder>
|
||||
<zorder>mingwPath</zorder>
|
||||
<zorder>msvcLabel</zorder>
|
||||
<zorder>label</zorder>
|
||||
<zorder>errorLabel</zorder>
|
||||
<zorder>mwcLabel</zorder>
|
||||
<zorder>mwcPath</zorder>
|
||||
<zorder>msvcComboBox</zorder>
|
||||
<zorder>msvcNotFoundLabel</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user