{
    "version": 1,
    "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ],
    "id": "U.QtQuickApplication",
    "category": "F.Application",
    "trDescription": "Creates a deployable Qt Quick 2 application.",
    "trDisplayName": "Qt Quick Application",
    "trDisplayCategory": "Application",
    "icon": "qml_wizard.png",
    "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.3" ],
    "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}",

    "options":
    [
        { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" },
        { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
        { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" },
        { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
        { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
        { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.qtQuickVersion}" },
        { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.qtQuickWindowVersion}" },
        { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.qtQuickVirtualKeyboardImport}" },
        { "key": "QtQuickVirtualKeyboardWhenVisible", "value": "%{JS: %{QtVersion}.qtQuickVirtualKeyboardWhenVisible}" },
        { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" },
        { "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" },
        { "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" },
        { "key": "UseVirtualKeyboard", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0}" }
    ],

    "pages":
    [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project"
        },
        {
            "trDisplayName": "Define Build System",
            "trShortTitle": "Build System",
            "typeId": "Fields",
            "enabled": "%{JS: ! %{IsSubproject}}",
            "data":
            [
                {
                    "name": "BuildSystem",
                    "trDisplayName": "Build system:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                        [
                            {
                                "trKey": "qmake",
                                "value": "qmake",
                                "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}"
                            },
                            {
                                "trKey": "CMake",
                                "value": "cmake",
                                "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}"
                            },
                            {
                                "trKey": "Qbs",
                                "value": "qbs",
                                "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "trDisplayName": "Define Project Details",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data":
            [
                {
                    "name": "QtVersion",
                    "trDisplayName": "Minimal required Qt version:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 2,
                        "items":
                        [
                            {
                                "trKey": "Qt 5.8",
                                "value":
                                "{
                                    'qtQuickVersion': '2.8',
                                    'qtQuickWindowVersion': '2.2',
                                    'qtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1',
                                    'qtQuickVirtualKeyboardWhenVisible': 'inputPanel.active'
                                }"
                            },
                            {
                                "trKey": "Qt 5.7",
                                "value":
                                "{
                                    'qtQuickVersion': '2.7',
                                    'qtQuickWindowVersion': '2.2',
                                    'qtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1',
                                    'qtQuickVirtualKeyboardWhenVisible': 'inputPanel.active'
                                }"
                            },
                            {
                                "trKey": "Qt 5.6",
                                "value":
                                "{
                                    'qtQuickVersion': '2.6',
                                    'qtQuickWindowVersion': '2.2',
                                    'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 2.0',
                                    'qtQuickVirtualKeyboardWhenVisible': 'inputPanel.active'
                                }"
                            },
                            {
                                "trKey": "Qt 5.5",
                                "value":
                                "{
                                    'qtQuickVersion': '2.5',
                                    'qtQuickWindowVersion': '2.2',
                                    'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 1.3',
                                    'qtQuickVirtualKeyboardWhenVisible': 'Qt.inputMethod.visible'
                                }"
                            },
                            {
                                "trKey": "Qt 5.4",
                                "value":
                                "{
                                    'qtQuickVersion': '2.4',
                                    'qtQuickWindowVersion': '2.2',
                                    'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 1.0',
                                    'qtQuickVirtualKeyboardWhenVisible': 'Qt.inputMethod.visible'
                                }"
                            },
                            {
                                "trKey": "Qt 5.3",
                                "value":
                                "{
                                    'qtQuickVersion': '2.3',
                                    'qtQuickWindowVersion': '2.2',
                                    'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 1.0',
                                    'qtQuickVirtualKeyboardWhenVisible': 'Qt.inputMethod.visible'
                                }"
                            }
                        ]
                    }
                },
                {
                    "name": "QmlUiSplit",
                    "trDisplayName": "With ui.qml file",
                    "type": "CheckBox",
                    "visible": "%{UiSupport}",
                    "data":
                    {
                        "checked": true
                    }
                }
            ]
        },
        {
            "trDisplayName": "Kit Selection",
            "trShortTitle": "Kits",
            "typeId": "Kits",
            "enabled": "%{JS: ! %{IsSubproject}}",
            "data": {
                "projectFilePath": "%{ProjectFile}",
                "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ]
            }
        },
        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],
    "generators":
    [
        {
            "typeId": "File",
            "data":
            [
                {
                    "source": "app.pro",
                    "target": "%{ProFile}",
                    "openAsProject": true,
                    "condition": "%{JS: '%{BuildSystem}' === 'qmake'}"
                },
                {
                    "source": "CMakeLists.txt",
                    "openAsProject": true,
                    "condition": "%{JS: '%{BuildSystem}' === 'cmake'}"
                },
                {
                    "source": "file.qbs",
                    "target": "%{QbsFile}",
                    "openAsProject": true,
                    "condition": "%{JS: '%{BuildSystem}' === 'qbs'}"
                },
                {
                    "source": "main.cpp",
                    "target": "%{MainCppFileName}"
                },
                {
                    "source": "main.qml.tpl",
                    "target": "main.qml",
                    "openInEditor": true
                },
                {
                    "source": "MainForm.ui.qml.tpl",
                    "target": "MainForm.ui.qml",
                    "condition": "%{IsUiFileInUse}"
                },
                {
                    "source": "qml.qrc"
                },
                {
                    "source": "../git.ignore",
                    "target": ".gitignore",
                    "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}"
                }
            ]
        }
    ]
}
