forked from qt-creator/qt-creator
Add wizard and mime type for SCXML
This allows us to easily add scxml files to a qmake project. Change-Id: I2b5b21683f3e76062e6858fb8d0bceaa699a5569 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
3
share/qtcreator/templates/wizards/files/scxml/file.scxml
Normal file
3
share/qtcreator/templates/wizards/files/scxml/file.scxml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="%{Name}">
|
||||||
|
</scxml>
|
66
share/qtcreator/templates/wizards/files/scxml/wizard.json
Normal file
66
share/qtcreator/templates/wizards/files/scxml/wizard.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"supportedProjectTypes": [ ],
|
||||||
|
"id": "F.Scxml",
|
||||||
|
"category": "O.Model",
|
||||||
|
"trDescription": "Creates a new, empty, state chart.",
|
||||||
|
"trDisplayName": "State Chart",
|
||||||
|
"trDisplayCategory": "Modeling",
|
||||||
|
"platformIndependent": true,
|
||||||
|
"icon": "../../global/genericfilewizard.png",
|
||||||
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QtSupport') >= 0}",
|
||||||
|
|
||||||
|
"options":
|
||||||
|
[
|
||||||
|
{ "key": "TargetPath", "value": "%{JS: Util.fileName('%{Location}/%{FileName}', '%{JS: Util.preferredSuffix('application/scxml+xml')}')}" },
|
||||||
|
{ "key": "FileName", "value": "%{Name}" }
|
||||||
|
],
|
||||||
|
|
||||||
|
"pages" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"trDisplayName": "State Chart Name and Location",
|
||||||
|
"trShortTitle": "Location",
|
||||||
|
"typeId": "Fields",
|
||||||
|
"data":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Name",
|
||||||
|
"trDisplayName": "State Chart name:",
|
||||||
|
"mandatory": true,
|
||||||
|
"type": "LineEdit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Location",
|
||||||
|
"trDisplayName": "Location:",
|
||||||
|
"type": "PathChooser",
|
||||||
|
"isComplete": "%{JS: '%{Location}' === '' || !Util.exists('%{TargetPath}')}",
|
||||||
|
"trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.",
|
||||||
|
"data":
|
||||||
|
{
|
||||||
|
"kind": "existingDirectory",
|
||||||
|
"basePath": "%{InitialPath}",
|
||||||
|
"path": "%{InitialPath}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"trDisplayName": "Project Management",
|
||||||
|
"trShortTitle": "Summary",
|
||||||
|
"typeId": "Summary"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"generators" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"typeId": "File",
|
||||||
|
"data":
|
||||||
|
{
|
||||||
|
"source": "file.scxml",
|
||||||
|
"target": "%{TargetPath}",
|
||||||
|
"openInEditor": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -159,6 +159,7 @@ const char LINGUIST_MIMETYPE[] = "text/vnd.trolltech.linguist";
|
|||||||
const char FORM_MIMETYPE[] = "application/x-designer";
|
const char FORM_MIMETYPE[] = "application/x-designer";
|
||||||
const char QML_MIMETYPE[] = "text/x-qml"; // separate def also in qmljstoolsconstants.h
|
const char QML_MIMETYPE[] = "text/x-qml"; // separate def also in qmljstoolsconstants.h
|
||||||
const char RESOURCE_MIMETYPE[] = "application/vnd.qt.xml.resource";
|
const char RESOURCE_MIMETYPE[] = "application/vnd.qt.xml.resource";
|
||||||
|
const char SCXML_MIMETYPE[] = "application/scxml+xml";
|
||||||
|
|
||||||
// Settings page
|
// Settings page
|
||||||
const char PROJECTEXPLORER_SETTINGS_CATEGORY[] = "K.ProjectExplorer";
|
const char PROJECTEXPLORER_SETTINGS_CATEGORY[] = "K.ProjectExplorer";
|
||||||
|
@@ -1438,6 +1438,9 @@ QString QmakePriFileNode::varNameForAdding(const QString &mimeType)
|
|||||||
if (mimeType == QLatin1String(ProjectExplorer::Constants::QML_MIMETYPE))
|
if (mimeType == QLatin1String(ProjectExplorer::Constants::QML_MIMETYPE))
|
||||||
return QLatin1String("DISTFILES");
|
return QLatin1String("DISTFILES");
|
||||||
|
|
||||||
|
if (mimeType == QLatin1String(ProjectExplorer::Constants::SCXML_MIMETYPE))
|
||||||
|
return QLatin1String("STATECHARTS");
|
||||||
|
|
||||||
if (mimeType == QLatin1String(Constants::PROFILE_MIMETYPE))
|
if (mimeType == QLatin1String(Constants::PROFILE_MIMETYPE))
|
||||||
return QLatin1String("SUBDIRS");
|
return QLatin1String("SUBDIRS");
|
||||||
|
|
||||||
@@ -1464,6 +1467,7 @@ QStringList QmakePriFileNode::varNamesForRemoving()
|
|||||||
vars << QLatin1String("DISTFILES");
|
vars << QLatin1String("DISTFILES");
|
||||||
vars << QLatin1String("ICON");
|
vars << QLatin1String("ICON");
|
||||||
vars << QLatin1String("QMAKE_INFO_PLIST");
|
vars << QLatin1String("QMAKE_INFO_PLIST");
|
||||||
|
vars << QLatin1String("STATECHARTS");
|
||||||
return vars;
|
return vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,4 +11,9 @@
|
|||||||
</magic>
|
</magic>
|
||||||
<glob pattern="*.ts" weight="70"/>
|
<glob pattern="*.ts" weight="70"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
|
<mime-type type="application/scxml+xml">
|
||||||
|
<comment>Scxml State Chart</comment>
|
||||||
|
<sub-class-of type="application/xml"/>
|
||||||
|
<glob pattern="*.scxml"/>
|
||||||
|
</mime-type>
|
||||||
</mime-info>
|
</mime-info>
|
||||||
|
Reference in New Issue
Block a user