forked from qt-creator/qt-creator
QmlProjectManager: Aspect-ify runconfiguration
Split the remaining manually managed data into a standard ArgumentsAspect and a new MainQmlFileAspect. Change-Id: I8a8fe3f4a08d602a7b6e9c9463d3d7de257b6e6c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -30,61 +30,31 @@
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
|
||||
namespace Core { class IEditor; }
|
||||
|
||||
namespace QmlProjectManager {
|
||||
class QmlProject;
|
||||
|
||||
namespace Internal { class QmlProjectRunConfigurationWidget; }
|
||||
class MainQmlFileAspect;
|
||||
|
||||
class QMLPROJECTMANAGER_EXPORT QmlProjectRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class Internal::QmlProjectRunConfigurationWidget;
|
||||
friend class QmlProject; // to call updateEnabled()
|
||||
|
||||
public:
|
||||
QmlProjectRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
||||
|
||||
ProjectExplorer::Runnable runnable() const override;
|
||||
|
||||
enum MainScriptSource {
|
||||
FileInEditor,
|
||||
FileInProjectFile,
|
||||
FileInSettings
|
||||
};
|
||||
MainScriptSource mainScriptSource() const;
|
||||
void setScriptSource(MainScriptSource source, const QString &settingsPath = QString());
|
||||
|
||||
QString mainScript() const;
|
||||
|
||||
QString disabledReason() const override;
|
||||
QWidget *createConfigurationWidget() override;
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
ProjectExplorer::Abi abi() const override;
|
||||
ProjectExplorer::BaseStringAspect *qmlViewerAspect() const { return m_qmlViewerAspect; }
|
||||
|
||||
signals:
|
||||
void scriptSourceChanged();
|
||||
|
||||
private:
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
friend class MainQmlFileAspect;
|
||||
|
||||
void changeCurrentFile(Core::IEditor* = 0);
|
||||
ProjectExplorer::Runnable runnable() const final;
|
||||
QString disabledReason() const final;
|
||||
ProjectExplorer::Abi abi() const final;
|
||||
void updateEnabledState() final;
|
||||
|
||||
QString mainScript() const;
|
||||
QString executable() const;
|
||||
QString commandLineArguments() const;
|
||||
|
||||
// absolute path to current file (if being used)
|
||||
QString m_currentFileFilename;
|
||||
// absolute path to selected main script (if being used)
|
||||
QString m_mainScriptFilename;
|
||||
|
||||
QString m_scriptFile;
|
||||
QString m_qmlViewerArgs;
|
||||
ProjectExplorer::BaseStringAspect *m_qmlViewerAspect;
|
||||
MainQmlFileAspect *m_mainQmlFileAspect;
|
||||
};
|
||||
|
||||
namespace Internal {
|
||||
|
||||
Reference in New Issue
Block a user