2009-07-20 10:17:30 +02:00
|
|
|
/**************************************************************************
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2009-07-20 10:17:30 +02:00
|
|
|
**
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
**
|
|
|
|
** Commercial Usage
|
|
|
|
**
|
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Nokia.
|
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
**
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
**
|
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2009-07-20 10:17:30 +02:00
|
|
|
**
|
|
|
|
**************************************************************************/
|
|
|
|
|
2009-06-16 15:11:47 +02:00
|
|
|
#ifndef S60EMULATORRUNCONFIGURATION_H
|
|
|
|
#define S60EMULATORRUNCONFIGURATION_H
|
|
|
|
|
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
#include <projectexplorer/applicationlauncher.h>
|
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
#include <QtCore/QVariantMap>
|
2009-06-16 15:11:47 +02:00
|
|
|
#include <QtGui/QWidget>
|
2009-10-21 16:48:46 +02:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
namespace Utils {
|
2010-01-19 13:41:02 +01:00
|
|
|
class DetailsWidget;
|
2009-10-21 16:48:46 +02:00
|
|
|
}
|
2009-06-16 15:11:47 +02:00
|
|
|
|
|
|
|
namespace Qt4ProjectManager {
|
2009-11-26 14:43:27 +01:00
|
|
|
class Qt4Project;
|
|
|
|
|
2009-06-16 15:11:47 +02:00
|
|
|
namespace Internal {
|
2009-12-03 18:37:27 +01:00
|
|
|
class Qt4ProFileNode;
|
2010-02-08 15:50:06 +01:00
|
|
|
class Qt4Target;
|
2010-01-19 13:41:02 +01:00
|
|
|
class S60EmulatorRunConfigurationFactory;
|
2009-06-16 15:11:47 +02:00
|
|
|
|
|
|
|
class S60EmulatorRunConfiguration : public ProjectExplorer::RunConfiguration
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2010-01-19 13:41:02 +01:00
|
|
|
friend class S60EmulatorRunConfigurationFactory;
|
|
|
|
|
2009-06-16 15:11:47 +02:00
|
|
|
public:
|
2010-02-08 15:50:06 +01:00
|
|
|
S60EmulatorRunConfiguration(ProjectExplorer::Target *parent, const QString &proFilePath);
|
2010-01-19 13:41:02 +01:00
|
|
|
virtual ~S60EmulatorRunConfiguration();
|
2009-06-16 15:11:47 +02:00
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
Qt4Target *qt4Target() const;
|
2009-11-26 14:43:27 +01:00
|
|
|
|
2009-10-28 17:21:27 +01:00
|
|
|
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
2009-06-16 15:11:47 +02:00
|
|
|
QWidget *configurationWidget();
|
|
|
|
|
|
|
|
QString executable() const;
|
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
2009-06-16 15:11:47 +02:00
|
|
|
signals:
|
|
|
|
void targetInformationChanged();
|
|
|
|
|
|
|
|
private slots:
|
2009-12-03 18:37:27 +01:00
|
|
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
2009-06-16 15:11:47 +02:00
|
|
|
|
2010-01-19 13:41:02 +01:00
|
|
|
protected:
|
2010-02-08 15:50:06 +01:00
|
|
|
S60EmulatorRunConfiguration(ProjectExplorer::Target *parent, S60EmulatorRunConfiguration *source);
|
2010-01-19 13:41:02 +01:00
|
|
|
virtual bool fromMap(const QVariantMap &map);
|
|
|
|
|
2009-06-16 15:11:47 +02:00
|
|
|
private:
|
2010-01-19 13:41:02 +01:00
|
|
|
void ctor();
|
2009-06-16 15:11:47 +02:00
|
|
|
void updateTarget();
|
|
|
|
|
|
|
|
QString m_proFilePath;
|
|
|
|
};
|
|
|
|
|
|
|
|
class S60EmulatorRunConfigurationWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
S60EmulatorRunConfigurationWidget(S60EmulatorRunConfiguration *runConfiguration,
|
|
|
|
QWidget *parent = 0);
|
|
|
|
|
|
|
|
private slots:
|
2010-01-07 18:17:24 +01:00
|
|
|
void displayNameEdited(const QString &text);
|
2009-06-16 15:11:47 +02:00
|
|
|
void updateTargetInformation();
|
|
|
|
|
|
|
|
private:
|
|
|
|
S60EmulatorRunConfiguration *m_runConfiguration;
|
2009-10-21 16:48:46 +02:00
|
|
|
Utils::DetailsWidget *m_detailsWidget;
|
2009-06-16 15:11:47 +02:00
|
|
|
QLineEdit *m_nameLineEdit;
|
|
|
|
QLabel *m_executableLabel;
|
|
|
|
};
|
|
|
|
|
|
|
|
class S60EmulatorRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2010-01-19 13:41:02 +01:00
|
|
|
explicit S60EmulatorRunConfigurationFactory(QObject *parent = 0);
|
2009-06-16 15:11:47 +02:00
|
|
|
~S60EmulatorRunConfigurationFactory();
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
bool canCreate(ProjectExplorer::Target *project, const QString &id) const;
|
|
|
|
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const QString &id);
|
|
|
|
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
|
|
|
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
|
|
|
|
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
|
|
|
|
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
|
2010-01-19 13:41:02 +01:00
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
QStringList availableCreationIds(ProjectExplorer::Target *pro) const;
|
2010-01-07 18:17:24 +01:00
|
|
|
// used to translate the ids to names to display to the user
|
|
|
|
QString displayNameForId(const QString &id) const;
|
2009-06-16 15:11:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class S60EmulatorRunControl : public ProjectExplorer::RunControl
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2009-10-08 18:37:18 +02:00
|
|
|
explicit S60EmulatorRunControl(S60EmulatorRunConfiguration *runConfiguration);
|
2009-06-16 15:11:47 +02:00
|
|
|
~S60EmulatorRunControl() {}
|
|
|
|
void start();
|
|
|
|
void stop();
|
|
|
|
bool isRunning() const;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void processExited(int exitCode);
|
|
|
|
void slotAddToOutputWindow(const QString &line);
|
|
|
|
void slotError(const QString & error);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
|
|
|
QString m_executable;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
} // namespace Qt4ProjectManager
|
|
|
|
|
|
|
|
#endif // S60EMULATORRUNCONFIGURATION_H
|