forked from qt-creator/qt-creator
Make use of ProjectConfiguration in RunConfigurations
Reviewed-by: dt
This commit is contained in:
@@ -35,8 +35,6 @@ namespace Constants {
|
||||
|
||||
const char * const PROJECTCONTEXT = "CMakeProject.ProjectContext";
|
||||
const char * const CMAKEMIMETYPE = "text/x-cmake"; // TOOD check that this is correct
|
||||
const char * const CMAKERUNCONFIGURATION = "CMakeProjectManager.CMakeRunConfiguration";
|
||||
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace CMakeProjectManager
|
||||
|
||||
@@ -57,8 +57,8 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
|
||||
CMakeSettingsPage *cmp = new CMakeSettingsPage();
|
||||
addAutoReleasedObject(cmp);
|
||||
addAutoReleasedObject(new CMakeManager(cmp));
|
||||
addAutoReleasedObject(new MakeStepFactory());
|
||||
addAutoReleasedObject(new CMakeRunConfigurationFactory());
|
||||
addAutoReleasedObject(new MakeStepFactory);
|
||||
addAutoReleasedObject(new CMakeRunConfigurationFactory);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,23 +46,68 @@
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title)
|
||||
: ProjectExplorer::LocalApplicationRunConfiguration(pro)
|
||||
, m_runMode(Gui)
|
||||
, m_target(target)
|
||||
, m_workingDirectory(workingDirectory)
|
||||
, m_title(title)
|
||||
, m_baseEnvironmentBase(CMakeRunConfiguration::BuildEnvironmentBase)
|
||||
{
|
||||
setDisplayName(title);
|
||||
namespace {
|
||||
const char * const CMAKE_RC_ID("CMakeProjectManager.CMakeRunConfiguration");
|
||||
const char * const CMAKE_RC_PREFIX("CMakeProjectManager.CMakeRunConfiguration.");
|
||||
|
||||
connect(pro, SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
const char * const TARGET_KEY("CMakeProjectManager.CMakeRunConfiguration.Target");
|
||||
const char * const WORKING_DIRECTORY_KEY("CMakeProjectManager.CMakeRunConfiguration.WorkingDirectory");
|
||||
const char * const USER_WORKING_DIRECTORY_KEY("CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory");
|
||||
const char * const USE_TERMINAL_KEY("CMakeProjectManager.CMakeRunConfiguration.UseTerminal");
|
||||
const char * const TITLE_KEY("CMakeProjectManager.CMakeRunConfiguation.Title");
|
||||
const char * const ARGUMENTS_KEY("CMakeProjectManager.CMakeRunConfiguration.Arguments");
|
||||
const char * const USER_ENVIRONMENT_CHANGES_KEY("CMakeProjectManager.CMakeRunConfiguration.UserEnvironmentChanges");
|
||||
const char * const BASE_ENVIRONMENT_BASE_KEY("CMakeProjectManager.BaseEnvironmentBase");
|
||||
|
||||
QString targetFromId(const QString &id)
|
||||
{
|
||||
if (!id.startsWith(QLatin1String(CMAKE_RC_PREFIX)))
|
||||
return QString();
|
||||
return id.mid(QString::fromLatin1(CMAKE_RC_PREFIX).length());
|
||||
}
|
||||
|
||||
QString idFromTarget(const QString &target)
|
||||
{
|
||||
return QString::fromLatin1(CMAKE_RC_PREFIX) + target;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title) :
|
||||
ProjectExplorer::LocalApplicationRunConfiguration(pro, QString::fromLatin1(CMAKE_RC_PREFIX)),
|
||||
m_runMode(Gui),
|
||||
m_target(target),
|
||||
m_workingDirectory(workingDirectory),
|
||||
m_title(title),
|
||||
m_baseEnvironmentBase(CMakeRunConfiguration::BuildEnvironmentBase)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, CMakeRunConfiguration *source) :
|
||||
ProjectExplorer::LocalApplicationRunConfiguration(pro, source),
|
||||
m_runMode(source->m_runMode),
|
||||
m_target(source->m_target),
|
||||
m_workingDirectory(source->m_workingDirectory),
|
||||
m_userWorkingDirectory(source->m_userWorkingDirectory),
|
||||
m_title(source->m_title),
|
||||
m_arguments(source->m_arguments),
|
||||
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
|
||||
m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
CMakeRunConfiguration::~CMakeRunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
void CMakeRunConfiguration::ctor()
|
||||
{
|
||||
setDisplayName(m_title);
|
||||
|
||||
connect(project(), SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
}
|
||||
|
||||
CMakeProject *CMakeRunConfiguration::cmakeProject() const
|
||||
@@ -70,11 +115,6 @@ CMakeProject *CMakeRunConfiguration::cmakeProject() const
|
||||
return static_cast<CMakeProject *>(project());
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::id() const
|
||||
{
|
||||
return Constants::CMAKERUNCONFIGURATION;
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::executable() const
|
||||
{
|
||||
return m_target;
|
||||
@@ -129,32 +169,34 @@ void CMakeRunConfiguration::setUserWorkingDirectory(const QString &wd)
|
||||
emit workingDirectoryChanged(newWorkingDirectory);
|
||||
}
|
||||
|
||||
void CMakeRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer) const
|
||||
QVariantMap CMakeRunConfiguration::toMap() const
|
||||
{
|
||||
ProjectExplorer::LocalApplicationRunConfiguration::save(writer);
|
||||
writer.saveValue("CMakeRunConfiguration.Target", m_target);
|
||||
writer.saveValue("CMakeRunConfiguration.WorkingDirectory", m_workingDirectory);
|
||||
writer.saveValue("CMakeRunConfiguration.UserWorkingDirectory", m_userWorkingDirectory);
|
||||
writer.saveValue("CMakeRunConfiguration.UseTerminal", m_runMode == Console);
|
||||
writer.saveValue("CMakeRunConfiguation.Title", m_title);
|
||||
writer.saveValue("CMakeRunConfiguration.Arguments", m_arguments);
|
||||
writer.saveValue("CMakeRunConfiguration.UserEnvironmentChanges", ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||
writer.saveValue("BaseEnvironmentBase", m_baseEnvironmentBase);
|
||||
QVariantMap map(ProjectExplorer::LocalApplicationRunConfiguration::toMap());
|
||||
|
||||
map.insert(QLatin1String(TARGET_KEY), m_target);
|
||||
map.insert(QLatin1String(WORKING_DIRECTORY_KEY), m_workingDirectory);
|
||||
map.insert(QLatin1String(USER_WORKING_DIRECTORY_KEY), m_userWorkingDirectory);
|
||||
map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console);
|
||||
map.insert(QLatin1String(TITLE_KEY), m_title);
|
||||
map.insert(QLatin1String(ARGUMENTS_KEY), m_arguments);
|
||||
map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||
map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), m_baseEnvironmentBase);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
void CMakeRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReader &reader)
|
||||
bool CMakeRunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
ProjectExplorer::LocalApplicationRunConfiguration::restore(reader);
|
||||
m_target = reader.restoreValue("CMakeRunConfiguration.Target").toString();
|
||||
m_workingDirectory = reader.restoreValue("CMakeRunConfiguration.WorkingDirectory").toString();
|
||||
m_userWorkingDirectory = reader.restoreValue("CMakeRunConfiguration.UserWorkingDirectory").toString();
|
||||
m_runMode = reader.restoreValue("CMakeRunConfiguration.UseTerminal").toBool() ? Console : Gui;
|
||||
m_title = reader.restoreValue("CMakeRunConfiguation.Title").toString();
|
||||
m_arguments = reader.restoreValue("CMakeRunConfiguration.Arguments").toString();
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(reader.restoreValue("CMakeRunConfiguration.UserEnvironmentChanges").toStringList());
|
||||
QVariant tmp = reader.restoreValue("BaseEnvironmentBase");
|
||||
m_baseEnvironmentBase = tmp.isValid() ? BaseEnvironmentBase(tmp.toInt()) : CMakeRunConfiguration::BuildEnvironmentBase;
|
||||
m_target = map.value(QLatin1String(TARGET_KEY)).toString();
|
||||
m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString();
|
||||
m_userWorkingDirectory = map.value(QLatin1String(USER_WORKING_DIRECTORY_KEY)).toString();
|
||||
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui;
|
||||
m_title = map.value(QLatin1String(TITLE_KEY)).toString();
|
||||
m_arguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString();
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CMakeRunConfiguration::BuildEnvironmentBase)).toInt());
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QWidget *CMakeRunConfiguration::configurationWidget()
|
||||
@@ -406,61 +448,84 @@ void CMakeRunConfigurationWidget::updateSummary()
|
||||
|
||||
|
||||
// Factory
|
||||
CMakeRunConfigurationFactory::CMakeRunConfigurationFactory()
|
||||
CMakeRunConfigurationFactory::CMakeRunConfigurationFactory(QObject *parent) :
|
||||
ProjectExplorer::IRunConfigurationFactory(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CMakeRunConfigurationFactory::~CMakeRunConfigurationFactory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
bool CMakeRunConfigurationFactory::canRestore(const QString &id) const
|
||||
{
|
||||
if (id.startsWith(Constants::CMAKERUNCONFIGURATION))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// used to show the list of possible additons to a project, returns a list of ids
|
||||
QStringList CMakeRunConfigurationFactory::availableCreationIds(ProjectExplorer::Project *project) const
|
||||
QStringList CMakeRunConfigurationFactory::availableCreationIds(ProjectExplorer::Project *parent) const
|
||||
{
|
||||
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||
if (!pro)
|
||||
CMakeProject *project(qobject_cast<CMakeProject *>(parent));
|
||||
if (!project)
|
||||
return QStringList();
|
||||
QStringList allTargets = pro->targets();
|
||||
for (int i=0; i<allTargets.size(); ++i) {
|
||||
allTargets[i] = Constants::CMAKERUNCONFIGURATION + allTargets[i];
|
||||
}
|
||||
return allTargets;
|
||||
QStringList allIds;
|
||||
foreach (const QString &target, project->targets())
|
||||
allIds << idFromTarget(target);
|
||||
return allIds;
|
||||
}
|
||||
|
||||
// used to translate the ids to names to display to the user
|
||||
QString CMakeRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
Q_ASSERT(id.startsWith(Constants::CMAKERUNCONFIGURATION));
|
||||
|
||||
if (id == Constants::CMAKERUNCONFIGURATION)
|
||||
return "CMake"; // Doesn't happen
|
||||
else
|
||||
return id.mid(QString(Constants::CMAKERUNCONFIGURATION).length());
|
||||
return targetFromId(id);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration* CMakeRunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &id)
|
||||
bool CMakeRunConfigurationFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const
|
||||
{
|
||||
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||
Q_ASSERT(pro);
|
||||
if (id == Constants::CMAKERUNCONFIGURATION) {
|
||||
// Restoring, filename will be added by restoreSettings
|
||||
ProjectExplorer::RunConfiguration* rc = new CMakeRunConfiguration(pro, QString::null, QString::null, QString::null);
|
||||
return rc;
|
||||
} else {
|
||||
// Adding new
|
||||
const QString title = id.mid(QString(Constants::CMAKERUNCONFIGURATION).length());
|
||||
const CMakeTarget &ct = pro->targetForTitle(title);
|
||||
ProjectExplorer::RunConfiguration * rc = new CMakeRunConfiguration(pro, ct.executable, ct.workingDirectory, ct.title);
|
||||
return rc;
|
||||
}
|
||||
CMakeProject *project(qobject_cast<CMakeProject *>(parent));
|
||||
if (!project)
|
||||
return false;
|
||||
return project->hasTarget(targetFromId(id));
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::create(ProjectExplorer::Project *parent, const QString &id)
|
||||
{
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
CMakeProject *project(static_cast<CMakeProject *>(parent));
|
||||
|
||||
const QString title(targetFromId(id));
|
||||
const CMakeTarget &ct = project->targetForTitle(title);
|
||||
return new CMakeRunConfiguration(project, ct.executable, ct.workingDirectory, ct.title);
|
||||
}
|
||||
|
||||
bool CMakeRunConfigurationFactory::canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const
|
||||
{
|
||||
if (!qobject_cast<CMakeProject *>(parent))
|
||||
return false;
|
||||
return source->id() == QLatin1String(CMAKE_RC_ID);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration * source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
CMakeProject *project(static_cast<CMakeProject *>(parent));
|
||||
CMakeRunConfiguration *crc(static_cast<CMakeRunConfiguration *>(source));
|
||||
return new CMakeRunConfiguration(project, crc);
|
||||
}
|
||||
|
||||
bool CMakeRunConfigurationFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const
|
||||
{
|
||||
if (!qobject_cast<CMakeProject *>(parent))
|
||||
return false;
|
||||
QString id(ProjectExplorer::idFromMap(map));
|
||||
return id.startsWith(QLatin1String(CMAKE_RC_ID));
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
CMakeProject *project(static_cast<CMakeProject *>(parent));
|
||||
CMakeRunConfiguration *rc(new CMakeRunConfiguration(project, QString(), QString(), QString()));
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -48,20 +48,23 @@ class CMakeProject;
|
||||
|
||||
class CMakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
||||
{
|
||||
friend class CMakeRunConfigurationWidget;
|
||||
Q_OBJECT
|
||||
friend class CMakeRunConfigurationWidget;
|
||||
friend class CMakeRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title);
|
||||
virtual ~CMakeRunConfiguration();
|
||||
CMakeRunConfiguration(CMakeProject *project, const QString &target,
|
||||
const QString &workingDirectory, const QString &title);
|
||||
~CMakeRunConfiguration();
|
||||
|
||||
CMakeProject *cmakeProject() const;
|
||||
|
||||
virtual QString id() const;
|
||||
virtual QString executable() const;
|
||||
virtual RunMode runMode() const;
|
||||
virtual QString workingDirectory() const;
|
||||
virtual QStringList commandLineArguments() const;
|
||||
virtual ProjectExplorer::Environment environment() const;
|
||||
virtual QWidget *configurationWidget();
|
||||
QString executable() const;
|
||||
RunMode runMode() const;
|
||||
QString workingDirectory() const;
|
||||
QStringList commandLineArguments() const;
|
||||
ProjectExplorer::Environment environment() const;
|
||||
QWidget *configurationWidget();
|
||||
|
||||
void setExecutable(const QString &executable);
|
||||
void setWorkingDirectory(const QString &workingDirectory);
|
||||
@@ -70,11 +73,11 @@ public:
|
||||
|
||||
QString title() const;
|
||||
|
||||
virtual void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
|
||||
virtual void restore(const ProjectExplorer::PersistentSettingsReader &reader);
|
||||
virtual QString dumperLibrary() const;
|
||||
virtual QStringList dumperLibraryLocations() const;
|
||||
virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||
QString dumperLibrary() const;
|
||||
QStringList dumperLibraryLocations() const;
|
||||
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||
|
||||
QVariantMap toMap() const;
|
||||
|
||||
signals:
|
||||
void baseEnvironmentChanged();
|
||||
@@ -83,7 +86,14 @@ signals:
|
||||
|
||||
private slots:
|
||||
void setArguments(const QString &newText);
|
||||
|
||||
protected:
|
||||
CMakeRunConfiguration(CMakeProject *project, CMakeRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
||||
SystemEnvironmentBase = 1,
|
||||
BuildEnvironmentBase = 2};
|
||||
@@ -110,6 +120,7 @@ class CMakeRunConfigurationWidget : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
CMakeRunConfigurationWidget(CMakeRunConfiguration *cmakeRunConfiguration, QWidget *parent = 0);
|
||||
|
||||
private slots:
|
||||
void setArguments(const QString &args);
|
||||
void baseEnvironmentChanged();
|
||||
@@ -117,10 +128,13 @@ private slots:
|
||||
void userChangesChanged();
|
||||
void setWorkingDirectory();
|
||||
void resetWorkingDirectory();
|
||||
|
||||
private slots:
|
||||
void baseEnvironmentComboBoxChanged(int index);
|
||||
void workingDirectoryChanged(const QString &workingDirectory);
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
void updateSummary();
|
||||
bool m_ignoreChange;
|
||||
CMakeRunConfiguration *m_cmakeRunConfiguration;
|
||||
@@ -133,18 +147,23 @@ private:
|
||||
class CMakeRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CMakeRunConfigurationFactory();
|
||||
virtual ~CMakeRunConfigurationFactory();
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
virtual bool canRestore(const QString &id) const;
|
||||
// used to show the list of possible additons to a project, returns a list of types
|
||||
virtual QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
|
||||
// used to translate the types to names to display to the user
|
||||
virtual QString displayNameForId(const QString &id) const;
|
||||
virtual ProjectExplorer::RunConfiguration* create(ProjectExplorer::Project *project, const QString &id);
|
||||
};
|
||||
|
||||
public:
|
||||
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
|
||||
~CMakeRunConfigurationFactory();
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
bool canCreate(ProjectExplorer::Project *project, const QString &id) const;
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
|
||||
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
|
||||
bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *product) const;
|
||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *product);
|
||||
|
||||
// used to show the list of possible additons to a project, returns a list of types
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
|
||||
// used to translate the types to names to display to the user
|
||||
QString displayNameForId(const QString &id) const;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "applicationrunconfiguration.h"
|
||||
#include "persistentsettings.h"
|
||||
|
||||
#include "environment.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -36,16 +36,19 @@
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QTextDocument>
|
||||
#include <QDebug>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
/// LocalApplicationRunConfiguration
|
||||
|
||||
LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Project *pro)
|
||||
: RunConfiguration(pro)
|
||||
LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Project *project, const QString &id) :
|
||||
RunConfiguration(project, id)
|
||||
{
|
||||
}
|
||||
|
||||
LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Project *project, LocalApplicationRunConfiguration *rc) :
|
||||
RunConfiguration(project, rc)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -53,21 +56,6 @@ LocalApplicationRunConfiguration::~LocalApplicationRunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
QString LocalApplicationRunConfiguration::id() const
|
||||
{
|
||||
return "ProjectExplorer.LocalApplicationRunConfiguration";
|
||||
}
|
||||
|
||||
void LocalApplicationRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
{
|
||||
RunConfiguration::save(writer);
|
||||
}
|
||||
|
||||
void LocalApplicationRunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
{
|
||||
RunConfiguration::restore(reader);
|
||||
}
|
||||
|
||||
/// LocalApplicationRunControlFactory
|
||||
|
||||
LocalApplicationRunControlFactory::LocalApplicationRunControlFactory()
|
||||
|
||||
@@ -48,9 +48,7 @@ public:
|
||||
Gui
|
||||
};
|
||||
|
||||
LocalApplicationRunConfiguration(Project *pro);
|
||||
virtual ~LocalApplicationRunConfiguration();
|
||||
virtual QString id() const;
|
||||
virtual QString executable() const = 0;
|
||||
virtual RunMode runMode() const = 0;
|
||||
virtual QString workingDirectory() const = 0;
|
||||
@@ -60,8 +58,9 @@ public:
|
||||
virtual QStringList dumperLibraryLocations() const = 0;
|
||||
virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const = 0;
|
||||
|
||||
virtual void save(PersistentSettingsWriter &writer) const;
|
||||
virtual void restore(const PersistentSettingsReader &reader);
|
||||
protected:
|
||||
LocalApplicationRunConfiguration(Project *project, const QString &id);
|
||||
LocalApplicationRunConfiguration(Project *project, LocalApplicationRunConfiguration *rc);
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
||||
@@ -30,30 +30,42 @@
|
||||
#include "customexecutablerunconfiguration.h"
|
||||
#include "environment.h"
|
||||
#include "project.h"
|
||||
#include "persistentsettings.h"
|
||||
#include "environmenteditmodel.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <projectexplorer/debugginghelper.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/environmenteditmodel.h>
|
||||
#include <projectexplorer/debugginghelper.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QFormLayout>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QDialogButtonBox>
|
||||
#include <QtGui/QFormLayout>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QMainWindow>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
namespace {
|
||||
const char * const CUSTOM_EXECUTABLE_ID("ProjectExplorer.CustomExecutableRunConfiguration");
|
||||
|
||||
const char * const EXECUTABLE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Executable");
|
||||
const char * const ARGUMENTS_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Arguments");
|
||||
const char * const WORKING_DIRECTORY_KEY("ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory");
|
||||
const char * const USE_TERMINAL_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal");
|
||||
const char * const USER_SET_NAME_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UserSetName");
|
||||
const char * const USER_NAME_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UserName");
|
||||
const char * const USER_ENVIRONMENT_CHANGES_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges");
|
||||
const char * const BASE_ENVIRONMENT_BASE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase");
|
||||
|
||||
const char * const DEFAULT_WORKING_DIR("$BUILDDIR");
|
||||
}
|
||||
|
||||
class CustomDirectoryPathChooser : public Utils::PathChooser
|
||||
{
|
||||
public:
|
||||
@@ -245,19 +257,16 @@ void CustomExecutableConfigurationWidget::changed()
|
||||
m_userName->setText(m_runConfiguration->userName());
|
||||
}
|
||||
|
||||
CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro)
|
||||
: LocalApplicationRunConfiguration(pro),
|
||||
m_runMode(Gui),
|
||||
m_userSetName(false),
|
||||
m_baseEnvironmentBase(CustomExecutableRunConfiguration::BuildEnvironmentBase)
|
||||
void CustomExecutableRunConfiguration::ctor()
|
||||
{
|
||||
m_workingDirectory = "$BUILDDIR";
|
||||
setDisplayName(tr("Custom Executable"));
|
||||
|
||||
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
|
||||
if (m_userSetName)
|
||||
setDisplayName(m_userName);
|
||||
else
|
||||
setDisplayName(tr("Custom Executable"));
|
||||
connect(project(), SIGNAL(activeBuildConfigurationChanged()),
|
||||
this, SLOT(activeBuildConfigurationChanged()));
|
||||
|
||||
m_lastActiveBuildConfiguration = pro->activeBuildConfiguration();
|
||||
m_lastActiveBuildConfiguration = activeBuildConfiguration();
|
||||
|
||||
if (m_lastActiveBuildConfiguration) {
|
||||
connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()),
|
||||
@@ -265,6 +274,30 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro)
|
||||
}
|
||||
}
|
||||
|
||||
CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *project) :
|
||||
LocalApplicationRunConfiguration(project, QLatin1String(CUSTOM_EXECUTABLE_ID)),
|
||||
m_runMode(Gui),
|
||||
m_userSetName(false),
|
||||
m_baseEnvironmentBase(CustomExecutableRunConfiguration::BuildEnvironmentBase)
|
||||
{
|
||||
m_workingDirectory = QLatin1String(DEFAULT_WORKING_DIR);
|
||||
ctor();
|
||||
}
|
||||
|
||||
CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *project, CustomExecutableRunConfiguration *source) :
|
||||
LocalApplicationRunConfiguration(project, source),
|
||||
m_executable(source->m_executable),
|
||||
m_workingDirectory(source->m_workingDirectory),
|
||||
m_cmdArguments(source->m_cmdArguments),
|
||||
m_runMode(source->m_runMode),
|
||||
m_userSetName(source->m_userSetName),
|
||||
m_userName(source->m_userName),
|
||||
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
|
||||
m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
|
||||
{
|
||||
}
|
||||
@@ -275,18 +308,13 @@ void CustomExecutableRunConfiguration::activeBuildConfigurationChanged()
|
||||
disconnect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
}
|
||||
m_lastActiveBuildConfiguration = project()->activeBuildConfiguration();
|
||||
m_lastActiveBuildConfiguration = activeBuildConfiguration();
|
||||
if (m_lastActiveBuildConfiguration) {
|
||||
connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomExecutableRunConfiguration::id() const
|
||||
{
|
||||
return "ProjectExplorer.CustomExecutableRunConfiguration";
|
||||
}
|
||||
|
||||
QString CustomExecutableRunConfiguration::baseExecutable() const
|
||||
{
|
||||
return m_executable;
|
||||
@@ -301,7 +329,7 @@ QString CustomExecutableRunConfiguration::executable() const
|
||||
{
|
||||
QString exec;
|
||||
if (QDir::isRelativePath(m_executable)) {
|
||||
Environment env = project()->activeBuildConfiguration()->environment();
|
||||
Environment env = activeBuildConfiguration()->environment();
|
||||
exec = env.searchInPath(m_executable);
|
||||
if (exec.isEmpty())
|
||||
exec = QDir::cleanPath(workingDirectory() + "/" + m_executable);
|
||||
@@ -333,7 +361,7 @@ QString CustomExecutableRunConfiguration::executable() const
|
||||
that->m_workingDirectory = oldWorkingDirectory;
|
||||
that->m_cmdArguments = oldCmdArguments;
|
||||
emit that->changed();
|
||||
return QString::null;
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
return exec;
|
||||
@@ -352,7 +380,7 @@ QString CustomExecutableRunConfiguration::baseWorkingDirectory() const
|
||||
QString CustomExecutableRunConfiguration::workingDirectory() const
|
||||
{
|
||||
QString wd = m_workingDirectory;
|
||||
QString bd = project()->activeBuildConfiguration()->buildDirectory();
|
||||
QString bd = activeBuildConfiguration()->buildDirectory();
|
||||
return wd.replace("$BUILDDIR", QDir::cleanPath(bd));
|
||||
}
|
||||
|
||||
@@ -381,7 +409,7 @@ ProjectExplorer::Environment CustomExecutableRunConfiguration::baseEnvironment()
|
||||
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) {
|
||||
env = ProjectExplorer::Environment::systemEnvironment();
|
||||
} else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) {
|
||||
env = project()->activeBuildConfiguration()->environment();
|
||||
env = activeBuildConfiguration()->environment();
|
||||
}
|
||||
return env;
|
||||
}
|
||||
@@ -419,31 +447,32 @@ void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList<Pro
|
||||
}
|
||||
}
|
||||
|
||||
void CustomExecutableRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
QVariantMap CustomExecutableRunConfiguration::toMap() const
|
||||
{
|
||||
writer.saveValue("Executable", m_executable);
|
||||
writer.saveValue("Arguments", m_cmdArguments);
|
||||
writer.saveValue("WorkingDirectory", m_workingDirectory);
|
||||
writer.saveValue("UseTerminal", m_runMode == Console);
|
||||
writer.saveValue("UserSetName", m_userSetName);
|
||||
writer.saveValue("UserName", m_userName);
|
||||
writer.saveValue("UserEnvironmentChanges", ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||
writer.saveValue("BaseEnvironmentBase", m_baseEnvironmentBase);
|
||||
LocalApplicationRunConfiguration::save(writer);
|
||||
QVariantMap map(LocalApplicationRunConfiguration::toMap());
|
||||
map.insert(QLatin1String(EXECUTABLE_KEY), m_executable);
|
||||
map.insert(QLatin1String(ARGUMENTS_KEY), m_cmdArguments);
|
||||
map.insert(QLatin1String(WORKING_DIRECTORY_KEY), m_workingDirectory);
|
||||
map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console);
|
||||
map.insert(QLatin1String(USER_SET_NAME_KEY), m_userSetName);
|
||||
map.insert(QLatin1String(USER_NAME_KEY), m_userName);
|
||||
map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||
map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(m_baseEnvironmentBase));
|
||||
return map;
|
||||
}
|
||||
|
||||
void CustomExecutableRunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
m_executable = reader.restoreValue("Executable").toString();
|
||||
m_cmdArguments = reader.restoreValue("Arguments").toStringList();
|
||||
m_workingDirectory = reader.restoreValue("WorkingDirectory").toString();
|
||||
m_runMode = reader.restoreValue("UseTerminal").toBool() ? Console : Gui;
|
||||
m_userSetName = reader.restoreValue("UserSetName").toBool();
|
||||
m_userName = reader.restoreValue("UserName").toString();
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(reader.restoreValue("UserEnvironmentChanges").toStringList());
|
||||
LocalApplicationRunConfiguration::restore(reader);
|
||||
QVariant tmp = reader.restoreValue("BaseEnvironmentBase");
|
||||
m_baseEnvironmentBase = tmp.isValid() ? BaseEnvironmentBase(tmp.toInt()) : CustomExecutableRunConfiguration::BuildEnvironmentBase;
|
||||
m_executable = map.value(QLatin1String(EXECUTABLE_KEY)).toString();
|
||||
m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toStringList();
|
||||
m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString();
|
||||
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui;
|
||||
m_userSetName = map.value(QLatin1String(USER_SET_NAME_KEY)).toBool();
|
||||
m_userName = map.value(QLatin1String(USER_NAME_KEY)).toString();
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt());
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
void CustomExecutableRunConfiguration::setExecutable(const QString &executable)
|
||||
@@ -512,7 +541,8 @@ ProjectExplorer::ToolChain::ToolChainType CustomExecutableRunConfiguration::tool
|
||||
|
||||
// Factory
|
||||
|
||||
CustomExecutableRunConfigurationFactory::CustomExecutableRunConfigurationFactory()
|
||||
CustomExecutableRunConfigurationFactory::CustomExecutableRunConfigurationFactory(QObject *parent) :
|
||||
ProjectExplorer::IRunConfigurationFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -521,33 +551,60 @@ CustomExecutableRunConfigurationFactory::~CustomExecutableRunConfigurationFactor
|
||||
|
||||
}
|
||||
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
bool CustomExecutableRunConfigurationFactory::canRestore(const QString &id) const
|
||||
bool CustomExecutableRunConfigurationFactory::canCreate(Project *project, const QString &id) const
|
||||
{
|
||||
return id == "ProjectExplorer.CustomExecutableRunConfiguration";
|
||||
Q_UNUSED(project);
|
||||
return id == QLatin1String(CUSTOM_EXECUTABLE_ID);
|
||||
}
|
||||
|
||||
RunConfiguration* CustomExecutableRunConfigurationFactory::create(Project *project, const QString &id)
|
||||
RunConfiguration *CustomExecutableRunConfigurationFactory::create(Project *project, const QString &id)
|
||||
{
|
||||
if (id == "ProjectExplorer.CustomExecutableRunConfiguration") {
|
||||
RunConfiguration* rc = new CustomExecutableRunConfiguration(project);
|
||||
rc->setDisplayName(tr("Custom Executable"));
|
||||
return rc;
|
||||
} else {
|
||||
if (!canCreate(project, id))
|
||||
return 0;
|
||||
}
|
||||
|
||||
RunConfiguration *rc(new CustomExecutableRunConfiguration(project));
|
||||
rc->setDisplayName(tr("Custom Executable"));
|
||||
return rc;
|
||||
}
|
||||
|
||||
QStringList CustomExecutableRunConfigurationFactory::availableCreationIds(Project *pro) const
|
||||
bool CustomExecutableRunConfigurationFactory::canRestore(Project *project, const QVariantMap &map) const
|
||||
{
|
||||
Q_UNUSED(pro)
|
||||
return QStringList()<< "ProjectExplorer.CustomExecutableRunConfiguration";
|
||||
QString id(idFromMap(map));
|
||||
return canCreate(project, id);
|
||||
}
|
||||
|
||||
RunConfiguration *CustomExecutableRunConfigurationFactory::restore(Project *project, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(project, map))
|
||||
return 0;
|
||||
CustomExecutableRunConfiguration *rc(new CustomExecutableRunConfiguration(project));
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CustomExecutableRunConfigurationFactory::canClone(Project *parent, RunConfiguration *source) const
|
||||
{
|
||||
return canCreate(parent, source->id());
|
||||
}
|
||||
|
||||
RunConfiguration *CustomExecutableRunConfigurationFactory::clone(Project *parent, RunConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
return new CustomExecutableRunConfiguration(parent, static_cast<CustomExecutableRunConfiguration*>(source));
|
||||
}
|
||||
|
||||
QStringList CustomExecutableRunConfigurationFactory::availableCreationIds(Project *project) const
|
||||
{
|
||||
Q_UNUSED(project)
|
||||
return QStringList() << QLatin1String(CUSTOM_EXECUTABLE_ID);
|
||||
}
|
||||
|
||||
QString CustomExecutableRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
if (id == "ProjectExplorer.CustomExecutableRunConfiguration")
|
||||
if (id == QLatin1String(CUSTOM_EXECUTABLE_ID))
|
||||
return tr("Custom Executable");
|
||||
else
|
||||
return QString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#define CUSTOMEXECUTABLERUNCONFIGURATION_H
|
||||
|
||||
#include "applicationrunconfiguration.h"
|
||||
|
||||
#include <QtCore/QVariantMap>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -49,25 +51,27 @@ class PathChooser;
|
||||
namespace ProjectExplorer {
|
||||
class EnvironmentWidget;
|
||||
namespace Internal {
|
||||
class CustomExecutableConfigurationWidget;
|
||||
class CustomExecutableConfigurationWidget;
|
||||
}
|
||||
|
||||
class CustomExecutableRunConfigurationFactory;
|
||||
|
||||
class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public LocalApplicationRunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
// the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments
|
||||
friend class Internal::CustomExecutableConfigurationWidget;
|
||||
Q_OBJECT
|
||||
friend class CustomExecutableRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
CustomExecutableRunConfiguration(Project *pro);
|
||||
explicit CustomExecutableRunConfiguration(Project *project);
|
||||
~CustomExecutableRunConfiguration();
|
||||
virtual QString id() const;
|
||||
|
||||
/**
|
||||
* Returns the executable, looks in the environment for it and might even
|
||||
* ask the user if none is specified
|
||||
*/
|
||||
virtual QString executable() const;
|
||||
QString executable() const;
|
||||
|
||||
/**
|
||||
* Returns only what is stored in the internal variable, not what we might
|
||||
@@ -81,20 +85,19 @@ public:
|
||||
*/
|
||||
QString userName() const;
|
||||
|
||||
virtual LocalApplicationRunConfiguration::RunMode runMode() const;
|
||||
virtual QString workingDirectory() const;
|
||||
LocalApplicationRunConfiguration::RunMode runMode() const;
|
||||
QString workingDirectory() const;
|
||||
QString baseWorkingDirectory() const;
|
||||
virtual QStringList commandLineArguments() const;
|
||||
virtual Environment environment() const;
|
||||
QStringList commandLineArguments() const;
|
||||
Environment environment() const;
|
||||
|
||||
virtual void save(PersistentSettingsWriter &writer) const;
|
||||
virtual void restore(const PersistentSettingsReader &reader);
|
||||
QWidget *configurationWidget();
|
||||
QString dumperLibrary() const;
|
||||
QStringList dumperLibraryLocations() const;
|
||||
|
||||
virtual QWidget *configurationWidget();
|
||||
virtual QString dumperLibrary() const;
|
||||
virtual QStringList dumperLibraryLocations() const;
|
||||
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||
|
||||
virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||
QVariantMap toMap() const;
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
@@ -105,7 +108,13 @@ signals:
|
||||
private slots:
|
||||
void activeBuildConfigurationChanged();
|
||||
|
||||
protected:
|
||||
CustomExecutableRunConfiguration(Project *project, CustomExecutableRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
|
||||
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
||||
SystemEnvironmentBase = 1,
|
||||
BuildEnvironmentBase = 2};
|
||||
@@ -137,13 +146,18 @@ class CustomExecutableRunConfigurationFactory : public IRunConfigurationFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomExecutableRunConfigurationFactory();
|
||||
virtual ~CustomExecutableRunConfigurationFactory();
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
virtual bool canRestore(const QString &id) const;
|
||||
virtual RunConfiguration* create(Project *project, const QString &id);
|
||||
QStringList availableCreationIds(Project *pro) const;
|
||||
explicit CustomExecutableRunConfigurationFactory(QObject *parent = 0);
|
||||
~CustomExecutableRunConfigurationFactory();
|
||||
|
||||
QStringList availableCreationIds(Project *project) const;
|
||||
QString displayNameForId(const QString &id) const;
|
||||
|
||||
bool canCreate(Project *project, const QString &id) const;
|
||||
RunConfiguration *create(Project *project, const QString &id);
|
||||
bool canRestore(Project *project, const QVariantMap &map) const;
|
||||
RunConfiguration *restore(Project *project, const QVariantMap &map);
|
||||
bool canClone(Project *parent, RunConfiguration *product) const;
|
||||
RunConfiguration *clone(Project *parent, RunConfiguration *source);
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
||||
@@ -168,9 +168,7 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer)
|
||||
int i = 0;
|
||||
int activeId = 0;
|
||||
foreach (RunConfiguration* rc, m_runConfigurations) {
|
||||
writer.setPrefix("RunConfiguration" + QString().setNum(i) + "-");
|
||||
writer.saveValue("Id", rc->id());
|
||||
rc->save(writer);
|
||||
writer.saveValue("RunConfiguration" + QString().setNum(i), rc->toMap());
|
||||
if (rc == m_activeRunConfiguration)
|
||||
activeId = i;
|
||||
++i;
|
||||
@@ -209,15 +207,14 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
const QList<IRunConfigurationFactory *> factories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>();
|
||||
forever {
|
||||
reader.setPrefix("RunConfiguration" + QString().setNum(i) + "-");
|
||||
const QVariant &idVariant = reader.restoreValue("Id");
|
||||
if (!idVariant.isValid())
|
||||
QVariantMap values(reader.restoreValue("RunConfiguration" + QString().setNum(i)).toMap());
|
||||
if (values.isEmpty())
|
||||
break;
|
||||
const QString &id = idVariant.toString();
|
||||
foreach (IRunConfigurationFactory *factory, factories) {
|
||||
if (factory->canRestore(id)) {
|
||||
RunConfiguration* rc = factory->create(this, id);
|
||||
rc->restore(reader);
|
||||
if (factory->canRestore(this, values)) {
|
||||
RunConfiguration* rc = factory->restore(this, values);
|
||||
if (!rc)
|
||||
continue;
|
||||
addRunConfiguration(rc);
|
||||
if (i == activeId)
|
||||
setActiveRunConfiguration(rc);
|
||||
@@ -225,9 +222,7 @@ bool Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
}
|
||||
++i;
|
||||
}
|
||||
reader.setPrefix(QString::null);
|
||||
|
||||
if (!m_activeRunConfiguration && !m_runConfigurations.isEmpty())
|
||||
if (!activeRunConfiguration() && !m_runConfigurations.isEmpty())
|
||||
setActiveRunConfiguration(m_runConfigurations.at(0));
|
||||
|
||||
QVariantMap tmp = reader.restoreValue(QLatin1String(EDITOR_SETTINGS_KEY)).toMap();
|
||||
|
||||
@@ -42,18 +42,28 @@
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
// RunConfiguration
|
||||
RunConfiguration::RunConfiguration(Project *project)
|
||||
: m_project(project)
|
||||
RunConfiguration::RunConfiguration(Project *project, const QString &id) :
|
||||
ProjectConfiguration(id),
|
||||
m_project(project)
|
||||
{
|
||||
Q_ASSERT(m_project);
|
||||
}
|
||||
|
||||
RunConfiguration::RunConfiguration(Project *project, RunConfiguration *source) :
|
||||
ProjectConfiguration(source),
|
||||
m_project(project)
|
||||
{
|
||||
Q_ASSERT(m_project);
|
||||
}
|
||||
|
||||
RunConfiguration::~RunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
Project *RunConfiguration::project() const
|
||||
bool RunConfiguration::isEnabled(BuildConfiguration *bc) const
|
||||
{
|
||||
return m_project.data();
|
||||
Q_UNUSED(bc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RunConfiguration::isEnabled() const
|
||||
@@ -66,32 +76,20 @@ bool RunConfiguration::isEnabled() const
|
||||
return isEnabled(m_project->activeBuildConfiguration());
|
||||
}
|
||||
|
||||
QString RunConfiguration::displayName() const
|
||||
BuildConfiguration *RunConfiguration::activeBuildConfiguration() const
|
||||
{
|
||||
return m_displayName;
|
||||
if (!project())
|
||||
return 0;
|
||||
return project()->activeBuildConfiguration();
|
||||
}
|
||||
|
||||
void RunConfiguration::setDisplayName(const QString &name)
|
||||
Project *RunConfiguration::project() const
|
||||
{
|
||||
m_displayName = name;
|
||||
emit displayNameChanged();
|
||||
return m_project;
|
||||
}
|
||||
|
||||
void RunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
{
|
||||
writer.saveValue("RunConfiguration.name", m_displayName);
|
||||
}
|
||||
|
||||
void RunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
{
|
||||
QVariant var = reader.restoreValue("RunConfiguration.name");
|
||||
if (var.isValid() && !var.toString().isEmpty())
|
||||
m_displayName = var.toString();
|
||||
}
|
||||
|
||||
|
||||
IRunConfigurationFactory::IRunConfigurationFactory(QObject *parent)
|
||||
: QObject(parent)
|
||||
IRunConfigurationFactory::IRunConfigurationFactory(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
#ifndef RUNCONFIGURATION_H
|
||||
#define RUNCONFIGURATION_H
|
||||
|
||||
#include "projectconfiguration.h"
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMetaType>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtCore/QWeakPointer>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -45,8 +44,6 @@ QT_END_NAMESPACE
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Project;
|
||||
class PersistentSettingsReader;
|
||||
class PersistentSettingsWriter;
|
||||
|
||||
class RunControl;
|
||||
class BuildConfiguration;
|
||||
@@ -62,34 +59,36 @@ class BuildConfiguration;
|
||||
* for a project, but stil be runnable via the output tab.
|
||||
|
||||
*/
|
||||
class PROJECTEXPLORER_EXPORT RunConfiguration : public QObject
|
||||
class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RunConfiguration(Project *project);
|
||||
virtual ~RunConfiguration();
|
||||
Project *project() const;
|
||||
|
||||
// The type of this RunConfiguration, e.g. "ProjectExplorer.LocalApplicationRunConfiguration"
|
||||
virtual QString id() const = 0;
|
||||
// Name shown to the user
|
||||
QString displayName() const;
|
||||
void setDisplayName(const QString &name);
|
||||
|
||||
virtual bool isEnabled(BuildConfiguration *) const { return true; }
|
||||
// Used to find out whether a runconfiguration works with the given
|
||||
// buildconfiguration.
|
||||
// Note: bc may be 0!
|
||||
virtual bool isEnabled(BuildConfiguration *bc) const;
|
||||
// Used to find out whether a runconfiguration works with the active
|
||||
// buildconfiguration.
|
||||
bool isEnabled() const;
|
||||
|
||||
// Returns the widget used to configure this run configuration. Ownership is transferred to the caller
|
||||
// rename to createConfigurationWidget
|
||||
virtual QWidget *configurationWidget() = 0;
|
||||
|
||||
virtual void save(PersistentSettingsWriter &writer) const;
|
||||
virtual void restore(const PersistentSettingsReader &reader);
|
||||
signals:
|
||||
void displayNameChanged();
|
||||
Project *project() const;
|
||||
|
||||
protected:
|
||||
RunConfiguration(Project *project, const QString &id);
|
||||
RunConfiguration(Project *project, RunConfiguration *source);
|
||||
|
||||
// convenience method to get current build configuration.
|
||||
BuildConfiguration *activeBuildConfiguration() const;
|
||||
|
||||
private:
|
||||
QPointer<Project> m_project;
|
||||
QString m_displayName;
|
||||
Project *m_project;
|
||||
};
|
||||
|
||||
/* The run configuration factory is used for restoring run configurations from
|
||||
@@ -100,20 +99,29 @@ private:
|
||||
* QString displayNameForType(const QString&) are used to generate a list of creatable
|
||||
* RunConfigurations, and create(..) is used to create it.
|
||||
*/
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject
|
||||
class PROJECTEXPLORER_EXPORT IRunConfigurationFactory :
|
||||
public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit IRunConfigurationFactory(QObject *parent = 0);
|
||||
virtual ~IRunConfigurationFactory();
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
virtual bool canRestore(const QString &id) const = 0;
|
||||
|
||||
// used to show the list of possible additons to a project, returns a list of types
|
||||
virtual QStringList availableCreationIds(Project *pro) const = 0;
|
||||
virtual QStringList availableCreationIds(Project *parent) const = 0;
|
||||
// used to translate the types to names to display to the user
|
||||
virtual QString displayNameForId(const QString &id) const = 0;
|
||||
// used to create a run configuration from scratch
|
||||
virtual RunConfiguration* create(Project *project, const QString &id) = 0;
|
||||
|
||||
virtual bool canCreate(Project *parent, const QString &id) const = 0;
|
||||
virtual RunConfiguration *create(Project *parent, const QString &id) = 0;
|
||||
virtual bool canRestore(Project *parent, const QVariantMap &map) const = 0;
|
||||
virtual RunConfiguration *restore(Project *parent, const QVariantMap &map) = 0;
|
||||
virtual bool canClone(Project *parent, RunConfiguration *product) const = 0;
|
||||
virtual RunConfiguration *clone(Project *parent, RunConfiguration *product) = 0;
|
||||
|
||||
signals:
|
||||
void availableCreationIdsChanged();
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IRunControlFactory : public QObject
|
||||
|
||||
@@ -65,9 +65,17 @@ using namespace QmlProjectManager;
|
||||
using namespace QmlProjectManager::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
enum {
|
||||
debug = false
|
||||
};
|
||||
namespace {
|
||||
const char * const QML_RC_ID("QmlProjectManager.QmlRunConfiguration");
|
||||
const char * const QML_RC_DISPLAY_NAME(QT_TRANSLATE_NOOP("QmlProjectManager::Internal::QmlRunConfiguration", "QML Viewer"));
|
||||
|
||||
const char * const QML_VIEWER_KEY("QmlProjectManager.QmlRunConfiguration.QmlViewer");
|
||||
const char * const QML_VIEWER_ARGUMENTS_KEY("QmlProjectManager.QmlRunConfiguration.QmlViewerArguments");
|
||||
const char * const QML_MAINSCRIPT_KEY("QmlProjectManager.QmlRunConfiguration.MainScript");
|
||||
const char * const QML_DEBUG_SERVER_PORT_KEY("QmlProjectManager.QmlRunConfiguration.DebugServerPort");
|
||||
|
||||
const int DEFAULT_DEBUG_SERVER_PORT(3768);
|
||||
} // namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// QmlProject
|
||||
@@ -343,18 +351,35 @@ void QmlProjectFile::modified(ReloadBehavior *)
|
||||
{
|
||||
}
|
||||
|
||||
QmlRunConfiguration::QmlRunConfiguration(QmlProject *pro)
|
||||
: ProjectExplorer::RunConfiguration(pro),
|
||||
m_project(pro),
|
||||
m_debugServerPort(3768)
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// QmlRunConfiguration
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
QmlRunConfiguration::QmlRunConfiguration(QmlProject *parent) :
|
||||
ProjectExplorer::RunConfiguration(parent, QLatin1String(QML_RC_ID)),
|
||||
m_debugServerPort(DEFAULT_DEBUG_SERVER_PORT)
|
||||
{
|
||||
setDisplayName(tr("QML Viewer"));
|
||||
ctor();
|
||||
}
|
||||
|
||||
QmlRunConfiguration::QmlRunConfiguration(QmlProject *parent, QmlRunConfiguration *source) :
|
||||
ProjectExplorer::RunConfiguration(parent, source),
|
||||
m_scriptFile(source->m_scriptFile),
|
||||
m_qmlViewerCustomPath(source->m_qmlViewerCustomPath),
|
||||
m_qmlViewerArgs(source->m_qmlViewerArgs),
|
||||
m_debugServerPort(source->m_debugServerPort)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void QmlRunConfiguration::ctor()
|
||||
{
|
||||
setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name."));
|
||||
|
||||
// prepend creator/bin dir to search path (only useful for special creator-qml package)
|
||||
const QString searchPath = QCoreApplication::applicationDirPath()
|
||||
+ Utils::SynchronousProcess::pathSeparator()
|
||||
+ QString(qgetenv("PATH"));
|
||||
|
||||
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qmlviewer"));
|
||||
}
|
||||
|
||||
@@ -362,9 +387,9 @@ QmlRunConfiguration::~QmlRunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
QString QmlRunConfiguration::id() const
|
||||
QmlProject *QmlRunConfiguration::qmlProject() const
|
||||
{
|
||||
return QLatin1String(Constants::QMLRUNCONFIGURATION);
|
||||
return static_cast<QmlProject *>(project());
|
||||
}
|
||||
|
||||
QString QmlRunConfiguration::viewerPath() const
|
||||
@@ -389,7 +414,7 @@ QStringList QmlRunConfiguration::viewerArguments() const
|
||||
|
||||
QString QmlRunConfiguration::workingDirectory() const
|
||||
{
|
||||
QFileInfo projectFile(m_project->file()->fileName());
|
||||
QFileInfo projectFile(qmlProject()->file()->fileName());
|
||||
return projectFile.absolutePath();
|
||||
}
|
||||
|
||||
@@ -405,14 +430,14 @@ QWidget *QmlRunConfiguration::configurationWidget()
|
||||
|
||||
QComboBox *combo = new QComboBox;
|
||||
|
||||
QDir projectDir = m_project->projectDir();
|
||||
QDir projectDir = qmlProject()->projectDir();
|
||||
QStringList files;
|
||||
|
||||
files.append(tr("<Current File>"));
|
||||
|
||||
int currentIndex = -1;
|
||||
|
||||
foreach (const QString &fn, m_project->files()) {
|
||||
foreach (const QString &fn, qmlProject()->files()) {
|
||||
QFileInfo fileInfo(fn);
|
||||
if (fileInfo.suffix() != QLatin1String("qml"))
|
||||
continue;
|
||||
@@ -462,7 +487,7 @@ QString QmlRunConfiguration::mainScript() const
|
||||
}
|
||||
}
|
||||
|
||||
return m_project->projectDir().absoluteFilePath(m_scriptFile);
|
||||
return qmlProject()->projectDir().absoluteFilePath(m_scriptFile);
|
||||
}
|
||||
|
||||
void QmlRunConfiguration::setMainScript(const QString &scriptFile)
|
||||
@@ -490,32 +515,33 @@ void QmlRunConfiguration::onDebugServerPortChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void QmlRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer) const
|
||||
QVariantMap QmlRunConfiguration::toMap() const
|
||||
{
|
||||
ProjectExplorer::RunConfiguration::save(writer);
|
||||
QVariantMap map(ProjectExplorer::RunConfiguration::toMap());
|
||||
|
||||
writer.saveValue(QLatin1String("qmlviewer"), m_qmlViewerCustomPath);
|
||||
writer.saveValue(QLatin1String("qmlviewerargs"), m_qmlViewerArgs);
|
||||
writer.saveValue(QLatin1String("mainscript"), m_scriptFile);
|
||||
writer.saveValue(QLatin1String("debugserverport"), m_debugServerPort);
|
||||
map.insert(QLatin1String(QML_VIEWER_KEY), m_qmlViewerCustomPath);
|
||||
map.insert(QLatin1String(QML_VIEWER_ARGUMENTS_KEY), m_qmlViewerArgs);
|
||||
map.insert(QLatin1String(QML_MAINSCRIPT_KEY), m_scriptFile);
|
||||
map.insert(QLatin1String(QML_DEBUG_SERVER_PORT_KEY), m_debugServerPort);
|
||||
return map;
|
||||
}
|
||||
|
||||
void QmlRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReader &reader)
|
||||
bool QmlRunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
ProjectExplorer::RunConfiguration::restore(reader);
|
||||
m_qmlViewerCustomPath = map.value(QLatin1String(QML_VIEWER_KEY)).toString();
|
||||
m_qmlViewerArgs = map.value(QLatin1String(QML_VIEWER_ARGUMENTS_KEY)).toString();
|
||||
m_scriptFile = map.value(QLatin1String(QML_MAINSCRIPT_KEY), tr("<Current File>")).toString();
|
||||
m_debugServerPort = map.value(QLatin1String(QML_DEBUG_SERVER_PORT_KEY), DEFAULT_DEBUG_SERVER_PORT).toUInt();
|
||||
|
||||
m_qmlViewerCustomPath = reader.restoreValue(QLatin1String("qmlviewer")).toString();
|
||||
m_qmlViewerArgs = reader.restoreValue(QLatin1String("qmlviewerargs")).toString();
|
||||
m_scriptFile = reader.restoreValue(QLatin1String("mainscript")).toString();
|
||||
m_debugServerPort = reader.restoreValue(QLatin1String("debugserverport")).toUInt();
|
||||
|
||||
if (m_scriptFile.isEmpty())
|
||||
m_scriptFile = tr("<Current File>");
|
||||
if (m_debugServerPort == 0)
|
||||
m_debugServerPort = 3768;
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QmlRunConfigurationFactory::QmlRunConfigurationFactory()
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// QmlRunConfigurationFactory
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
QmlRunConfigurationFactory::QmlRunConfigurationFactory(QObject *parent) :
|
||||
ProjectExplorer::IRunConfigurationFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -523,31 +549,68 @@ QmlRunConfigurationFactory::~QmlRunConfigurationFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool QmlRunConfigurationFactory::canRestore(const QString &id) const
|
||||
{
|
||||
if (id.startsWith(QLatin1String(Constants::QMLRUNCONFIGURATION)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList QmlRunConfigurationFactory::availableCreationIds(ProjectExplorer::Project *) const
|
||||
{
|
||||
return QStringList();
|
||||
return QStringList() << QLatin1String(QML_RC_ID);
|
||||
}
|
||||
|
||||
QString QmlRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
return id;
|
||||
if (id == QLatin1String(QML_RC_ID))
|
||||
return tr("Run QML Script");
|
||||
return QString();
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *QmlRunConfigurationFactory::create(ProjectExplorer::Project *project,
|
||||
const QString &)
|
||||
bool QmlRunConfigurationFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const
|
||||
{
|
||||
QmlProject *pro = qobject_cast<QmlProject *>(project);
|
||||
return new QmlRunConfiguration(pro);
|
||||
if (!qobject_cast<QmlProject *>(parent))
|
||||
return false;
|
||||
return id == QLatin1String(QML_RC_ID);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *QmlRunConfigurationFactory::create(ProjectExplorer::Project *parent, const QString &id)
|
||||
{
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
QmlProject *project(static_cast<QmlProject *>(parent));
|
||||
return new QmlRunConfiguration(project);
|
||||
}
|
||||
|
||||
bool QmlRunConfigurationFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const
|
||||
{
|
||||
QString id(idFromMap(map));
|
||||
return canCreate(parent, id);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *QmlRunConfigurationFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
QmlProject *project(static_cast<QmlProject *>(parent));
|
||||
QmlRunConfiguration *rc(new QmlRunConfiguration(project));
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool QmlRunConfigurationFactory::canClone(ProjectExplorer::Project *parent, RunConfiguration *source) const
|
||||
{
|
||||
return canCreate(parent, source->id());
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *QmlRunConfigurationFactory::clone(ProjectExplorer::Project *parent, RunConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
QmlProject *project(static_cast<QmlProject *>(parent));
|
||||
return new QmlRunConfiguration(project, qobject_cast<QmlRunConfiguration *>(source));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// QmlRunControl
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
QmlRunControl::QmlRunControl(QmlRunConfiguration *runConfiguration, bool debugMode)
|
||||
: RunControl(runConfiguration), m_debugMode(debugMode)
|
||||
{
|
||||
|
||||
@@ -89,20 +89,23 @@ class QmlRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFact
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QmlRunConfigurationFactory();
|
||||
explicit QmlRunConfigurationFactory(QObject *parent = 0);
|
||||
virtual ~QmlRunConfigurationFactory();
|
||||
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
virtual bool canRestore(const QString &id) const;
|
||||
|
||||
// used to show the list of possible additons to a project, returns a list of types
|
||||
virtual QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
|
||||
|
||||
// used to translate the types to names to display to the user
|
||||
virtual QString displayNameForId(const QString &id) const;
|
||||
|
||||
virtual ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project,
|
||||
const QString &id);
|
||||
virtual bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
|
||||
virtual ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
virtual bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
|
||||
virtual ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
|
||||
|
||||
virtual bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const;
|
||||
virtual ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source);
|
||||
};
|
||||
|
||||
class QmlRunControl : public ProjectExplorer::RunControl {
|
||||
@@ -217,31 +220,38 @@ private:
|
||||
class QMLPROJECTMANAGER_EXPORT QmlRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class Internal::QmlRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
QmlRunConfiguration(QmlProject *pro);
|
||||
QmlRunConfiguration(QmlProject *parent);
|
||||
virtual ~QmlRunConfiguration();
|
||||
|
||||
QmlProject *qmlProject() const;
|
||||
|
||||
QString viewerPath() const;
|
||||
QStringList viewerArguments() const;
|
||||
QString workingDirectory() const;
|
||||
uint debugServerPort() const;
|
||||
|
||||
// RunConfiguration
|
||||
virtual QString id() const;
|
||||
virtual QWidget *configurationWidget();
|
||||
|
||||
virtual void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
|
||||
virtual void restore(const ProjectExplorer::PersistentSettingsReader &reader);
|
||||
QVariantMap toMap() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
private slots:
|
||||
QString mainScript() const;
|
||||
void setMainScript(const QString &scriptFile);
|
||||
void onQmlViewerChanged();
|
||||
void onQmlViewerArgsChanged();
|
||||
void onDebugServerPortChanged();
|
||||
|
||||
protected:
|
||||
QmlRunConfiguration(QmlProject *parent, QmlRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
QmlProject *m_project;
|
||||
void ctor();
|
||||
|
||||
QString m_scriptFile;
|
||||
QString m_qmlViewerCustomPath;
|
||||
QString m_qmlViewerDefaultPath;
|
||||
|
||||
@@ -50,6 +50,48 @@
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
namespace {
|
||||
const char * const MAEMO_RC_ID("Qt4ProjectManager.MaemoRunConfiguration");
|
||||
const char * const MAEMO_RC_ID_PREFIX("Qt4ProjectManager.MaemoRunConfiguration.");
|
||||
|
||||
bool hasMaemoRunConfig(ProjectExplorer::Project* project)
|
||||
{
|
||||
Qt4ProjectManager::Qt4Project *qt4Project(
|
||||
qobject_cast<Qt4ProjectManager::Qt4Project *>(project));
|
||||
if (qt4Project) {
|
||||
QList<ProjectExplorer::RunConfiguration *> list =
|
||||
qt4Project->runConfigurations();
|
||||
foreach (ProjectExplorer::RunConfiguration *rc, list) {
|
||||
if (qobject_cast<Qt4ProjectManager::Internal::MaemoRunConfiguration *>(rc))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString targetFromId(const QString &id)
|
||||
{
|
||||
QString prefix(MAEMO_RC_ID_PREFIX);
|
||||
if (!id.startsWith(prefix))
|
||||
return QString();
|
||||
return id.mid(prefix.size());
|
||||
}
|
||||
|
||||
QString targetToId(const QString &target)
|
||||
{
|
||||
return QString::fromLatin1(MAEMO_RC_ID_PREFIX) + target;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
static const QLatin1String ArgumentsKey("Arguments");
|
||||
static const QLatin1String SimulatorPathKey("Simulator");
|
||||
static const QLatin1String DeviceIdKey("DeviceId");
|
||||
static const QLatin1String LastDeployedKey("LastDeployed");
|
||||
static const QLatin1String DebuggingHelpersLastDeployedKey(
|
||||
"DebuggingHelpersLastDeployed");
|
||||
static const QLatin1String ProFileKey("ProFile");
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
@@ -96,21 +138,45 @@ void ErrorDumper::printToStream(QProcess::ProcessError error)
|
||||
|
||||
// #pragma mark -- MaemoRunConfiguration
|
||||
|
||||
|
||||
static const QLatin1String ArgumentsKey("Arguments");
|
||||
static const QLatin1String SimulatorPathKey("Simulator");
|
||||
static const QLatin1String DeviceIdKey("DeviceId");
|
||||
static const QLatin1String LastDeployedKey("LastDeployed");
|
||||
static const QLatin1String DebuggingHelpersLastDeployedKey(
|
||||
"DebuggingHelpersLastDeployed");
|
||||
|
||||
MaemoRunConfiguration::MaemoRunConfiguration(Project *project,
|
||||
MaemoRunConfiguration::MaemoRunConfiguration(Qt4Project *project,
|
||||
const QString &proFilePath)
|
||||
: RunConfiguration(project)
|
||||
: RunConfiguration(project, QLatin1String(MAEMO_RC_ID))
|
||||
, m_proFilePath(proFilePath)
|
||||
, m_cachedTargetInformationValid(false)
|
||||
, m_cachedSimulatorInformationValid(false)
|
||||
, qemu(0)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
MaemoRunConfiguration::MaemoRunConfiguration(Qt4Project *project,
|
||||
MaemoRunConfiguration *source)
|
||||
: RunConfiguration(project, source)
|
||||
, m_executable(source->m_executable)
|
||||
, m_proFilePath(source->m_proFilePath)
|
||||
, m_cachedTargetInformationValid(false)
|
||||
, m_simulator(source->m_simulator)
|
||||
, m_simulatorArgs(source->m_simulatorArgs)
|
||||
, m_simulatorPath(source->m_simulatorPath)
|
||||
, m_visibleSimulatorParameter(source->m_visibleSimulatorParameter)
|
||||
, m_cachedSimulatorInformationValid(false)
|
||||
, m_isUserSetSimulator(source->m_isUserSetSimulator)
|
||||
, m_userSimulatorPath(source->m_userSimulatorPath)
|
||||
, m_gdbPath(source->m_gdbPath)
|
||||
, m_devConfig(source->m_devConfig)
|
||||
, m_arguments(source->m_arguments)
|
||||
, m_lastDeployed(source->m_lastDeployed)
|
||||
, m_debuggingHelpersLastDeployed(source->m_debuggingHelpersLastDeployed)
|
||||
, qemu(0)
|
||||
#if USE_SSL_PASSWORD
|
||||
, m_remoteUserPassword(source->m_remoteUserPassword)
|
||||
, m_remoteHostRequiresPassword(source->m_remoteHostRequiresPassword)
|
||||
#endif
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::ctor()
|
||||
{
|
||||
if (!m_proFilePath.isEmpty()) {
|
||||
setDisplayName(tr("%1 on Maemo device").arg(QFileInfo(m_proFilePath)
|
||||
@@ -122,13 +188,13 @@ MaemoRunConfiguration::MaemoRunConfiguration(Project *project,
|
||||
connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()),
|
||||
this, SLOT(updateDeviceConfigurations()));
|
||||
|
||||
connect(project, SIGNAL(targetInformationChanged()),
|
||||
connect(qt4Project(), SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(invalidateCachedTargetInformation()));
|
||||
|
||||
connect(project, SIGNAL(targetInformationChanged()),
|
||||
connect(qt4Project(), SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(enabledStateChanged()));
|
||||
|
||||
connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
connect(qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
|
||||
qemu = new QProcess(this);
|
||||
@@ -148,16 +214,9 @@ MaemoRunConfiguration::~MaemoRunConfiguration()
|
||||
qemu = NULL;
|
||||
}
|
||||
|
||||
QString MaemoRunConfiguration::id() const
|
||||
Qt4Project *MaemoRunConfiguration::qt4Project() const
|
||||
{
|
||||
return QLatin1String("Qt4ProjectManager.MaemoRunConfiguration");
|
||||
}
|
||||
|
||||
Qt4Project *MaemoRunConfiguration::project() const
|
||||
{
|
||||
Qt4Project *pro = qobject_cast<Qt4Project *>(RunConfiguration::project());
|
||||
Q_ASSERT(pro != 0);
|
||||
return pro;
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *config) const
|
||||
@@ -179,40 +238,40 @@ void MaemoRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFil
|
||||
invalidateCachedTargetInformation();
|
||||
}
|
||||
|
||||
|
||||
void MaemoRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
QVariantMap MaemoRunConfiguration::toMap() const
|
||||
{
|
||||
writer.saveValue(DeviceIdKey, m_devConfig.internalId);
|
||||
writer.saveValue(ArgumentsKey, m_arguments);
|
||||
QVariantMap map(RunConfiguration::toMap());
|
||||
map.insert(DeviceIdKey, m_devConfig.internalId);
|
||||
map.insert(ArgumentsKey, m_arguments);
|
||||
|
||||
writer.saveValue(LastDeployedKey, m_lastDeployed);
|
||||
writer.saveValue(DebuggingHelpersLastDeployedKey,
|
||||
map.insert(LastDeployedKey, m_lastDeployed);
|
||||
map.insert(DebuggingHelpersLastDeployedKey,
|
||||
m_debuggingHelpersLastDeployed);
|
||||
|
||||
writer.saveValue(SimulatorPathKey, m_simulatorPath);
|
||||
map.insert(SimulatorPathKey, m_simulatorPath);
|
||||
|
||||
const QDir &dir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
writer.saveValue("ProFile", dir.relativeFilePath(m_proFilePath));
|
||||
const QDir &dir = QFileInfo(qt4Project()->file()->fileName()).absoluteDir();
|
||||
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
|
||||
|
||||
RunConfiguration::save(writer);
|
||||
return map;
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
RunConfiguration::restore(reader);
|
||||
|
||||
setDeviceConfig(MaemoDeviceConfigurations::instance().
|
||||
find(reader.restoreValue(DeviceIdKey).toInt()));
|
||||
m_arguments = reader.restoreValue(ArgumentsKey).toStringList();
|
||||
find(map.value(DeviceIdKey, 0).toInt()));
|
||||
m_arguments = map.value(ArgumentsKey).toStringList();
|
||||
|
||||
m_lastDeployed = reader.restoreValue(LastDeployedKey).toDateTime();
|
||||
m_lastDeployed = map.value(LastDeployedKey).toDateTime();
|
||||
m_debuggingHelpersLastDeployed =
|
||||
reader.restoreValue(DebuggingHelpersLastDeployedKey).toDateTime();
|
||||
map.value(DebuggingHelpersLastDeployedKey).toDateTime();
|
||||
|
||||
m_simulatorPath = reader.restoreValue(SimulatorPathKey).toString();
|
||||
m_simulatorPath = map.value(SimulatorPathKey).toString();
|
||||
|
||||
const QDir &dir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
m_proFilePath = dir.filePath(reader.restoreValue("ProFile").toString());
|
||||
const QDir &dir = QFileInfo(qt4Project()->file()->fileName()).absoluteDir();
|
||||
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::currentlyNeedsDeployment() const
|
||||
@@ -227,7 +286,7 @@ void MaemoRunConfiguration::wasDeployed()
|
||||
|
||||
bool MaemoRunConfiguration::hasDebuggingHelpers() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = project()->activeQt4BuildConfiguration();
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
return qt4bc->qtVersion()->hasDebuggingHelper();
|
||||
}
|
||||
|
||||
@@ -283,7 +342,7 @@ const QString MaemoRunConfiguration::cmd(const QString &cmdName) const
|
||||
const MaemoToolChain *MaemoRunConfiguration::toolchain() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>
|
||||
(project()->activeBuildConfiguration());
|
||||
(qt4Project()->activeBuildConfiguration());
|
||||
QTC_ASSERT(qt4bc, return 0);
|
||||
MaemoToolChain *tc = dynamic_cast<MaemoToolChain *>(
|
||||
qt4bc->toolChain() );
|
||||
@@ -319,7 +378,7 @@ const QStringList MaemoRunConfiguration::arguments() const
|
||||
|
||||
const QString MaemoRunConfiguration::dumperLib() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = project()->activeQt4BuildConfiguration();
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
return qt4bc->qtVersion()->debuggingHelperLibrary();
|
||||
}
|
||||
|
||||
@@ -415,7 +474,7 @@ void MaemoRunConfiguration::updateTarget()
|
||||
m_executable = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
|
||||
Qt4TargetInformation info = project()->targetInformation(project()->activeQt4BuildConfiguration(),
|
||||
Qt4TargetInformation info = qt4Project()->targetInformation(qt4Project()->activeQt4BuildConfiguration(),
|
||||
m_proFilePath);
|
||||
if (info.error != Qt4TargetInformation::NoError) {
|
||||
if (info.error == Qt4TargetInformation::ProParserError) {
|
||||
@@ -547,92 +606,116 @@ void MaemoRunConfiguration::updateDeviceConfigurations()
|
||||
|
||||
// #pragma mark -- MaemoRunConfigurationFactory
|
||||
|
||||
MaemoRunConfigurationFactory::MaemoRunConfigurationFactory(QObject* parent)
|
||||
: IRunConfigurationFactory(parent)
|
||||
MaemoRunConfigurationFactory::MaemoRunConfigurationFactory(QObject *parent) :
|
||||
IRunConfigurationFactory(parent)
|
||||
{
|
||||
ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance();
|
||||
connect(explorer->session(), SIGNAL(projectAdded(ProjectExplorer::Project*)),
|
||||
this, SLOT(projectAdded(ProjectExplorer::Project*)));
|
||||
connect(explorer->session(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
|
||||
this, SLOT(projectRemoved(ProjectExplorer::Project*)));
|
||||
connect(explorer, SIGNAL(currentProjectChanged(ProjectExplorer::Project*)),
|
||||
this, SLOT(currentProjectChanged(ProjectExplorer::Project*)));
|
||||
}
|
||||
|
||||
MaemoRunConfigurationFactory::~MaemoRunConfigurationFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool MaemoRunConfigurationFactory::canRestore(const QString &id) const
|
||||
bool MaemoRunConfigurationFactory::canCreate(Project *parent,
|
||||
const QString &id) const
|
||||
{
|
||||
return id == "Qt4ProjectManager.MaemoRunConfiguration";
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
return id.startsWith(QLatin1String(MAEMO_RC_ID));
|
||||
}
|
||||
|
||||
QStringList MaemoRunConfigurationFactory::availableCreationIds(
|
||||
Project *pro) const
|
||||
bool MaemoRunConfigurationFactory::canRestore(Project *parent,
|
||||
const QVariantMap &map) const
|
||||
{
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro);
|
||||
if (qt4project) {
|
||||
QStringList applicationProFiles;
|
||||
QList<Qt4ProFileNode *> list = qt4project->applicationProFiles();
|
||||
foreach (Qt4ProFileNode * node, list) {
|
||||
applicationProFiles.append("MaemoRunConfiguration." + node->path());
|
||||
}
|
||||
return applicationProFiles;
|
||||
}
|
||||
return QStringList();
|
||||
QString id(ProjectExplorer::idFromMap(map));
|
||||
return canCreate(parent, id);
|
||||
}
|
||||
|
||||
bool MaemoRunConfigurationFactory::canClone(Project *parent,
|
||||
RunConfiguration *source) const
|
||||
{
|
||||
QString id(source->id());
|
||||
return canCreate(parent, id);
|
||||
}
|
||||
|
||||
QStringList MaemoRunConfigurationFactory::availableCreationIds(Project *pro) const
|
||||
{
|
||||
Qt4Project *qt4Project(qobject_cast<Qt4Project *>(pro));
|
||||
if (!qt4Project)
|
||||
return QStringList();
|
||||
|
||||
return qt4Project->applicationProFilePathes(QLatin1String(MAEMO_RC_ID_PREFIX));
|
||||
}
|
||||
|
||||
QString MaemoRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
const int size = QString::fromLocal8Bit("MaemoRunConfiguration.").size();
|
||||
return tr("%1 on Maemo Device").arg(QFileInfo(id.mid(size))
|
||||
.completeBaseName());
|
||||
QString target(targetFromId(id));
|
||||
if (target.isEmpty())
|
||||
return QString();
|
||||
return tr("%1 on Maemo Device").arg(QFileInfo(target).completeBaseName());
|
||||
}
|
||||
|
||||
RunConfiguration *MaemoRunConfigurationFactory::create(Project *project,
|
||||
const QString &id)
|
||||
RunConfiguration *MaemoRunConfigurationFactory::create(Project *parent,
|
||||
const QString &id)
|
||||
{
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(project);
|
||||
Q_ASSERT(qt4project);
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
Qt4Project *pqt4parent(static_cast<Qt4Project *>(parent));
|
||||
MaemoRunConfiguration *rc(new MaemoRunConfiguration(pqt4parent, targetFromId(id)));
|
||||
setupRunConfiguration(rc);
|
||||
return rc;
|
||||
|
||||
connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
|
||||
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration *)));
|
||||
connect(project, SIGNAL(removedRunConfiguration(RunConfiguration *)),
|
||||
this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration *)));
|
||||
}
|
||||
|
||||
RunConfiguration *rc = 0;
|
||||
const QLatin1String prefix("MaemoRunConfiguration.");
|
||||
if (id.startsWith(prefix)) {
|
||||
rc = new MaemoRunConfiguration(qt4project, id.mid(QString(prefix).size()));
|
||||
} else {
|
||||
Q_ASSERT(id == "Qt4ProjectManager.MaemoRunConfiguration");
|
||||
rc = new MaemoRunConfiguration(qt4project, QString::null);
|
||||
RunConfiguration *MaemoRunConfigurationFactory::restore(Project *parent,
|
||||
const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
Qt4Project *qt4Project(qobject_cast<Qt4Project *>(parent));
|
||||
Q_ASSERT(qt4Project);
|
||||
|
||||
MaemoRunConfiguration *rc(new MaemoRunConfiguration(qt4Project, QString()));
|
||||
if (!rc->fromMap(map)) {
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
connect(project, SIGNAL(runConfigurationsEnabledStateChanged()),
|
||||
rc, SLOT(enabledStateChanged()));
|
||||
connect(MaemoManager::instance(), SIGNAL(startStopQemu()), rc,
|
||||
SLOT(startStopQemu()));
|
||||
connect(rc, SIGNAL(qemuProcessStatus(bool)),
|
||||
MaemoManager::instance(), SLOT(updateQemuSimulatorStarter(bool)));
|
||||
}
|
||||
setupRunConfiguration(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance();
|
||||
connect(explorer->session(), SIGNAL(projectAdded(ProjectExplorer::Project*)),
|
||||
this, SLOT(projectAdded(ProjectExplorer::Project*)));
|
||||
connect(explorer->session(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
|
||||
this, SLOT(projectRemoved(ProjectExplorer::Project*)));
|
||||
connect(explorer, SIGNAL(currentProjectChanged(ProjectExplorer::Project*)),
|
||||
this, SLOT(currentProjectChanged(ProjectExplorer::Project*)));
|
||||
RunConfiguration *MaemoRunConfigurationFactory::clone(Project *parent,
|
||||
RunConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
Qt4Project *qt4Project(static_cast<Qt4Project *>(parent));
|
||||
MaemoRunConfiguration *old(static_cast<MaemoRunConfiguration *>(source));
|
||||
MaemoRunConfiguration *rc(new MaemoRunConfiguration(qt4Project, old));
|
||||
|
||||
setupRunConfiguration(rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool hasMaemoRunConfig(ProjectExplorer::Project* project)
|
||||
void MaemoRunConfigurationFactory::setupRunConfiguration(MaemoRunConfiguration *rc)
|
||||
{
|
||||
if (Qt4Project *qt4Project = qobject_cast<Qt4Project *>(project)) {
|
||||
QList<RunConfiguration *> list = qt4Project->runConfigurations();
|
||||
foreach (RunConfiguration *rc, list) {
|
||||
if (qobject_cast<MaemoRunConfiguration *>(rc))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
if (!rc)
|
||||
return;
|
||||
|
||||
connect(rc->project(), SIGNAL(runConfigurationsEnabledStateChanged()),
|
||||
rc, SLOT(enabledStateChanged()));
|
||||
connect(MaemoManager::instance(), SIGNAL(startStopQemu()),
|
||||
rc, SLOT(startStopQemu()));
|
||||
connect(rc, SIGNAL(qemuProcessStatus(bool)),
|
||||
MaemoManager::instance(), SLOT(updateQemuSimulatorStarter(bool)));
|
||||
}
|
||||
|
||||
void MaemoRunConfigurationFactory::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
@@ -650,6 +733,13 @@ void MaemoRunConfigurationFactory::removedRunConfiguration(ProjectExplorer::RunC
|
||||
void MaemoRunConfigurationFactory::projectAdded(
|
||||
ProjectExplorer::Project *project)
|
||||
{
|
||||
connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::Project*,
|
||||
QString)),
|
||||
this, SLOT(addedRunConfiguration(ProjectExplorer::Project*)));
|
||||
connect(project, SIGNAL(removedRunConfiguration(ProjectExplorer::Project*,
|
||||
QString)),
|
||||
this, SLOT(removedRunConfiguration(ProjectExplorer::Project*)));
|
||||
|
||||
if (hasMaemoRunConfig(project))
|
||||
MaemoManager::instance()->addQemuSimulatorStarter(project);
|
||||
}
|
||||
@@ -657,6 +747,13 @@ void MaemoRunConfigurationFactory::projectAdded(
|
||||
void MaemoRunConfigurationFactory::projectRemoved(
|
||||
ProjectExplorer::Project *project)
|
||||
{
|
||||
disconnect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::Project*,
|
||||
QString)),
|
||||
this, SLOT(addedRunConfiguration(ProjectExplorer::Project*)));
|
||||
disconnect(project, SIGNAL(removedRunConfiguration(ProjectExplorer::Project*,
|
||||
QString)),
|
||||
this, SLOT(removedRunConfiguration(ProjectExplorer::Project*)));
|
||||
|
||||
if (hasMaemoRunConfig(project))
|
||||
MaemoManager::instance()->removeQemuSimulatorStarter(project);
|
||||
}
|
||||
|
||||
@@ -61,23 +61,22 @@ public slots:
|
||||
void printToStream(QProcess::ProcessError error);
|
||||
};
|
||||
|
||||
class MaemoRunConfigurationFactory;
|
||||
|
||||
class MaemoRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MaemoRunConfiguration(ProjectExplorer::Project *project,
|
||||
const QString &proFilePath);
|
||||
~MaemoRunConfiguration();
|
||||
friend class MaemoRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
MaemoRunConfiguration(Qt4Project *project,
|
||||
const QString &proFilePath);
|
||||
virtual ~MaemoRunConfiguration();
|
||||
|
||||
QString id() const;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
|
||||
using RunConfiguration::isEnabled;
|
||||
QWidget *configurationWidget();
|
||||
Qt4Project *project() const;
|
||||
|
||||
void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
|
||||
void restore(const ProjectExplorer::PersistentSettingsReader &reader);
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
bool currentlyNeedsDeployment() const;
|
||||
void wasDeployed();
|
||||
@@ -115,12 +114,19 @@ public:
|
||||
bool remoteHostRequiresPassword() const { return m_remoteHostRequiresPassword; }
|
||||
#endif
|
||||
|
||||
virtual QVariantMap toMap() const;
|
||||
|
||||
signals:
|
||||
void deviceConfigurationsUpdated();
|
||||
void targetInformationChanged();
|
||||
void cachedSimulatorInformationChanged();
|
||||
void qemuProcessStatus(bool running);
|
||||
|
||||
protected:
|
||||
MaemoRunConfiguration(Qt4Project *project,
|
||||
MaemoRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private slots:
|
||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||
void updateDeviceConfigurations();
|
||||
@@ -136,13 +142,13 @@ private slots:
|
||||
void enabledStateChanged();
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
void updateTarget();
|
||||
void updateSimulatorInformation();
|
||||
const QString cmd(const QString &cmdName) const;
|
||||
const MaemoToolChain *toolchain() const;
|
||||
bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const;
|
||||
|
||||
private:
|
||||
QString m_executable;
|
||||
QString m_proFilePath;
|
||||
bool m_cachedTargetInformationValid;
|
||||
@@ -176,13 +182,19 @@ private:
|
||||
class MaemoRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MaemoRunConfigurationFactory(QObject *parent);
|
||||
explicit MaemoRunConfigurationFactory(QObject *parent = 0);
|
||||
~MaemoRunConfigurationFactory();
|
||||
|
||||
bool canRestore(const QString &id) const;
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *project) const;
|
||||
QString displayNameForId(const QString &id) const;
|
||||
|
||||
bool canRestore(ProjectExplorer::Project *project, const QVariantMap &map) const;
|
||||
bool canClone(ProjectExplorer::Project *project, ProjectExplorer::RunConfiguration *source) const;
|
||||
bool canCreate(ProjectExplorer::Project *project, const QString &id) const;
|
||||
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *project, const QVariantMap &map);
|
||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *project, ProjectExplorer::RunConfiguration *source);
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
|
||||
private slots:
|
||||
@@ -192,6 +204,9 @@ private slots:
|
||||
void projectAdded(ProjectExplorer::Project *project);
|
||||
void projectRemoved(ProjectExplorer::Project *project);
|
||||
void currentProjectChanged(ProjectExplorer::Project *project);
|
||||
|
||||
private:
|
||||
void setupRunConfiguration(MaemoRunConfiguration *rc);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -58,17 +58,31 @@ using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
enum { debug = 0 };
|
||||
namespace {
|
||||
const char * const S60_DEVICE_RC_ID("Qt4ProjectManager.S60DeviceRunConfiguration");
|
||||
const char * const S60_DEVICE_RC_PREFIX("Qt4ProjectManager.S60DeviceRunConfiguration.");
|
||||
|
||||
static const int PROGRESS_PACKAGECREATED = 100;
|
||||
static const int PROGRESS_PACKAGESIGNED = 200;
|
||||
static const int PROGRESS_DEPLOYBASE = 200;
|
||||
static const int PROGRESS_PACKAGEDEPLOYED = 300;
|
||||
static const int PROGRESS_PACKAGEINSTALLED = 400;
|
||||
static const int PROGRESS_MAX = 400;
|
||||
const char * const PRO_FILE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.ProFile");
|
||||
const char * const SIGNING_MODE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.SigningMode");
|
||||
const char * const CUSTOM_SIGNATURE_PATH_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CustomSignaturePath");
|
||||
const char * const CUSTOM_KEY_PATH_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CustomKeyPath");
|
||||
const char * const SERIAL_PORT_NAME_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.SerialPortName");
|
||||
const char * const COMMUNICATION_TYPE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommunicationType");
|
||||
const char * const COMMAND_LINE_ARGUMENTS_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommandLineArguments");
|
||||
|
||||
const int PROGRESS_PACKAGECREATED = 100;
|
||||
const int PROGRESS_PACKAGESIGNED = 200;
|
||||
const int PROGRESS_DEPLOYBASE = 200;
|
||||
const int PROGRESS_PACKAGEDEPLOYED = 300;
|
||||
const int PROGRESS_PACKAGEINSTALLED = 400;
|
||||
const int PROGRESS_MAX = 400;
|
||||
|
||||
enum {
|
||||
debug = false
|
||||
};
|
||||
|
||||
// Format information about a file
|
||||
static QString lsFile(const QString &f)
|
||||
QString lsFile(const QString &f)
|
||||
{
|
||||
QString rc;
|
||||
const QFileInfo fi(f);
|
||||
@@ -77,9 +91,25 @@ static QString lsFile(const QString &f)
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
QString pathFromId(const QString &id)
|
||||
{
|
||||
if (!id.startsWith(QLatin1String(S60_DEVICE_RC_PREFIX)))
|
||||
return QString();
|
||||
return id.mid(QString::fromLatin1(S60_DEVICE_RC_PREFIX).size());
|
||||
}
|
||||
|
||||
QString pathToId(const QString &path)
|
||||
{
|
||||
return QString::fromLatin1(S60_DEVICE_RC_PREFIX) + path;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ======== S60DeviceRunConfiguration
|
||||
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, const QString &proFilePath)
|
||||
: RunConfiguration(project),
|
||||
|
||||
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, const QString &proFilePath) :
|
||||
RunConfiguration(project, pathToId(proFilePath)),
|
||||
m_proFilePath(proFilePath),
|
||||
m_cachedTargetInformationValid(false),
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -91,16 +121,20 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, const QSt
|
||||
#endif
|
||||
m_signingMode(SignSelf)
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
else
|
||||
setDisplayName(tr("QtS60DeviceRunConfiguration"));
|
||||
ctor();
|
||||
}
|
||||
|
||||
connect(project, SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(invalidateCachedTargetInformation()));
|
||||
|
||||
connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, S60DeviceRunConfiguration *source) :
|
||||
RunConfiguration(project, source),
|
||||
m_proFilePath(source->m_proFilePath),
|
||||
m_cachedTargetInformationValid(false),
|
||||
m_serialPortName(source->m_serialPortName),
|
||||
m_communicationType(source->m_communicationType),
|
||||
m_signingMode(source->m_signingMode),
|
||||
m_customSignaturePath(source->m_customSignaturePath),
|
||||
m_customKeyPath(source->m_customKeyPath)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||
@@ -109,6 +143,20 @@ void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4Pr
|
||||
invalidateCachedTargetInformation();
|
||||
}
|
||||
|
||||
void S60DeviceRunConfiguration::ctor()
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
else
|
||||
setDisplayName(tr("QtS60DeviceRunConfiguration"));
|
||||
|
||||
connect(qt4Project(), SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(invalidateCachedTargetInformation()));
|
||||
|
||||
connect(qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
}
|
||||
|
||||
|
||||
S60DeviceRunConfiguration::~S60DeviceRunConfiguration()
|
||||
{
|
||||
@@ -119,11 +167,6 @@ Qt4Project *S60DeviceRunConfiguration::qt4Project() const
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
QString S60DeviceRunConfiguration::id() const
|
||||
{
|
||||
return QLatin1String("Qt4ProjectManager.DeviceRunConfiguration");
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType S60DeviceRunConfiguration::toolChainType(
|
||||
ProjectExplorer::BuildConfiguration *configuration) const
|
||||
{
|
||||
@@ -151,30 +194,35 @@ QWidget *S60DeviceRunConfiguration::configurationWidget()
|
||||
return new S60DeviceRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
void S60DeviceRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
QVariantMap S60DeviceRunConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map(ProjectExplorer::RunConfiguration::toMap());
|
||||
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
writer.saveValue("ProFile", projectDir.relativeFilePath(m_proFilePath));
|
||||
writer.saveValue("SigningMode", (int)m_signingMode);
|
||||
writer.saveValue("CustomSignaturePath", m_customSignaturePath);
|
||||
writer.saveValue("CustomKeyPath", m_customKeyPath);
|
||||
writer.saveValue("SerialPortName", m_serialPortName);
|
||||
writer.saveValue("CommunicationType", m_communicationType);
|
||||
writer.saveValue("CommandLineArguments", m_commandLineArguments);
|
||||
RunConfiguration::save(writer);
|
||||
|
||||
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath));
|
||||
map.insert(QLatin1String(SIGNING_MODE_KEY), (int)m_signingMode);
|
||||
map.insert(QLatin1String(CUSTOM_SIGNATURE_PATH_KEY), m_customSignaturePath);
|
||||
map.insert(QLatin1String(CUSTOM_KEY_PATH_KEY), m_customKeyPath);
|
||||
map.insert(QLatin1String(SERIAL_PORT_NAME_KEY), m_serialPortName);
|
||||
map.insert(QLatin1String(COMMUNICATION_TYPE_KEY), m_communicationType);
|
||||
map.insert(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY), m_commandLineArguments);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
void S60DeviceRunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
RunConfiguration::restore(reader);
|
||||
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
m_proFilePath = projectDir.filePath(reader.restoreValue("ProFile").toString());
|
||||
m_signingMode = (SigningMode)reader.restoreValue("SigningMode").toInt();
|
||||
m_customSignaturePath = reader.restoreValue("CustomSignaturePath").toString();
|
||||
m_customKeyPath = reader.restoreValue("CustomKeyPath").toString();
|
||||
m_serialPortName = reader.restoreValue("SerialPortName").toString().trimmed();
|
||||
m_communicationType = reader.restoreValue("CommunicationType").toInt();
|
||||
m_commandLineArguments = reader.restoreValue("CommandLineArguments").toStringList();
|
||||
const QDir projectDir = QFileInfo(qt4Project()->file()->fileName()).absoluteDir();
|
||||
|
||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||
m_signingMode = static_cast<SigningMode>(map.value(QLatin1String(SIGNING_MODE_KEY)).toInt());
|
||||
m_customSignaturePath = map.value(QLatin1String(CUSTOM_SIGNATURE_PATH_KEY)).toString();
|
||||
m_customKeyPath = map.value(QLatin1String(CUSTOM_KEY_PATH_KEY)).toString();
|
||||
m_serialPortName = map.value(QLatin1String(SERIAL_PORT_NAME_KEY)).toString().trimmed();
|
||||
m_communicationType = map.value(QLatin1String(COMMUNICATION_TYPE_KEY)).toInt();
|
||||
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toStringList();
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QString S60DeviceRunConfiguration::serialPortName() const
|
||||
@@ -345,8 +393,8 @@ void S60DeviceRunConfiguration::invalidateCachedTargetInformation()
|
||||
|
||||
// ======== S60DeviceRunConfigurationFactory
|
||||
|
||||
S60DeviceRunConfigurationFactory::S60DeviceRunConfigurationFactory(QObject *parent)
|
||||
: IRunConfigurationFactory(parent)
|
||||
S60DeviceRunConfigurationFactory::S60DeviceRunConfigurationFactory(QObject *parent) :
|
||||
IRunConfigurationFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -354,44 +402,74 @@ S60DeviceRunConfigurationFactory::~S60DeviceRunConfigurationFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool S60DeviceRunConfigurationFactory::canRestore(const QString &id) const
|
||||
QStringList S60DeviceRunConfigurationFactory::availableCreationIds(Project *parent) const
|
||||
{
|
||||
return id == "Qt4ProjectManager.DeviceRunConfiguration";
|
||||
}
|
||||
|
||||
QStringList S60DeviceRunConfigurationFactory::availableCreationIds(Project *pro) const
|
||||
{
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro);
|
||||
if (qt4project) {
|
||||
QStringList applicationProFiles;
|
||||
QList<Qt4ProFileNode *> list = qt4project->applicationProFiles();
|
||||
foreach (Qt4ProFileNode * node, list) {
|
||||
applicationProFiles.append("QtSymbianDeviceRunConfiguration." + node->path());
|
||||
}
|
||||
return applicationProFiles;
|
||||
} else {
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(parent);
|
||||
if (!qt4project)
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
return qt4project->applicationProFilePathes(QLatin1String(S60_DEVICE_RC_PREFIX));
|
||||
}
|
||||
|
||||
QString S60DeviceRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
QString fileName = id.mid(QString("QtSymbianDeviceRunConfiguration.").size());
|
||||
return tr("%1 on Symbian Device").arg(QFileInfo(fileName).completeBaseName());
|
||||
if (!pathFromId(id).isEmpty())
|
||||
return tr("%1 on Symbian Device").arg(QFileInfo(pathFromId(id)).completeBaseName());
|
||||
return QString();
|
||||
}
|
||||
|
||||
RunConfiguration *S60DeviceRunConfigurationFactory::create(Project *project, const QString &id)
|
||||
bool S60DeviceRunConfigurationFactory::canCreate(Project *parent, const QString &id) const
|
||||
{
|
||||
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
||||
Q_ASSERT(p);
|
||||
if (id.startsWith("QtSymbianDeviceRunConfiguration.")) {
|
||||
QString fileName = id.mid(QString("QtSymbianDeviceRunConfiguration.").size());
|
||||
return new S60DeviceRunConfiguration(p, fileName);
|
||||
}
|
||||
Q_ASSERT(id == "Qt4ProjectManager.DeviceRunConfiguration");
|
||||
// The right path is set in restoreSettings
|
||||
RunConfiguration *rc = new S60DeviceRunConfiguration(p, QString::null);
|
||||
return rc;
|
||||
Qt4Project * project(qobject_cast<Qt4Project *>(parent));
|
||||
if (!project)
|
||||
return false;
|
||||
return project->hasApplicationProFile(pathFromId(id));
|
||||
}
|
||||
|
||||
RunConfiguration *S60DeviceRunConfigurationFactory::create(Project *parent, const QString &id)
|
||||
{
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
return new S60DeviceRunConfiguration(project, pathFromId(id));
|
||||
}
|
||||
|
||||
bool S60DeviceRunConfigurationFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const
|
||||
{
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
QString id(ProjectExplorer::idFromMap(map));
|
||||
return id == QLatin1String(S60_DEVICE_RC_ID);
|
||||
}
|
||||
|
||||
RunConfiguration *S60DeviceRunConfigurationFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
S60DeviceRunConfiguration *rc(new S60DeviceRunConfiguration(project, QString()));
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool S60DeviceRunConfigurationFactory::canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const
|
||||
{
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
return source->id() == QLatin1String(S60_DEVICE_RC_ID);
|
||||
}
|
||||
|
||||
RunConfiguration *S60DeviceRunConfigurationFactory::clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
Qt4Project *project = static_cast<Qt4Project *>(parent);
|
||||
S60DeviceRunConfiguration * old(static_cast<S60DeviceRunConfiguration *>(source));
|
||||
return new S60DeviceRunConfiguration(project, old);
|
||||
}
|
||||
|
||||
// ======== S60DeviceRunControlBase
|
||||
@@ -845,6 +923,7 @@ bool S60DeviceRunControlBase::checkConfiguration(QString * /* errorMessage */,
|
||||
}
|
||||
|
||||
// =============== S60DeviceRunControl
|
||||
|
||||
S60DeviceRunControl::S60DeviceRunControl(ProjectExplorer::RunConfiguration *runConfiguration) :
|
||||
S60DeviceRunControlBase(runConfiguration)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Debugger {
|
||||
class DebuggerStartParameters;
|
||||
class DebuggerStartParameters;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
@@ -52,26 +52,26 @@ class Qt4Project;
|
||||
|
||||
namespace Internal {
|
||||
class Qt4ProFileNode;
|
||||
class S60DeviceRunConfigurationFactory;
|
||||
|
||||
class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class S60DeviceRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
enum SigningMode {
|
||||
SignSelf,
|
||||
SignCustom
|
||||
};
|
||||
|
||||
explicit S60DeviceRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath);
|
||||
~S60DeviceRunConfiguration();
|
||||
S60DeviceRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath);
|
||||
virtual ~S60DeviceRunConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
QString id() const;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
QWidget *configurationWidget();
|
||||
void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
|
||||
void restore(const ProjectExplorer::PersistentSettingsReader &reader);
|
||||
|
||||
QString serialPortName() const;
|
||||
void setSerialPortName(const QString &name);
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||
|
||||
QVariantMap toMap() const;
|
||||
|
||||
signals:
|
||||
void targetInformationChanged();
|
||||
|
||||
@@ -106,9 +108,14 @@ private slots:
|
||||
void invalidateCachedTargetInformation();
|
||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||
|
||||
protected:
|
||||
S60DeviceRunConfiguration(ProjectExplorer::Project *project, S60DeviceRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
ProjectExplorer::ToolChain::ToolChainType toolChainType(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
void updateTarget();
|
||||
void ctor();
|
||||
|
||||
QString m_proFilePath;
|
||||
QString m_targetName;
|
||||
@@ -128,14 +135,21 @@ private:
|
||||
class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit S60DeviceRunConfigurationFactory(QObject *parent);
|
||||
explicit S60DeviceRunConfigurationFactory(QObject *parent = 0);
|
||||
~S60DeviceRunConfigurationFactory();
|
||||
bool canRestore(const QString &id) const;
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
|
||||
|
||||
bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *parent, const QString &id);
|
||||
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
|
||||
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
|
||||
bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const;
|
||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source);
|
||||
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *parent) const;
|
||||
// used to translate the ids to names to display to the user
|
||||
QString displayNameForId(const QString &id) const;
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
};
|
||||
|
||||
/* S60DeviceRunControlBase: Builds the package and starts launcher
|
||||
|
||||
@@ -51,24 +51,59 @@ using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
namespace {
|
||||
const char * const S60_EMULATOR_RC_ID("Qt4ProjectManager.S60EmulatorRunConfiguration");
|
||||
const char * const S60_EMULATOR_RC_PREFIX("Qt4ProjectManager.S60EmulatorRunConfiguration.");
|
||||
|
||||
const char * const PRO_FILE_KEY("Qt4ProjectManager.S60EmulatorRunConfiguration.ProFile");
|
||||
|
||||
QString pathFromId(const QString &id)
|
||||
{
|
||||
if (!id.startsWith(QLatin1String(S60_EMULATOR_RC_PREFIX)))
|
||||
return QString();
|
||||
return id.mid(QString::fromLatin1(S60_EMULATOR_RC_PREFIX).size());
|
||||
}
|
||||
|
||||
QString pathToId(const QString &path)
|
||||
{
|
||||
return QString::fromLatin1(S60_EMULATOR_RC_PREFIX) + path;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ======== S60EmulatorRunConfiguration
|
||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Project *project, const QString &proFilePath)
|
||||
: RunConfiguration(project),
|
||||
|
||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Project *project, const QString &proFilePath) :
|
||||
RunConfiguration(project, QLatin1String(S60_EMULATOR_RC_ID)),
|
||||
m_proFilePath(proFilePath),
|
||||
m_cachedTargetInformationValid(false)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Project *project, S60EmulatorRunConfiguration *source) :
|
||||
RunConfiguration(project, source),
|
||||
m_proFilePath(source->m_proFilePath),
|
||||
m_cachedTargetInformationValid(false)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void S60EmulatorRunConfiguration::ctor()
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
else
|
||||
setDisplayName(tr("QtSymbianEmulatorRunConfiguration"));
|
||||
setDisplayName(tr("Qt Symbian Emulator RunConfiguration"));
|
||||
|
||||
connect(project, SIGNAL(targetInformationChanged()),
|
||||
connect(qt4Project(), SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(invalidateCachedTargetInformation()));
|
||||
|
||||
connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
connect(qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
}
|
||||
|
||||
|
||||
S60EmulatorRunConfiguration::~S60EmulatorRunConfiguration()
|
||||
{
|
||||
}
|
||||
@@ -85,11 +120,6 @@ Qt4Project *S60EmulatorRunConfiguration::qt4Project() const
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
QString S60EmulatorRunConfiguration::id() const
|
||||
{
|
||||
return "Qt4ProjectManager.EmulatorRunConfiguration";
|
||||
}
|
||||
|
||||
bool S60EmulatorRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(configuration);
|
||||
@@ -103,18 +133,20 @@ QWidget *S60EmulatorRunConfiguration::configurationWidget()
|
||||
return new S60EmulatorRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
void S60EmulatorRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
QVariantMap S60EmulatorRunConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map(ProjectExplorer::RunConfiguration::toMap());
|
||||
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
writer.saveValue("ProFile", projectDir.relativeFilePath(m_proFilePath));
|
||||
RunConfiguration::save(writer);
|
||||
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath));
|
||||
return map;
|
||||
}
|
||||
|
||||
void S60EmulatorRunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
bool S60EmulatorRunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
RunConfiguration::restore(reader);
|
||||
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
m_proFilePath = projectDir.filePath(reader.restoreValue("ProFile").toString());
|
||||
const QDir projectDir = QFileInfo(qt4Project()->file()->fileName()).absoluteDir();
|
||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QString S60EmulatorRunConfiguration::executable() const
|
||||
@@ -224,44 +256,71 @@ S60EmulatorRunConfigurationFactory::~S60EmulatorRunConfigurationFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool S60EmulatorRunConfigurationFactory::canRestore(const QString &id) const
|
||||
bool S60EmulatorRunConfigurationFactory::canCreate(Project *parent, const QString &id) const
|
||||
{
|
||||
return id == "Qt4ProjectManager.EmulatorRunConfiguration";
|
||||
Qt4Project *project(qobject_cast<Qt4Project *>(parent));
|
||||
if (!project)
|
||||
return false;
|
||||
return project->hasApplicationProFile(pathFromId(id));
|
||||
}
|
||||
|
||||
RunConfiguration *S60EmulatorRunConfigurationFactory::create(Project *parent, const QString &id)
|
||||
{
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
return new S60EmulatorRunConfiguration(project, pathFromId(id));
|
||||
}
|
||||
|
||||
bool S60EmulatorRunConfigurationFactory::canRestore(Project *parent, const QVariantMap &map) const
|
||||
{
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
QString id(ProjectExplorer::idFromMap(map));
|
||||
return id.startsWith(QLatin1String(S60_EMULATOR_RC_ID));
|
||||
}
|
||||
|
||||
RunConfiguration *S60EmulatorRunConfigurationFactory::restore(Project *parent, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
S60EmulatorRunConfiguration *rc(new S60EmulatorRunConfiguration(project, QString()));
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool S60EmulatorRunConfigurationFactory::canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const
|
||||
{
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
return source->id() == QLatin1String(S60_EMULATOR_RC_ID);
|
||||
}
|
||||
|
||||
RunConfiguration *S60EmulatorRunConfigurationFactory::clone(Project *parent, RunConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
return new S60EmulatorRunConfiguration(project, QString());
|
||||
}
|
||||
|
||||
QStringList S60EmulatorRunConfigurationFactory::availableCreationIds(Project *pro) const
|
||||
{
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro);
|
||||
if (qt4project) {
|
||||
QStringList applicationProFiles;
|
||||
QList<Qt4ProFileNode *> list = qt4project->applicationProFiles();
|
||||
foreach (Qt4ProFileNode * node, list) {
|
||||
applicationProFiles.append("QtSymbianEmulatorRunConfiguration." + node->path());
|
||||
}
|
||||
return applicationProFiles;
|
||||
} else {
|
||||
Qt4Project *qt4project(qobject_cast<Qt4Project *>(pro));
|
||||
if (!qt4project)
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
return qt4project->applicationProFilePathes(QLatin1String(S60_EMULATOR_RC_PREFIX));
|
||||
}
|
||||
|
||||
QString S60EmulatorRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
QString fileName = id.mid(QString("QtSymbianEmulatorRunConfiguration.").size());
|
||||
return tr("%1 in Symbian Emulator").arg(QFileInfo(fileName).completeBaseName());
|
||||
}
|
||||
|
||||
RunConfiguration *S60EmulatorRunConfigurationFactory::create(Project *project, const QString &id)
|
||||
{
|
||||
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
||||
Q_ASSERT(p);
|
||||
if (id.startsWith("QtSymbianEmulatorRunConfiguration.")) {
|
||||
QString fileName = id.mid(QString("QtSymbianEmulatorRunConfiguration.").size());
|
||||
return new S60EmulatorRunConfiguration(p, fileName);
|
||||
}
|
||||
Q_ASSERT(id == "Qt4ProjectManager.EmulatorRunConfiguration");
|
||||
// The right path is set in restoreSettings
|
||||
RunConfiguration *rc = new S60EmulatorRunConfiguration(p, QString::null);
|
||||
return rc;
|
||||
if (!pathFromId(id).isEmpty())
|
||||
return tr("%1 in Symbian Emulator").arg(QFileInfo(pathFromId(id)).completeBaseName());
|
||||
return QString();
|
||||
}
|
||||
|
||||
// ======== S60EmulatorRunControl
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/applicationlauncher.h>
|
||||
|
||||
#include <QtCore/QVariantMap>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -41,7 +42,7 @@ class QLineEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class DetailsWidget;
|
||||
class DetailsWidget;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
@@ -49,24 +50,26 @@ class Qt4Project;
|
||||
|
||||
namespace Internal {
|
||||
class Qt4ProFileNode;
|
||||
class S60EmulatorRunConfigurationFactory;
|
||||
|
||||
class S60EmulatorRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class S60EmulatorRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
S60EmulatorRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath);
|
||||
~S60EmulatorRunConfiguration();
|
||||
S60EmulatorRunConfiguration(ProjectExplorer::Project *parent, const QString &proFilePath);
|
||||
virtual ~S60EmulatorRunConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
QString id() const;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
QWidget *configurationWidget();
|
||||
void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
|
||||
void restore(const ProjectExplorer::PersistentSettingsReader &reader);
|
||||
|
||||
QString executable() const;
|
||||
|
||||
QVariantMap toMap() const;
|
||||
|
||||
signals:
|
||||
void targetInformationChanged();
|
||||
|
||||
@@ -74,7 +77,12 @@ private slots:
|
||||
void invalidateCachedTargetInformation();
|
||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||
|
||||
protected:
|
||||
S60EmulatorRunConfiguration(ProjectExplorer::Project *parent, S60EmulatorRunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
void updateTarget();
|
||||
|
||||
QString m_proFilePath;
|
||||
@@ -105,13 +113,19 @@ class S60EmulatorRunConfigurationFactory : public ProjectExplorer::IRunConfigura
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit S60EmulatorRunConfigurationFactory(QObject *parent);
|
||||
explicit S60EmulatorRunConfigurationFactory(QObject *parent = 0);
|
||||
~S60EmulatorRunConfigurationFactory();
|
||||
bool canRestore(const QString &id) const;
|
||||
|
||||
bool canCreate(ProjectExplorer::Project *project, const QString &id) const;
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
|
||||
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
|
||||
bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const;
|
||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source);
|
||||
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
|
||||
// used to translate the ids to names to display to the user
|
||||
QString displayNameForId(const QString &id) const;
|
||||
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
};
|
||||
|
||||
class S60EmulatorRunControl : public ProjectExplorer::RunControl
|
||||
|
||||
@@ -107,12 +107,12 @@ S60Manager::S60Manager(QObject *parent)
|
||||
#endif
|
||||
m_devices->detectQtForDevices(); // Order!
|
||||
|
||||
addAutoReleasedObject(new S60EmulatorRunConfigurationFactory(this));
|
||||
addAutoReleasedObject(new S60EmulatorRunConfigurationFactory);
|
||||
addAutoReleasedObject(new RunControlFactory<S60EmulatorRunControl,
|
||||
S60EmulatorRunConfiguration>
|
||||
(QLatin1String(ProjectExplorer::Constants::RUNMODE),
|
||||
tr("Run in Emulator"), parent));
|
||||
addAutoReleasedObject(new S60DeviceRunConfigurationFactory(this));
|
||||
addAutoReleasedObject(new S60DeviceRunConfigurationFactory);
|
||||
addAutoReleasedObject(new RunControlFactory<S60DeviceRunControl,
|
||||
S60DeviceRunConfiguration>
|
||||
(QLatin1String(ProjectExplorer::Constants::RUNMODE),
|
||||
|
||||
@@ -50,6 +50,11 @@ const char * const BUILD_DIRECTORY_KEY("Qt4ProjectManager.Qt4BuildConfiguration.
|
||||
const char * const TOOLCHAIN_KEY("Qt4ProjectManager.Qt4BuildConfiguration.ToolChain");
|
||||
const char * const BUILD_CONFIGURATION_KEY("Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration");
|
||||
const char * const QT_VERSION_ID_KEY("Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId");
|
||||
|
||||
enum {
|
||||
debug = false
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4Project *pro) :
|
||||
|
||||
@@ -1023,6 +1023,26 @@ QList<Qt4ProFileNode *> Qt4Project::applicationProFiles() const
|
||||
return list;
|
||||
}
|
||||
|
||||
bool Qt4Project::hasApplicationProFile(const QString &path) const
|
||||
{
|
||||
if (path.isEmpty())
|
||||
return false;
|
||||
|
||||
QList<Qt4ProFileNode *> list = applicationProFiles();
|
||||
foreach (Qt4ProFileNode * node, list)
|
||||
if (node->path() == path)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList Qt4Project::applicationProFilePathes(const QString &prepend) const
|
||||
{
|
||||
QStringList proFiles;
|
||||
foreach (Qt4ProFileNode *node, applicationProFiles())
|
||||
proFiles.append(prepend + node->path());
|
||||
return proFiles;
|
||||
}
|
||||
|
||||
void Qt4Project::projectTypeChanged(Qt4ProFileNode *node, const Qt4ProjectType oldType, const Qt4ProjectType newType)
|
||||
{
|
||||
if (oldType == Internal::ApplicationTemplate
|
||||
|
||||
@@ -171,6 +171,8 @@ public:
|
||||
QList<ProjectExplorer::BuildConfigWidget*> subConfigWidgets();
|
||||
|
||||
QList<Internal::Qt4ProFileNode *> applicationProFiles() const;
|
||||
bool hasApplicationProFile(const QString &path) const;
|
||||
QStringList applicationProFilePathes(const QString &prepend = QString()) const;
|
||||
|
||||
void notifyChanged(const QString &name);
|
||||
|
||||
|
||||
@@ -57,29 +57,65 @@ using ProjectExplorer::LocalApplicationRunConfiguration;
|
||||
using ProjectExplorer::PersistentSettingsReader;
|
||||
using ProjectExplorer::PersistentSettingsWriter;
|
||||
|
||||
Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *pro, const QString &proFilePath)
|
||||
: LocalApplicationRunConfiguration(pro),
|
||||
m_proFilePath(proFilePath),
|
||||
m_runMode(Gui),
|
||||
m_userSetName(false),
|
||||
m_cachedTargetInformationValid(false),
|
||||
m_isUsingDyldImageSuffix(false),
|
||||
m_userSetWokingDirectory(false),
|
||||
m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase)
|
||||
namespace {
|
||||
const char * const QT4_RC_ID("Qt4ProjectManager.Qt4RunConfiguration");
|
||||
const char * const QT4_RC_PREFIX("Qt4ProjectManager.Qt4RunConfiguration.");
|
||||
|
||||
const char * const COMMAND_LINE_ARGUMENTS_KEY("Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments");
|
||||
const char * const PRO_FILE_KEY("Qt4ProjectManager.Qt4RunConfiguration.ProFile");
|
||||
const char * const USER_SET_NAME_KEY("Qt4ProjectManager.Qt4RunConfiguration.UserSetName");
|
||||
const char * const USE_TERMINAL_KEY("Qt4ProjectManager.Qt4RunConfiguration.UseTerminal");
|
||||
const char * const USE_DYLD_IMAGE_SUFFIX_KEY("Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix");
|
||||
const char * const USER_ENVIRONMENT_CHANGES_KEY("Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges");
|
||||
const char * const BASE_ENVIRONMENT_BASE_KEY("Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase");
|
||||
const char * const USER_SET_WORKING_DIRECTORY_KEY("Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory");
|
||||
const char * const USER_WORKING_DIRECTORY_KEY("Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory");
|
||||
|
||||
QString pathFromId(const QString &id)
|
||||
{
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
||||
else
|
||||
setDisplayName(tr("Qt4RunConfiguration"));
|
||||
if (!id.startsWith(QLatin1String(QT4_RC_PREFIX)))
|
||||
return QString();
|
||||
return id.mid(QString::fromLatin1(QT4_RC_PREFIX).size());
|
||||
}
|
||||
|
||||
connect(pro, SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(invalidateCachedTargetInformation()));
|
||||
QString pathToId(const QString &path)
|
||||
{
|
||||
return QString::fromLatin1(QT4_RC_PREFIX) + path;
|
||||
}
|
||||
|
||||
connect(pro, SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
} // namespace
|
||||
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
//
|
||||
// Qt4RunConfiguration
|
||||
//
|
||||
|
||||
Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *parent, const QString &proFilePath) :
|
||||
LocalApplicationRunConfiguration(parent, QLatin1String(QT4_RC_ID)),
|
||||
m_proFilePath(proFilePath),
|
||||
m_runMode(Gui),
|
||||
m_userSetName(false),
|
||||
m_cachedTargetInformationValid(false),
|
||||
m_isUsingDyldImageSuffix(false),
|
||||
m_userSetWokingDirectory(false),
|
||||
m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *parent, Qt4RunConfiguration *source) :
|
||||
LocalApplicationRunConfiguration(parent, source),
|
||||
m_commandLineArguments(source->m_commandLineArguments),
|
||||
m_proFilePath(source->m_proFilePath),
|
||||
m_runMode(source->m_runMode),
|
||||
m_userSetName(source->m_userSetName),
|
||||
m_cachedTargetInformationValid(false),
|
||||
m_isUsingDyldImageSuffix(source->m_isUsingDyldImageSuffix),
|
||||
m_userSetWokingDirectory(source->m_userSetWokingDirectory),
|
||||
m_userWorkingDirectory(source->m_userWorkingDirectory),
|
||||
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
|
||||
m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
Qt4RunConfiguration::~Qt4RunConfiguration()
|
||||
@@ -91,11 +127,6 @@ Qt4Project *Qt4RunConfiguration::qt4Project() const
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
QString Qt4RunConfiguration::id() const
|
||||
{
|
||||
return "Qt4ProjectManager.Qt4RunConfiguration";
|
||||
}
|
||||
|
||||
bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(configuration);
|
||||
@@ -119,6 +150,19 @@ void Qt4RunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileN
|
||||
invalidateCachedTargetInformation();
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::ctor()
|
||||
{
|
||||
setDefaultDisplayName();
|
||||
connect(qt4Project(), SIGNAL(targetInformationChanged()),
|
||||
this, SLOT(invalidateCachedTargetInformation()));
|
||||
|
||||
connect(qt4Project(), SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
|
||||
connect(qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||
}
|
||||
|
||||
//////
|
||||
/// Qt4RunConfigurationWidget
|
||||
/////
|
||||
@@ -402,41 +446,43 @@ QWidget *Qt4RunConfiguration::configurationWidget()
|
||||
return new Qt4RunConfigurationWidget(this, 0);
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||
QVariantMap Qt4RunConfiguration::toMap() const
|
||||
{
|
||||
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
writer.saveValue("CommandLineArguments", m_commandLineArguments);
|
||||
writer.saveValue("ProFile", projectDir.relativeFilePath(m_proFilePath));
|
||||
writer.saveValue("UserSetName", m_userSetName);
|
||||
writer.saveValue("UseTerminal", m_runMode == Console);
|
||||
writer.saveValue("UseDyldImageSuffix", m_isUsingDyldImageSuffix);
|
||||
writer.saveValue("UserEnvironmentChanges", ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||
writer.saveValue("BaseEnvironmentBase", m_baseEnvironmentBase);
|
||||
writer.saveValue("UserSetWorkingDirectory", m_userSetWokingDirectory);
|
||||
writer.saveValue("UserWorkingDirectory", m_userWorkingDirectory);
|
||||
LocalApplicationRunConfiguration::save(writer);
|
||||
QVariantMap map(LocalApplicationRunConfiguration::toMap());
|
||||
map.insert(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY), m_commandLineArguments);
|
||||
map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath));
|
||||
map.insert(QLatin1String(USER_SET_NAME_KEY), m_userSetName);
|
||||
map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console);
|
||||
map.insert(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), m_isUsingDyldImageSuffix);
|
||||
map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||
map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), m_baseEnvironmentBase);
|
||||
map.insert(QLatin1String(USER_SET_WORKING_DIRECTORY_KEY), m_userSetWokingDirectory);
|
||||
map.insert(QLatin1String(USER_WORKING_DIRECTORY_KEY), m_userWorkingDirectory);
|
||||
return map;
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||
bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
LocalApplicationRunConfiguration::restore(reader);
|
||||
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||
m_commandLineArguments = reader.restoreValue("CommandLineArguments").toStringList();
|
||||
m_proFilePath = projectDir.filePath(reader.restoreValue("ProFile").toString());
|
||||
m_userSetName = reader.restoreValue("UserSetName").toBool();
|
||||
m_runMode = reader.restoreValue("UseTerminal").toBool() ? Console : Gui;
|
||||
m_isUsingDyldImageSuffix = reader.restoreValue("UseDyldImageSuffix").toBool();
|
||||
QVariant v = reader.restoreValue("UserSetWorkingDirectory");
|
||||
m_userSetWokingDirectory = v.isValid() ? v.toBool() : false;
|
||||
m_userWorkingDirectory = reader.restoreValue("UserWorkingDirectory").toString();
|
||||
m_commandLineArguments = map.value(QLatin1String(COMMAND_LINE_ARGUMENTS_KEY)).toStringList();
|
||||
m_proFilePath = projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString());
|
||||
m_userSetName = map.value(QLatin1String(USER_SET_NAME_KEY), false).toBool();
|
||||
m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY), false).toBool() ? Console : Gui;
|
||||
m_isUsingDyldImageSuffix = map.value(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), false).toBool();
|
||||
|
||||
m_userSetWokingDirectory = map.value(QLatin1String(USER_SET_WORKING_DIRECTORY_KEY), false).toBool();
|
||||
m_userWorkingDirectory = map.value(QLatin1String(USER_WORKING_DIRECTORY_KEY)).toString();
|
||||
|
||||
if (!m_proFilePath.isEmpty()) {
|
||||
m_cachedTargetInformationValid = false;
|
||||
if (!m_userSetName)
|
||||
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
||||
setDefaultDisplayName();
|
||||
}
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(reader.restoreValue("UserEnvironmentChanges").toStringList());
|
||||
QVariant tmp = reader.restoreValue("BaseEnvironmentBase");
|
||||
m_baseEnvironmentBase = tmp.isValid() ? BaseEnvironmentBase(tmp.toInt()) : Qt4RunConfiguration::BuildEnvironmentBase;
|
||||
m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
|
||||
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(Qt4RunConfiguration::BuildEnvironmentBase)).toInt());
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
||||
QString Qt4RunConfiguration::executable() const
|
||||
@@ -526,7 +572,7 @@ void Qt4RunConfiguration::setUserEnvironmentChanges(const QList<ProjectExplorer:
|
||||
|
||||
void Qt4RunConfiguration::setWorkingDirectory(const QString &wd)
|
||||
{
|
||||
if (wd== "") {
|
||||
if (wd.isEmpty()) {
|
||||
m_userSetWokingDirectory = false;
|
||||
m_userWorkingDirectory = QString::null;
|
||||
emit workingDirectoryChanged(workingDirectory());
|
||||
@@ -553,12 +599,11 @@ void Qt4RunConfiguration::setUserName(const QString &name)
|
||||
{
|
||||
if (name.isEmpty()) {
|
||||
m_userSetName = false;
|
||||
setDisplayName(tr("Qt4RunConfiguration"));
|
||||
setDefaultDisplayName();
|
||||
} else {
|
||||
m_userSetName = true;
|
||||
setDisplayName(name);
|
||||
}
|
||||
emit displayNameChanged(name);
|
||||
}
|
||||
|
||||
QString Qt4RunConfiguration::proFilePath() const
|
||||
@@ -616,6 +661,16 @@ QStringList Qt4RunConfiguration::dumperLibraryLocations() const
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::setDefaultDisplayName()
|
||||
{
|
||||
if (m_userSetName)
|
||||
return;
|
||||
if (!m_proFilePath.isEmpty())
|
||||
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
||||
else
|
||||
setDisplayName(tr("Qt4 RunConfiguration"));
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env)
|
||||
{
|
||||
if (m_baseEnvironmentBase == env)
|
||||
@@ -639,7 +694,8 @@ ProjectExplorer::ToolChain::ToolChainType Qt4RunConfiguration::toolChainType() c
|
||||
/// This class is used to restore run settings (saved in .user files)
|
||||
///
|
||||
|
||||
Qt4RunConfigurationFactory::Qt4RunConfigurationFactory()
|
||||
Qt4RunConfigurationFactory::Qt4RunConfigurationFactory(QObject *parent) :
|
||||
ProjectExplorer::IRunConfigurationFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -647,42 +703,68 @@ Qt4RunConfigurationFactory::~Qt4RunConfigurationFactory()
|
||||
{
|
||||
}
|
||||
|
||||
// used to recreate the runConfigurations when restoring settings
|
||||
bool Qt4RunConfigurationFactory::canRestore(const QString &id) const
|
||||
bool Qt4RunConfigurationFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const
|
||||
{
|
||||
return id == "Qt4ProjectManager.Qt4RunConfiguration";
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(parent);
|
||||
if (!qt4project)
|
||||
return false;
|
||||
return qt4project->hasApplicationProFile(pathFromId(id));
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &id)
|
||||
ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::create(ProjectExplorer::Project *parent, const QString &id)
|
||||
{
|
||||
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
||||
Q_ASSERT(p);
|
||||
if (id.startsWith("Qt4RunConfiguration.")) {
|
||||
QString fileName = id.mid(QString("Qt4RunConfiguration.").size());
|
||||
return new Qt4RunConfiguration(p, fileName);
|
||||
}
|
||||
Q_ASSERT(id == "Qt4ProjectManager.Qt4RunConfiguration");
|
||||
// The right path is set in restoreSettings
|
||||
return new Qt4RunConfiguration(p, QString::null);
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
return new Qt4RunConfiguration(project, pathFromId(id));
|
||||
}
|
||||
|
||||
bool Qt4RunConfigurationFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const
|
||||
{
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
QString id(ProjectExplorer::idFromMap(map));
|
||||
return id.startsWith(QLatin1String(QT4_RC_ID));
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map)
|
||||
{
|
||||
if (!canRestore(parent, map))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
Qt4RunConfiguration *rc(new Qt4RunConfiguration(project, QString()));
|
||||
if (rc->fromMap(map))
|
||||
return rc;
|
||||
|
||||
delete rc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Qt4RunConfigurationFactory::canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const
|
||||
{
|
||||
if (!qobject_cast<Qt4Project *>(parent))
|
||||
return false;
|
||||
return source->id().startsWith(QLatin1String(QT4_RC_ID));
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source)
|
||||
{
|
||||
if (!canClone(parent, source))
|
||||
return 0;
|
||||
Qt4Project *project(static_cast<Qt4Project *>(parent));
|
||||
Qt4RunConfiguration *old(static_cast<Qt4RunConfiguration *>(source));
|
||||
return new Qt4RunConfiguration(project, old);
|
||||
}
|
||||
|
||||
QStringList Qt4RunConfigurationFactory::availableCreationIds(ProjectExplorer::Project *pro) const
|
||||
{
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro);
|
||||
if (qt4project) {
|
||||
QStringList applicationProFiles;
|
||||
QList<Qt4ProFileNode *> list = qt4project->applicationProFiles();
|
||||
foreach (Qt4ProFileNode * node, list) {
|
||||
applicationProFiles.append("Qt4RunConfiguration." + node->path());
|
||||
}
|
||||
return applicationProFiles;
|
||||
} else {
|
||||
if (!qt4project)
|
||||
return QStringList();
|
||||
}
|
||||
return qt4project->applicationProFilePathes(QLatin1String(QT4_RC_PREFIX));
|
||||
}
|
||||
|
||||
QString Qt4RunConfigurationFactory::displayNameForId(const QString &id) const
|
||||
{
|
||||
QString fileName = id.mid(QString("Qt4RunConfiguration.").size());
|
||||
return QFileInfo(fileName).completeBaseName();
|
||||
return QFileInfo(pathFromId(id)).completeBaseName();
|
||||
}
|
||||
|
||||
@@ -55,23 +55,23 @@ class Qt4Project;
|
||||
namespace Internal {
|
||||
class Qt4PriFileNode;
|
||||
class Qt4ProFileNode;
|
||||
class Qt4RunConfigurationFactory;
|
||||
|
||||
class Qt4RunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
// to change the display name and arguments and set the userenvironmentchanges
|
||||
friend class Qt4RunConfigurationWidget;
|
||||
friend class Qt4RunConfigurationFactory;
|
||||
|
||||
public:
|
||||
Qt4RunConfiguration(Qt4Project *pro, const QString &proFilePath);
|
||||
Qt4RunConfiguration(Qt4Project *parent, const QString &proFilePath);
|
||||
virtual ~Qt4RunConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
virtual QString id() const;
|
||||
virtual bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
virtual QWidget *configurationWidget();
|
||||
virtual void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
|
||||
virtual void restore(const ProjectExplorer::PersistentSettingsReader &reader);
|
||||
|
||||
virtual QString executable() const;
|
||||
virtual RunMode runMode() const;
|
||||
@@ -87,6 +87,7 @@ public:
|
||||
QString proFilePath() const;
|
||||
|
||||
// TODO detectQtShadowBuild() ? how did this work ?
|
||||
QVariantMap toMap() const;
|
||||
|
||||
public slots:
|
||||
// This function is called if:
|
||||
@@ -115,13 +116,20 @@ private slots:
|
||||
void setUserName(const QString&);
|
||||
void setRunMode(RunMode runMode);
|
||||
|
||||
protected:
|
||||
Qt4RunConfiguration(Qt4Project *parent, Qt4RunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
||||
SystemEnvironmentBase = 1,
|
||||
BuildEnvironmentBase = 2 };
|
||||
void setDefaultDisplayName();
|
||||
void setBaseEnvironmentBase(BaseEnvironmentBase env);
|
||||
BaseEnvironmentBase baseEnvironmentBase() const;
|
||||
|
||||
void ctor();
|
||||
|
||||
ProjectExplorer::Environment baseEnvironment() const;
|
||||
QString baseEnvironmentText() const;
|
||||
void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff);
|
||||
@@ -132,7 +140,6 @@ private:
|
||||
QString m_proFilePath; // Full path to the Application Pro File
|
||||
|
||||
// Cached startup sub project information
|
||||
QStringList m_targets;
|
||||
QString m_executable;
|
||||
QString m_workingDir;
|
||||
ProjectExplorer::LocalApplicationRunConfiguration::RunMode m_runMode;
|
||||
@@ -148,6 +155,7 @@ private:
|
||||
class Qt4RunConfigurationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4runconfigration, QWidget *parent);
|
||||
protected:
|
||||
@@ -194,12 +202,19 @@ private:
|
||||
class Qt4RunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Qt4RunConfigurationFactory();
|
||||
explicit Qt4RunConfigurationFactory(QObject *parent = 0);
|
||||
virtual ~Qt4RunConfigurationFactory();
|
||||
virtual bool canRestore(const QString &id) const;
|
||||
|
||||
virtual bool canCreate(ProjectExplorer::Project *project, const QString &id) const;
|
||||
virtual ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
|
||||
virtual bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
|
||||
virtual ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
|
||||
virtual bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const;
|
||||
virtual ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source);
|
||||
|
||||
QStringList availableCreationIds(ProjectExplorer::Project *parent) const;
|
||||
QString displayNameForId(const QString &id) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user