Commit 8f224172 authored by dt's avatar dt

Refactoring: Move QtVersionManager to ProjectExplorer.

The Debugger, cmake and Qt4 plugin all need it. More refactoring to it
coming.
parent ef8e69d9
......@@ -21,6 +21,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<dependencyList>
<dependency name="Core" version="1.1.80"/>
<dependency name="Find" version="1.1.80"/>
<dependency name="Help" version="1.1.80"/>
<dependency name="QuickOpen" version="1.1.80"/>
<dependency name="TextEditor" version="1.1.80"/>
</dependencyList>
......
......@@ -58,7 +58,8 @@ HEADERS += projectexplorer.h \
buildparserfactory.h\
gccparser.h\
msvcparser.h\
filewatcher.h
filewatcher.h\
qtversionmanager.h
SOURCES += projectexplorer.cpp \
projectwindow.cpp \
buildmanager.cpp \
......@@ -105,7 +106,8 @@ SOURCES += projectexplorer.cpp \
buildparserfactory.cpp \
gccparser.cpp\
msvcparser.cpp\
filewatcher.cpp
filewatcher.cpp\
qtversionmanager.cpp
FORMS += dependenciespanel.ui \
buildsettingspropertiespage.ui \
processstep.ui \
......@@ -114,7 +116,9 @@ FORMS += dependenciespanel.ui \
sessiondialog.ui \
projectwizardpage.ui \
buildstepspage.ui \
removefiledialog.ui
removefiledialog.ui\
qtversionmanager.ui\
showbuildlog.ui
win32 {
SOURCES += applicationlauncher_win.cpp \
winguiprocess.cpp
......
......@@ -3,3 +3,4 @@ include(../../plugins/quickopen/quickopen.pri)
include(../../plugins/find/find.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/help/help.pri)
......@@ -177,7 +177,10 @@ const char * const RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource";
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";
const char * const BUILD_PARSER_GCC = "BuildParser.Gcc";
//Qt4 settings pages
const char * const QT_CATEGORY = "Qt4";
const char * const QTVERSION_PAGE = "Qt Versions";
const char * const BUILD_ENVIRONMENT_PAGE = "Build Environments";
} // namespace Constants
} // namespace ProjectExplorer
......
......@@ -29,8 +29,9 @@
#include "qtversionmanager.h"
#include "qt4projectmanagerconstants.h"
#include "projectexplorerconstants.h"
#include "ui_showbuildlog.h"
#include "ui_qtversionmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
......@@ -56,9 +57,8 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::Environment;
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
static const char *QtVersionsSectionName = "QtVersions";
static const char *defaultQtVersionKey = "DefaultQtVersion";
......@@ -391,18 +391,19 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau
}
m_ui.setupUi(this);
m_ui.qtPath->setExpectedKind(Core::Utils::PathChooser::Directory);
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 = new Internal::Ui::QtVersionManager();
m_ui->setupUi(this);
m_ui->qtPath->setExpectedKind(Core::Utils::PathChooser::Directory);
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.addButton->setIcon(QIcon(Core::Constants::ICON_PLUS));
m_ui.delButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
m_ui->addButton->setIcon(QIcon(Core::Constants::ICON_PLUS));
m_ui->delButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
for (int i = 0; i < m_versions.count(); ++i) {
const QtVersion * const version = m_versions.at(i);
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.qtdirList);
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->qtdirList);
item->setText(0, version->name());
item->setText(1, QDir::toNativeSeparators(version->path()));
item->setData(0, Qt::UserRole, version->uniqueId());
......@@ -416,41 +417,41 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau
item->setData(2, Qt::DecorationRole, QIcon());
}
m_ui.defaultCombo->addItem(version->name());
m_ui->defaultCombo->addItem(version->name());
if (i == m_defaultVersion)
m_ui.defaultCombo->setCurrentIndex(i);
m_ui->defaultCombo->setCurrentIndex(i);
}
connect(m_ui.nameEdit, SIGNAL(textEdited(const QString &)),
connect(m_ui->nameEdit, SIGNAL(textEdited(const QString &)),
this, SLOT(updateCurrentQtName()));
connect(m_ui.qtPath, SIGNAL(changed()),
connect(m_ui->qtPath, SIGNAL(changed()),
this, SLOT(updateCurrentQtPath()));
connect(m_ui.mingwPath, SIGNAL(changed()),
connect(m_ui->mingwPath, SIGNAL(changed()),
this, SLOT(updateCurrentMingwDirectory()));
connect(m_ui.addButton, SIGNAL(clicked()),
connect(m_ui->addButton, SIGNAL(clicked()),
this, SLOT(addQtDir()));
connect(m_ui.delButton, SIGNAL(clicked()),
connect(m_ui->delButton, SIGNAL(clicked()),
this, SLOT(removeQtDir()));
connect(m_ui.qtPath, SIGNAL(browsingFinished()),
connect(m_ui->qtPath, SIGNAL(browsingFinished()),
this, SLOT(onQtBrowsed()));
connect(m_ui.mingwPath, SIGNAL(browsingFinished()),
connect(m_ui->mingwPath, SIGNAL(browsingFinished()),
this, SLOT(onMingwBrowsed()));
connect(m_ui.qtdirList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
connect(m_ui->qtdirList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(versionChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
connect(m_ui.defaultCombo, SIGNAL(currentIndexChanged(int)),
connect(m_ui->defaultCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(defaultChanged(int)));
connect(m_ui.msvcComboBox, SIGNAL(currentIndexChanged(int)),
connect(m_ui->msvcComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(msvcVersionChanged()));
connect(m_ui.rebuildButton, SIGNAL(clicked()),
connect(m_ui->rebuildButton, SIGNAL(clicked()),
this, SLOT(buildDebuggingHelper()));
connect(m_ui.showLogButton, SIGNAL(clicked()),
connect(m_ui->showLogButton, SIGNAL(clicked()),
this, SLOT(showDebuggingBuildLog()));
showEnvironmentPage(0);
......@@ -460,43 +461,44 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau
void QtDirWidget::buildDebuggingHelper()
{
// Find the qt version for this button..
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
if (!currentItem)
return;
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
int currentItemIndex = m_ui->qtdirList->indexOfTopLevelItem(currentItem);
QtVersion *version = m_versions[currentItemIndex];
QString result = m_versions.at(currentItemIndex)->buildDebuggingHelperLibrary();
currentItem->setData(2, Qt::UserRole, result);
if (version->hasDebuggingHelper()) {
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/ok.png"));
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/ok.png"));
currentItem->setData(2, Qt::DecorationRole, QIcon(":/extensionsystem/images/ok.png"));
} else {
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/error.png"));
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/error.png"));
currentItem->setData(2, Qt::DecorationRole, QIcon(":/extensionsystem/images/error.png"));
}
m_ui.showLogButton->setEnabled(true);
m_ui->showLogButton->setEnabled(true);
}
void QtDirWidget::showDebuggingBuildLog()
{
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
if (!currentItem)
return;
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
int currentItemIndex = m_ui->qtdirList->indexOfTopLevelItem(currentItem);
QDialog dlg;
Ui_ShowBuildLog ui;
ui.setupUi(&dlg);
ui.log->setPlainText(m_ui.qtdirList->topLevelItem(currentItemIndex)->data(2, Qt::UserRole).toString());
ui.log->setPlainText(m_ui->qtdirList->topLevelItem(currentItemIndex)->data(2, Qt::UserRole).toString());
dlg.exec();
}
QtDirWidget::~QtDirWidget()
{
qDeleteAll(m_versions);
delete m_ui;
}
void QtDirWidget::addQtDir()
......@@ -504,31 +506,31 @@ void QtDirWidget::addQtDir()
QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString);
m_versions.append(newVersion);
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.qtdirList);
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->qtdirList);
item->setText(0, newVersion->name());
item->setText(1, QDir::toNativeSeparators(newVersion->path()));
item->setData(0, Qt::UserRole, newVersion->uniqueId());
item->setData(2, Qt::DecorationRole, QIcon());
m_ui.qtdirList->setCurrentItem(item);
m_ui->qtdirList->setCurrentItem(item);
m_ui.nameEdit->setText(newVersion->name());
m_ui.qtPath->setPath(newVersion->path());
m_ui.defaultCombo->addItem(newVersion->name());
m_ui.nameEdit->setFocus();
m_ui.nameEdit->selectAll();
m_ui->nameEdit->setText(newVersion->name());
m_ui->qtPath->setPath(newVersion->path());
m_ui->defaultCombo->addItem(newVersion->name());
m_ui->nameEdit->setFocus();
m_ui->nameEdit->selectAll();
}
void QtDirWidget::removeQtDir()
{
QTreeWidgetItem *item = m_ui.qtdirList->currentItem();
int index = m_ui.qtdirList->indexOfTopLevelItem(item);
QTreeWidgetItem *item = m_ui->qtdirList->currentItem();
int index = m_ui->qtdirList->indexOfTopLevelItem(item);
if (index < 0)
return;
for (int i = 0; i < m_ui.defaultCombo->count(); ++i) {
if (m_ui.defaultCombo->itemText(i) == item->text(0)) {
m_ui.defaultCombo->removeItem(i);
for (int i = 0; i < m_ui->defaultCombo->count(); ++i) {
if (m_ui->defaultCombo->itemText(i) == item->text(0)) {
m_ui->defaultCombo->removeItem(i);
break;
}
}
......@@ -541,83 +543,83 @@ void QtDirWidget::removeQtDir()
void QtDirWidget::updateState()
{
bool enabled = (m_ui.qtdirList->currentItem() != 0);
bool enabled = (m_ui->qtdirList->currentItem() != 0);
bool isSystemVersion = (enabled
&& m_versions.at(m_ui.qtdirList->indexOfTopLevelItem(m_ui.qtdirList->currentItem()))->isSystemVersion());
m_ui.delButton->setEnabled(enabled && !isSystemVersion);
m_ui.nameEdit->setEnabled(enabled && !isSystemVersion);
m_ui.qtPath->setEnabled(enabled && !isSystemVersion);
m_ui.mingwPath->setEnabled(enabled);
&& m_versions.at(m_ui->qtdirList->indexOfTopLevelItem(m_ui->qtdirList->currentItem()))->isSystemVersion());
m_ui->delButton->setEnabled(enabled && !isSystemVersion);
m_ui->nameEdit->setEnabled(enabled && !isSystemVersion);
m_ui->qtPath->setEnabled(enabled && !isSystemVersion);
m_ui->mingwPath->setEnabled(enabled);
bool hasLog = enabled && !m_ui.qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty();
m_ui.showLogButton->setEnabled(hasLog);
bool hasLog = enabled && !m_ui->qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty();
m_ui->showLogButton->setEnabled(hasLog);
QtVersion *version = 0;
if (enabled)
version = m_versions.at(m_ui.qtdirList->indexOfTopLevelItem(m_ui.qtdirList->currentItem()));
version = m_versions.at(m_ui->qtdirList->indexOfTopLevelItem(m_ui->qtdirList->currentItem()));
if (version) {
m_ui.rebuildButton->setEnabled(version->isValid());
m_ui->rebuildButton->setEnabled(version->isValid());
if (version->hasDebuggingHelper())
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/ok.png"));
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/ok.png"));
else
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/error.png"));
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/error.png"));
} else {
m_ui.rebuildButton->setEnabled(false);
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap());
m_ui->rebuildButton->setEnabled(false);
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap());
}
}
void QtDirWidget::makeMingwVisible(bool visible)
{
m_ui.mingwLabel->setVisible(visible);
m_ui.mingwPath->setVisible(visible);
m_ui->mingwLabel->setVisible(visible);
m_ui->mingwPath->setVisible(visible);
}
void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
{
m_ui.msvcComboBox->setVisible(false);
m_ui->msvcComboBox->setVisible(false);
if (item) {
int index = m_ui.qtdirList->indexOfTopLevelItem(item);
m_ui.errorLabel->setText("");
int index = m_ui->qtdirList->indexOfTopLevelItem(item);
m_ui->errorLabel->setText("");
ProjectExplorer::ToolChain::ToolChainType t = m_versions.at(index)->toolchainType();
if (t == ProjectExplorer::ToolChain::MinGW) {
m_ui.msvcComboBox->setVisible(false);
m_ui->msvcComboBox->setVisible(false);
makeMingwVisible(true);
m_ui.mingwPath->setPath(m_versions.at(index)->mingwDirectory());
m_ui->mingwPath->setPath(m_versions.at(index)->mingwDirectory());
} else if (t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE){
m_ui.msvcComboBox->setVisible(false);
m_ui->msvcComboBox->setVisible(false);
makeMingwVisible(false);
QStringList msvcEnvironments = ProjectExplorer::ToolChain::availableMSVCVersions();
if (msvcEnvironments.count() == 0) {
} else if (msvcEnvironments.count() == 1) {
} else {
m_ui.msvcComboBox->setVisible(true);
bool block = m_ui.msvcComboBox->blockSignals(true);
m_ui.msvcComboBox->clear();
m_ui->msvcComboBox->setVisible(true);
bool block = m_ui->msvcComboBox->blockSignals(true);
m_ui->msvcComboBox->clear();
foreach(const QString &msvcenv, msvcEnvironments) {
m_ui.msvcComboBox->addItem(msvcenv);
m_ui->msvcComboBox->addItem(msvcenv);
if (msvcenv == m_versions.at(index)->msvcVersion()) {
m_ui.msvcComboBox->setCurrentIndex(m_ui.msvcComboBox->count() - 1);
m_ui->msvcComboBox->setCurrentIndex(m_ui->msvcComboBox->count() - 1);
}
}
m_ui.msvcComboBox->blockSignals(block);
m_ui->msvcComboBox->blockSignals(block);
}
} else if (t == ProjectExplorer::ToolChain::INVALID) {
m_ui.msvcComboBox->setVisible(false);
m_ui->msvcComboBox->setVisible(false);
makeMingwVisible(false);
if (!m_versions.at(index)->isInstalled())
m_ui.errorLabel->setText(tr("The Qt Version %1 is not installed. Run make install")
m_ui->errorLabel->setText(tr("The Qt Version %1 is not installed. Run make install")
.arg(QDir::toNativeSeparators(m_versions.at(index)->path())));
else
m_ui.errorLabel->setText(tr("%1 is not a valid qt directory").arg(QDir::toNativeSeparators(m_versions.at(index)->path())));
m_ui->errorLabel->setText(tr("%1 is not a valid qt directory").arg(QDir::toNativeSeparators(m_versions.at(index)->path())));
} else { //ProjectExplorer::ToolChain::GCC
m_ui.msvcComboBox->setVisible(false);
m_ui->msvcComboBox->setVisible(false);
makeMingwVisible(false);
m_ui.errorLabel->setText(tr("Found Qt version %1, using mkspec %2")
m_ui->errorLabel->setText(tr("Found Qt version %1, using mkspec %2")
.arg(m_versions.at(index)->qtVersionString(),
m_versions.at(index)->mkspec()));
}
} else {
m_ui.msvcComboBox->setVisible(false);
m_ui->msvcComboBox->setVisible(false);
makeMingwVisible(false);
}
}
......@@ -625,14 +627,14 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
void QtDirWidget::versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old)
{
if (old) {
fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(old));
fixQtVersionName(m_ui->qtdirList->indexOfTopLevelItem(old));
}
if (item) {
m_ui.nameEdit->setText(item->text(0));
m_ui.qtPath->setPath(item->text(1));
m_ui->nameEdit->setText(item->text(0));
m_ui->qtPath->setPath(item->text(1));
} else {
m_ui.nameEdit->clear();
m_ui.qtPath->setPath(""); // clear()
m_ui->nameEdit->clear();
m_ui->qtPath->setPath(""); // clear()
}
showEnvironmentPage(item);
updateState();
......@@ -640,15 +642,15 @@ void QtDirWidget::versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old)
void QtDirWidget::onQtBrowsed()
{
const QString dir = m_ui.qtPath->path();
const QString dir = m_ui->qtPath->path();
if (dir.isEmpty())
return;
updateCurrentQtPath();
if (m_ui.nameEdit->text().isEmpty() || m_ui.nameEdit->text() == m_specifyNameString) {
if (m_ui->nameEdit->text().isEmpty() || m_ui->nameEdit->text() == m_specifyNameString) {
QStringList dirSegments = dir.split(QDir::separator(), QString::SkipEmptyParts);
if (!dirSegments.isEmpty())
m_ui.nameEdit->setText(dirSegments.last());
m_ui->nameEdit->setText(dirSegments.last());
updateCurrentQtName();
}
updateState();
......@@ -656,7 +658,7 @@ void QtDirWidget::onQtBrowsed()
void QtDirWidget::onMingwBrowsed()
{
const QString dir = m_ui.mingwPath->path();
const QString dir = m_ui->mingwPath->path();
if (dir.isEmpty())
return;
......@@ -666,8 +668,8 @@ void QtDirWidget::onMingwBrowsed()
void QtDirWidget::defaultChanged(int)
{
for (int i=0; i<m_ui.defaultCombo->count(); ++i) {
if (m_versions.at(i)->name() == m_ui.defaultCombo->currentText()) {
for (int i=0; i<m_ui->defaultCombo->count(); ++i) {
if (m_versions.at(i)->name() == m_ui->defaultCombo->currentText()) {
m_defaultVersion = i;
return;
}
......@@ -678,20 +680,20 @@ void QtDirWidget::defaultChanged(int)
void QtDirWidget::updateCurrentQtName()
{
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
Q_ASSERT(currentItem);
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
m_versions[currentItemIndex]->setName(m_ui.nameEdit->text());
int currentItemIndex = m_ui->qtdirList->indexOfTopLevelItem(currentItem);
m_versions[currentItemIndex]->setName(m_ui->nameEdit->text());
currentItem->setText(0, m_versions[currentItemIndex]->name());
m_ui.defaultCombo->setItemText(currentItemIndex, m_versions[currentItemIndex]->name());
m_ui->defaultCombo->setItemText(currentItemIndex, m_versions[currentItemIndex]->name());
}
void QtDirWidget::finish()
{
if (QTreeWidgetItem *item = m_ui.qtdirList->currentItem())
fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(item));
if (QTreeWidgetItem *item = m_ui->qtdirList->currentItem())
fixQtVersionName(m_ui->qtdirList->indexOfTopLevelItem(item));
}
/* Checks that the qt version name is unique
......@@ -715,8 +717,8 @@ void QtDirWidget::fixQtVersionName(int index)
}
// set new name
m_versions[index]->setName(name);
m_ui.qtdirList->topLevelItem(index)->setText(0, name);
m_ui.defaultCombo->setItemText(index, name);
m_ui->qtdirList->topLevelItem(index)->setText(0, name);
m_ui->defaultCombo->setItemText(index, name);
// Now check again...
fixQtVersionName(index);
......@@ -727,12 +729,12 @@ void QtDirWidget::fixQtVersionName(int index)
void QtDirWidget::updateCurrentQtPath()
{
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
Q_ASSERT(currentItem);
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
if (m_versions[currentItemIndex]->path() == m_ui.qtPath->path())
int currentItemIndex = m_ui->qtdirList->indexOfTopLevelItem(currentItem);
if (m_versions[currentItemIndex]->path() == m_ui->qtPath->path())
return;
m_versions[currentItemIndex]->setPath(m_ui.qtPath->path());
m_versions[currentItemIndex]->setPath(m_ui->qtPath->path());
currentItem->setText(1, QDir::toNativeSeparators(m_versions[currentItemIndex]->path()));
showEnvironmentPage(currentItem);
......@@ -742,32 +744,32 @@ void QtDirWidget::updateCurrentQtPath()
bool hasHelper = m_versions[currentItemIndex]->hasDebuggingHelper();
if (hasHelper) {
currentItem->setData(2, Qt::DecorationRole, QIcon(":/extensionsystem/images/ok.png"));
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/ok.png"));
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/ok.png"));
} else {
currentItem->setData(2, Qt::DecorationRole, QIcon(":/extensionsystem/images/error.png"));
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/error.png"));
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap(":/extensionsystem/images/error.png"));
}
m_ui.showLogButton->setEnabled(hasLog);
m_ui->showLogButton->setEnabled(hasLog);
} else {
currentItem->setData(2, Qt::DecorationRole, QIcon());
m_ui.debuggingHelperStateLabel->setPixmap(QPixmap());
m_ui->debuggingHelperStateLabel->setPixmap(QPixmap());
}
}
void QtDirWidget::updateCurrentMingwDirectory()
{
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
Q_ASSERT(currentItem);
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
m_versions[currentItemIndex]->setMingwDirectory(m_ui.mingwPath->path());
int currentItemIndex = m_ui->qtdirList->indexOfTopLevelItem(currentItem);
m_versions[currentItemIndex]->setMingwDirectory(m_ui->mingwPath->path());
}
void QtDirWidget::msvcVersionChanged()
{
const QString &msvcVersion = m_ui.msvcComboBox->currentText();
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
const QString &msvcVersion = m_ui->msvcComboBox->currentText();
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
Q_ASSERT(currentItem);
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
int currentItemIndex = m_ui->qtdirList->indexOfTopLevelItem(currentItem);
m_versions[currentItemIndex]->setMsvcVersion(msvcVersion);
}
......
......@@ -30,22 +30,26 @@
#ifndef QTVERSIONMANAGER_H
#define QTVERSIONMANAGER_H
#include "ui_qtversionmanager.h"
#include "projectexplorer.h"
#include "toolchain.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QPointer>
#include <QtGui/QWidget>
#include <QtGui/QPushButton>
namespace Qt4ProjectManager {
namespace ProjectExplorer {
namespace Internal {
namespace Ui {
class QtVersionManager;
}
}
class QtDirWidget;
class QtVersion
class PROJECTEXPLORER_EXPORT QtVersion
{
friend class QtDirWidget; //for changing name and path
friend class QtVersionManager;
......@@ -141,7 +145,7 @@ private:
void showEnvironmentPage(QTreeWidgetItem * item);
void fixQtVersionName(int index);
int indexForWidget(QWidget *debuggingHelperWidget) const;
Ui::QtVersionManager m_ui;
Internal::Ui::QtVersionManager *m_ui;
QList<QtVersion *> m_versions;
int m_defaultVersion;
QString m_specifyNameString;
......@@ -164,7 +168,7 @@ private slots:
void showDebuggingBuildLog();
};
class QtVersionManager : public Core::IOptionsPage
class PROJECTEXPLORER_EXPORT QtVersionManager : public Core::IOptionsPage
{
Q_OBJECT
......@@ -222,8 +226,6 @@ private:
QMap<int, int> m_uniqueIdToIndex;
int m_idcount;
};
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace ProjectExplorer
#endif // QTVERSIONMANAGER_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Qt4ProjectManager::Internal::QtVersionManager</class>