Commit 33336bf2 authored by con's avatar con
Browse files

Merge commit 'qt-s60/qt-s60'

Conflicts:
	src/plugins/qt4projectmanager/makestep.cpp
parents ae9b6f32 615f04c4
......@@ -106,7 +106,7 @@ PathChooser::PathChooser(QWidget *parent) :
m_d->m_hLayout->setContentsMargins(0, 0, 0, 0);
connect(m_d->m_lineEdit, SIGNAL(validReturnPressed()), this, SIGNAL(returnPressed()));
connect(m_d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
connect(m_d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed(QString)));
connect(m_d->m_lineEdit, SIGNAL(validChanged()), this, SIGNAL(validChanged()));
connect(m_d->m_lineEdit, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));
......
......@@ -90,7 +90,7 @@ private:
signals:
void validChanged();
void changed();
void changed(const QString &text);
void editingFinished();
void beforeBrowsing();
void browsingFinished();
......
......@@ -65,7 +65,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
hideStatusLabel();
m_d->m_ui.nameLineEdit->setInitialText(tr("<Enter_Name>"));
m_d->m_ui.nameLineEdit->setFocus(Qt::TabFocusReason);
connect(m_d->m_ui.pathChooser, SIGNAL(changed()), this, SLOT(slotChanged()));
connect(m_d->m_ui.pathChooser, SIGNAL(changed(QString)), this, SLOT(slotChanged()));
connect(m_d->m_ui.nameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotChanged()));
connect(m_d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
connect(m_d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));
......
......@@ -65,7 +65,8 @@ HEADERS += utils_global.h \
uncommentselection.h \
parameteraction.h \
treewidgetcolumnstretcher.h \
checkablemessagebox.h
checkablemessagebox.h \
qtcassert.h
FORMS += filewizardpage.ui \
projectintropage.ui \
newclasswidget.ui \
......
......@@ -237,7 +237,7 @@ ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool chang
fl->addWidget(label);
m_pc = new Core::Utils::PathChooser(this);
m_pc->setPath(m_cmakeWizard->buildDirectory());
connect(m_pc, SIGNAL(changed()), this, SLOT(buildDirectoryChanged()));
connect(m_pc, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
fl->addRow(tr("Build directory:"), m_pc);
}
......
......@@ -267,7 +267,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
boxLayout->addWidget(m_systemEnvironmentRadioButton);
boxLayout->addWidget(m_buildEnvironmentRadioButton);
connect(m_workingDirectoryEdit, SIGNAL(changed()),
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
this, SLOT(setWorkingDirectory()));
connect(resetButton, SIGNAL(clicked()),
......
......@@ -486,7 +486,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
m_pathChooser = new Core::Utils::PathChooser(this);
m_pathChooser->setEnabled(true);
fl->addRow(tr("Build directory:"), m_pathChooser);
connect(m_pathChooser, SIGNAL(changed()), this, SLOT(buildDirectoryChanged()));
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
// tool chain
QComboBox *toolChainChooser = new QComboBox;
......
......@@ -30,6 +30,8 @@
#ifndef APPLICATIONLAUNCHER_H
#define APPLICATIONLAUNCHER_H
#include "projectexplorer_export.h"
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QProcess>
......@@ -44,11 +46,12 @@ class ConsoleProcess;
}
namespace ProjectExplorer {
namespace Internal {
class WinGuiProcess;
namespace Internal {
class WinGuiProcess;
}
class ApplicationLauncher : public QObject
class PROJECTEXPLORER_EXPORT ApplicationLauncher : public QObject
{
Q_OBJECT
......@@ -93,14 +96,13 @@ private:
Mode m_currentMode;
#ifdef Q_OS_WIN
WinGuiProcess *m_winGuiProcess;
Internal::WinGuiProcess *m_winGuiProcess;
#else
QTextCodec *m_outputCodec;
QTextCodec::ConverterState m_outputCodecState;
#endif
};
} // namespace Internal
} // namespace ProjectExplorer
#endif // APPLICATIONLAUNCHER_H
......@@ -33,6 +33,7 @@
#include <QDebug>
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
using namespace Core::Utils;
......
......@@ -34,7 +34,7 @@
#include <QtCore/QTimer>
using namespace ProjectExplorer::Internal;
using namespace ProjectExplorer;
using namespace Core::Utils;
ApplicationLauncher::ApplicationLauncher(QObject *parent)
......
......@@ -134,7 +134,7 @@ void ApplicationRunControl::start()
m_executable = rc->executable();
m_applicationLauncher.start(static_cast<Internal::ApplicationLauncher::Mode>(rc->runMode()),
m_applicationLauncher.start(static_cast<ApplicationLauncher::Mode>(rc->runMode()),
m_executable, rc->commandLineArguments());
emit started();
......
......@@ -44,7 +44,7 @@ class PROJECTEXPLORER_EXPORT ApplicationRunConfiguration : public RunConfigurati
Q_OBJECT
public:
enum RunMode {
Console = Internal::ApplicationLauncher::Console,
Console = ApplicationLauncher::Console,
Gui
};
......
......@@ -130,11 +130,11 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
connect(m_userName, SIGNAL(textEdited(QString)),
this, SLOT(setUserName(QString)));
connect(m_executableChooser, SIGNAL(changed()),
connect(m_executableChooser, SIGNAL(changed(QString)),
this, SLOT(setExecutable()));
connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(setCommandLineArguments(const QString&)));
connect(m_workingDirectory, SIGNAL(changed()),
connect(m_workingDirectory, SIGNAL(changed(QString)),
this, SLOT(setWorkingDirectory()));
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
this, SLOT(termToggled(bool)));
......
......@@ -133,9 +133,9 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step)
{
m_ui.setupUi(this);
m_ui.command->setExpectedKind(Core::Utils::PathChooser::File);
connect(m_ui.command, SIGNAL(changed()),
connect(m_ui.command, SIGNAL(changed(QString)),
this, SLOT(commandLineEditTextEdited()));
connect(m_ui.workingDirectory, SIGNAL(changed()),
connect(m_ui.workingDirectory, SIGNAL(changed(QString)),
this, SLOT(workingDirectoryLineEditTextEdited()));
connect(m_ui.nameLineEdit, SIGNAL(textEdited(const QString&)),
......
......@@ -149,6 +149,7 @@ signals:
void fileListChanged();
void activeBuildConfigurationChanged();
void activeRunConfigurationChanged();
void runConfigurationsEnabledStateChanged();
void removedRunConfiguration(const QString &name);
void addedRunConfiguration(const QString &name);
// This signal is jut there for updating the tree list in the buildsettings wizard
......
......@@ -1862,15 +1862,17 @@ void ProjectExplorerPlugin::populateRunConfigurationMenu()
foreach (const Project *pro, m_session->projects()) {
foreach (QSharedPointer<RunConfiguration> runConfiguration, pro->runConfigurations()) {
const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name());
QAction *act = new QAction(title, m_runConfigurationActionGroup);
act->setCheckable(true);
act->setData(qVariantFromValue(runConfiguration));
act->setChecked(runConfiguration == activeRunConfiguration);
m_runConfigurationMenu->addAction(act);
if (debug)
qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name()
<< "active:" << (runConfiguration == activeRunConfiguration);
if (runConfiguration->isEnabled()) {
const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name());
QAction *act = new QAction(title, m_runConfigurationActionGroup);
act->setCheckable(true);
act->setData(qVariantFromValue(runConfiguration));
act->setChecked(runConfiguration == activeRunConfiguration);
m_runConfigurationMenu->addAction(act);
if (debug)
qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name()
<< "active:" << (runConfiguration == activeRunConfiguration);
}
}
}
......
......@@ -79,7 +79,8 @@ void RunConfiguration::restore(const PersistentSettingsReader &reader)
}
IRunConfigurationFactory::IRunConfigurationFactory()
IRunConfigurationFactory::IRunConfigurationFactory(QObject *parent)
: QObject(parent)
{
}
......@@ -87,7 +88,8 @@ IRunConfigurationFactory::~IRunConfigurationFactory()
{
}
IRunConfigurationRunner::IRunConfigurationRunner()
IRunConfigurationRunner::IRunConfigurationRunner(QObject *parent)
: QObject(parent)
{
}
......
......@@ -75,6 +75,8 @@ public:
QString name() const;
void setName(const QString &name);
virtual bool isEnabled() const { return true; }
// Returns the widget used to configure this run configuration. Ownership is transferred to the caller
// rename to createConfigurationWidget
virtual QWidget *configurationWidget() = 0;
......@@ -100,7 +102,7 @@ class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject
{
Q_OBJECT
public:
IRunConfigurationFactory();
IRunConfigurationFactory(QObject *parent = 0);
virtual ~IRunConfigurationFactory();
// used to recreate the runConfigurations when restoring settings
virtual bool canRestore(const QString &type) const = 0;
......@@ -116,7 +118,7 @@ class PROJECTEXPLORER_EXPORT IRunConfigurationRunner : public QObject
{
Q_OBJECT
public:
IRunConfigurationRunner();
IRunConfigurationRunner(QObject *parent = 0);
virtual ~IRunConfigurationRunner();
virtual bool canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) = 0;
virtual RunControl* run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) = 0;
......
......@@ -69,6 +69,7 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
void setRunConfigurations(const QList<QSharedPointer<RunConfiguration> > &runConfigurations);
QList<QSharedPointer<RunConfiguration> > runConfigurations() const { return m_runConfigurations; }
void nameChanged(RunConfiguration *rc);
private:
......@@ -172,6 +173,7 @@ void RunConfigurationsModel::setRunConfigurations(const QList<QSharedPointer<Run
RunSettingsWidget::RunSettingsWidget(Project *project)
: m_project(project),
m_runConfigurationsModel(new RunConfigurationsModel(this)),
m_enabledRunConfigurationsModel(new RunConfigurationsModel(this)),
m_runConfigurationWidget(0)
{
m_ui = new Ui::RunSettingsPropertiesPage;
......@@ -181,22 +183,26 @@ RunSettingsWidget::RunSettingsWidget(Project *project)
m_ui->addToolButton->setMenu(m_addMenu);
m_ui->removeToolButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
m_ui->runConfigurationCombo->setModel(m_runConfigurationsModel);
m_ui->activeRunConfigurationCombo->setModel(m_enabledRunConfigurationsModel);
connect(m_addMenu, SIGNAL(aboutToShow()),
this, SLOT(aboutToShowAddMenu()));
connect(m_ui->runConfigurationCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(showRunConfigurationWidget(int)));
connect(m_ui->activeRunConfigurationCombo, SIGNAL(activated(int)),
this, SLOT(activateRunConfiguration(int)));
connect(m_ui->removeToolButton, SIGNAL(clicked(bool)),
this, SLOT(removeRunConfiguration()));
connect(m_project, SIGNAL(removedRunConfiguration(QString)),
this, SLOT(initRunConfigurationComboBox()));
connect(m_project, SIGNAL(addedRunConfiguration(QString)),
this, SLOT(initRunConfigurationComboBox()));
connect(m_project, SIGNAL(activeRunConfigurationChanged()),
this, SLOT(activeRunConfigurationChanged()));
connect(m_project, SIGNAL(runConfigurationsEnabledStateChanged()),
this, SLOT(initRunConfigurationComboBox()));
initRunConfigurationComboBox();
const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations();
......@@ -251,15 +257,16 @@ void RunSettingsWidget::addRunConfiguration()
if (!newRC)
return;
m_project->addRunConfiguration(newRC);
m_project->setActiveRunConfiguration(newRC);
initRunConfigurationComboBox();
m_ui->runConfigurationCombo->setCurrentIndex(
m_runConfigurationsModel->runConfigurations().indexOf(newRC));
connect(newRC.data(), SIGNAL(nameChanged()), this, SLOT(nameChanged()));
}
void RunSettingsWidget::removeRunConfiguration()
{
int index = m_ui->runConfigurationCombo->currentIndex();
QSharedPointer<RunConfiguration> rc = m_project->runConfigurations().at(index);
QSharedPointer<RunConfiguration> rc = m_runConfigurationsModel->runConfigurations().at(index);
disconnect(rc.data(), SIGNAL(nameChanged()), this, SLOT(nameChanged()));
m_project->removeRunConfiguration(rc);
initRunConfigurationComboBox();
......@@ -268,25 +275,32 @@ void RunSettingsWidget::removeRunConfiguration()
void RunSettingsWidget::initRunConfigurationComboBox()
{
const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations();
QSharedPointer<RunConfiguration> activeRunConfiguration = m_project->activeRunConfiguration();
const QSharedPointer<RunConfiguration> activeRunConfiguration = m_project->activeRunConfiguration();
const QSharedPointer<RunConfiguration> currentSelection =
(m_ui->runConfigurationCombo->currentIndex() >= 0) ?
m_runConfigurationsModel->runConfigurations().at(m_ui->runConfigurationCombo->currentIndex())
: QSharedPointer<RunConfiguration>(0);
m_runConfigurationsModel->setRunConfigurations(runConfigurations);
// Make sure the active run configuration is selected in the combo
if (runConfigurations.contains(currentSelection))
m_ui->runConfigurationCombo->setCurrentIndex(runConfigurations.indexOf(currentSelection));
else
m_ui->runConfigurationCombo->setCurrentIndex(runConfigurations.indexOf(activeRunConfiguration));
QList<QSharedPointer<RunConfiguration> > enabledRunConfigurations;
for (int i = 0; i < runConfigurations.size(); ++i) {
if (runConfigurations.at(i) == activeRunConfiguration)
m_ui->runConfigurationCombo->setCurrentIndex(i);
if (runConfigurations.at(i)->isEnabled())
enabledRunConfigurations.append(runConfigurations.at(i));
}
m_enabledRunConfigurationsModel->setRunConfigurations(enabledRunConfigurations);
m_ui->activeRunConfigurationCombo->setCurrentIndex(
enabledRunConfigurations.indexOf(activeRunConfiguration));
m_ui->removeToolButton->setEnabled(runConfigurations.size() > 1);
}
void RunSettingsWidget::activateRunConfiguration(int index)
void RunSettingsWidget::showRunConfigurationWidget(int index)
{
Q_ASSERT(m_project);
const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations();
Q_ASSERT(index < runConfigurations.size());
QSharedPointer<RunConfiguration> selectedRunConfiguration = runConfigurations.at(index);
// Change the active run configuration of the project
m_project->setActiveRunConfiguration(selectedRunConfiguration);
QSharedPointer<RunConfiguration> selectedRunConfiguration =
m_runConfigurationsModel->runConfigurations().at(index);
// Update the run configuration configuration widget
delete m_runConfigurationWidget;
......@@ -294,12 +308,17 @@ void RunSettingsWidget::activateRunConfiguration(int index)
m_ui->groupBox->layout()->addWidget(m_runConfigurationWidget);
}
void RunSettingsWidget::activateRunConfiguration(int index)
{
m_project->setActiveRunConfiguration(m_enabledRunConfigurationsModel->runConfigurations().at(index));
}
void RunSettingsWidget::activeRunConfigurationChanged()
{
QSharedPointer<RunConfiguration> active = m_project->activeRunConfiguration();
delete m_runConfigurationWidget;
m_runConfigurationWidget = active->configurationWidget();
m_ui->groupBox->layout()->addWidget(m_runConfigurationWidget);
int index = m_enabledRunConfigurationsModel->runConfigurations().indexOf(active);
if (index >= 0)
m_ui->activeRunConfigurationCombo->setCurrentIndex(index);
}
void RunSettingsWidget::nameChanged()
......
......@@ -72,16 +72,18 @@ public:
~RunSettingsWidget();
private slots:
void activateRunConfiguration(int index);
void showRunConfigurationWidget(int index);
void aboutToShowAddMenu();
void addRunConfiguration();
void removeRunConfiguration();
void nameChanged();
void initRunConfigurationComboBox();
void activateRunConfiguration(int index);
void activeRunConfigurationChanged();
private:
Project *m_project;
RunConfigurationsModel *m_runConfigurationsModel;
RunConfigurationsModel *m_enabledRunConfigurationsModel;
Ui::RunSettingsPropertiesPage *m_ui;
QWidget *m_runConfigurationWidget;
QMenu *m_addMenu;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment