forked from qt-creator/qt-creator
CompilerExplorer: Add wizard template
Also include "src/plugins/**/wizard.json" into .gitignore. Change-Id: Ib0576df15af4c112a4a27101d337522db6c19f25 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -56,6 +56,7 @@ CMakeLists.txt.user*
|
||||
/share/qtcreator/qmldesigner/QtProject/
|
||||
/src/app/Info.plist
|
||||
/src/plugins/**/*.json
|
||||
!/src/plugins/**/wizard.json
|
||||
/src/plugins/coreplugin/ide_version.h
|
||||
/src/libs/qt-breakpad/bin
|
||||
/.cmake/
|
||||
|
@@ -1,5 +1,5 @@
|
||||
add_qtc_plugin(CompilerExplorer
|
||||
PLUGIN_DEPENDS Core TextEditor
|
||||
PLUGIN_DEPENDS Core ProjectExplorer TextEditor
|
||||
DEPENDS Qt::Network TerminalLib Spinner
|
||||
SOURCES
|
||||
api/config.h
|
||||
@@ -14,6 +14,8 @@ add_qtc_plugin(CompilerExplorer
|
||||
api/library.h
|
||||
api/request.h
|
||||
|
||||
compilerexplorer.qrc
|
||||
|
||||
compilerexploreraspects.cpp
|
||||
compilerexploreraspects.h
|
||||
compilerexplorerplugin.cpp
|
||||
|
@@ -4,6 +4,7 @@ QtcPlugin {
|
||||
name: "CompilerExplorer"
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "Spinner" }
|
||||
Depends { name: "TerminalLib" }
|
||||
Depends { name: "TextEditor" }
|
||||
@@ -22,6 +23,8 @@ QtcPlugin {
|
||||
"api/library.h",
|
||||
"api/request.h",
|
||||
|
||||
"compilerexplorer.qrc",
|
||||
|
||||
"compilerexploreraspects.cpp",
|
||||
"compilerexploreraspects.h",
|
||||
"compilerexplorerconstants.h",
|
||||
|
6
src/plugins/compilerexplorer/compilerexplorer.qrc
Normal file
6
src/plugins/compilerexplorer/compilerexplorer.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/compilerexplorer/wizard/">
|
||||
<file>wizard/cpp/wizard.json</file>
|
||||
<file>wizard/cpp/file.qtce</file>
|
||||
</qresource>
|
||||
</RCC>
|
@@ -136,6 +136,8 @@ Core::IDocument::OpenResult JsonSettingsDocument::open(QString *errorString,
|
||||
return OpenResult::ReadError;
|
||||
}
|
||||
|
||||
setFilePath(filePath);
|
||||
|
||||
m_ceSettings.fromMap(*result);
|
||||
emit settingsChanged();
|
||||
return OpenResult::Success;
|
||||
@@ -171,6 +173,7 @@ bool JsonSettingsDocument::saveImpl(QString *errorString, const FilePath &newFil
|
||||
return false;
|
||||
}
|
||||
|
||||
emit changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -14,10 +14,12 @@
|
||||
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
namespace CompilerExplorer::Internal {
|
||||
@@ -40,6 +42,8 @@ public:
|
||||
settings().defaultDocument().toUtf8());
|
||||
});
|
||||
|
||||
ProjectExplorer::JsonWizardFactory::addWizardPath(":/compilerexplorer/wizard/");
|
||||
|
||||
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||
ActionContainer *mCompilerExplorer = ActionManager::createMenu("Tools.CompilerExplorer");
|
||||
QMenu *menu = mCompilerExplorer->menu();
|
||||
|
10
src/plugins/compilerexplorer/wizard/cpp/file.qtce
Normal file
10
src/plugins/compilerexplorer/wizard/cpp/file.qtce
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Sources": [{
|
||||
"LanguageId": "c++",
|
||||
"Source": "int main() {\n return 0;\n}",
|
||||
"Compilers": [{
|
||||
"Id": "clang_trunk",
|
||||
"Options": "-O3"
|
||||
}]
|
||||
}]
|
||||
}
|
37
src/plugins/compilerexplorer/wizard/cpp/wizard.json
Normal file
37
src/plugins/compilerexplorer/wizard/cpp/wizard.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"version": 1,
|
||||
"supportedProjectTypes": [],
|
||||
"id": "QTCE.CppSource",
|
||||
"category": "U.CompilerExplorer",
|
||||
"trDescription": "Creates an example CompilerExplorer setup for C++.",
|
||||
"trDisplayName": "Compiler Explorer C++ Source",
|
||||
"trDisplayCategory": "Compiler Explorer",
|
||||
"icon": "",
|
||||
"iconKind": "Plain",
|
||||
"options": {
|
||||
"key": "DefaultSuffix",
|
||||
"value": "%{JS: Util.preferredSuffix('application/compiler-explorer')}"
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"trDisplayName": "Location",
|
||||
"trShortTitle": "Location",
|
||||
"typeId": "File"
|
||||
},
|
||||
{
|
||||
"trDisplayName": "Project Management",
|
||||
"trShortTitle": "Summary",
|
||||
"typeId": "Summary"
|
||||
}
|
||||
],
|
||||
"generators": [
|
||||
{
|
||||
"typeId": "File",
|
||||
"data": {
|
||||
"source": "file.qtce",
|
||||
"target": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}",
|
||||
"openInEditor": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user