rename PythonEditor plugin to Python

The plugin does not only contain a pure editor, but all kind of support
for a programming language like project and run support.

Change-Id: I1251367c8db2e7a54986415ffc5b860cb210de3c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-07-15 12:50:29 +02:00
parent 2778a5adab
commit 3213e12ce7
24 changed files with 63 additions and 63 deletions

View File

@@ -7,7 +7,7 @@
"trDisplayName": "Python Class", "trDisplayName": "Python Class",
"trDisplayCategory": "Python", "trDisplayCategory": "Python",
"icon": "../../files/python/icon.png", "icon": "../../files/python/icon.png",
"enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}",
"options": "options":
[ [

View File

@@ -7,7 +7,7 @@
"trDisplayName": "Python File", "trDisplayName": "Python File",
"trDisplayCategory": "Python", "trDisplayCategory": "Python",
"icon": "icon.png", "icon": "icon.png",
"enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}",
"pages" : "pages" :
[ [

View File

@@ -7,7 +7,7 @@
"trDisplayName": "Qt for Python - Empty", "trDisplayName": "Qt for Python - Empty",
"trDisplayCategory": "Application", "trDisplayCategory": "Application",
"icon": "icon.png", "icon": "icon.png",
"enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}",
"featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ],
"options": "options":

View File

@@ -7,7 +7,7 @@
"trDisplayName": "Qt for Python - Window", "trDisplayName": "Qt for Python - Window",
"trDisplayCategory": "Application", "trDisplayCategory": "Application",
"icon": "icon.png", "icon": "icon.png",
"enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}",
"featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ],
"options": "options":

View File

@@ -52,7 +52,7 @@ add_subdirectory(genericprojectmanager)
add_subdirectory(git) add_subdirectory(git)
add_subdirectory(mercurial) add_subdirectory(mercurial)
add_subdirectory(perforce) add_subdirectory(perforce)
add_subdirectory(pythoneditor) add_subdirectory(python)
add_subdirectory(qmakeprojectmanager) add_subdirectory(qmakeprojectmanager)
add_subdirectory(qmljstools) add_subdirectory(qmljstools)
add_subdirectory(qmlprojectmanager) add_subdirectory(qmlprojectmanager)

View File

@@ -34,7 +34,7 @@ SUBDIRS = \
qmljseditor \ qmljseditor \
qmlprojectmanager \ qmlprojectmanager \
glsleditor \ glsleditor \
pythoneditor \ python \
nim \ nim \
mercurial \ mercurial \
bazaar \ bazaar \

View File

@@ -52,7 +52,7 @@ Project {
"perfprofiler/perfprofiler.qbs", "perfprofiler/perfprofiler.qbs",
"projectexplorer/projectexplorer.qbs", "projectexplorer/projectexplorer.qbs",
"qbsprojectmanager/qbsprojectmanager.qbs", "qbsprojectmanager/qbsprojectmanager.qbs",
"pythoneditor/pythoneditor.qbs", "python/python.qbs",
"qmldesigner/qmldesigner.qbs", "qmldesigner/qmldesigner.qbs",
"qmljseditor/qmljseditor.qbs", "qmljseditor/qmljseditor.qbs",
"qmljstools/qmljstools.qbs", "qmljstools/qmljstools.qbs",

View File

@@ -1,9 +1,9 @@
add_qtc_plugin(PythonEditor add_qtc_plugin(Python
PLUGIN_DEPENDS Core QtSupport ProjectExplorer TextEditor PLUGIN_DEPENDS Core QtSupport ProjectExplorer TextEditor
SOURCES SOURCES
pythoneditor.cpp pythoneditor.h pythoneditor.cpp pythoneditor.h
pythoneditorconstants.h pythonconstants.h
pythoneditorplugin.cpp pythoneditorplugin.h pythonplugin.cpp pythonplugin.h
pythonformattoken.h pythonformattoken.h
pythonhighlighter.cpp pythonhighlighter.h pythonhighlighter.cpp pythonhighlighter.h
pythonindenter.cpp pythonindenter.h pythonindenter.cpp pythonindenter.h

View File

@@ -1,5 +1,5 @@
{ {
\"Name\" : \"PythonEditor\", \"Name\" : \"Python\",
\"Version\" : \"$$QTCREATOR_VERSION\", \"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"Vendor\" : \"The Qt Company Ltd\", \"Vendor\" : \"The Qt Company Ltd\",
@@ -13,7 +13,7 @@
\"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\"
], ],
\"Category\" : \"Other Languages\", \"Category\" : \"Other Languages\",
\"Description\" : \"Editor and file creation wizards for Python. Example plugin for QtCreator API demonstration.\", \"Description\" : \"Plugin for supporting the Python language.\",
\"Url\" : \"http://www.qt.io\", \"Url\" : \"http://www.qt.io\",
$$dependencyList, $$dependencyList,

View File

@@ -1,19 +1,19 @@
include(../../qtcreatorplugin.pri) include(../../qtcreatorplugin.pri)
DEFINES += \ DEFINES += \
PYTHONEDITOR_LIBRARY PYTHON_LIBRARY
HEADERS += \ HEADERS += \
pythoneditorplugin.h \ pythonplugin.h \
pythoneditor.h \ pythoneditor.h \
pythoneditorconstants.h \ pythonconstants.h \
pythonhighlighter.h \ pythonhighlighter.h \
pythonindenter.h \ pythonindenter.h \
pythonformattoken.h \ pythonformattoken.h \
pythonscanner.h \ pythonscanner.h \
SOURCES += \ SOURCES += \
pythoneditorplugin.cpp \ pythonplugin.cpp \
pythoneditor.cpp \ pythoneditor.cpp \
pythonhighlighter.cpp \ pythonhighlighter.cpp \
pythonindenter.cpp \ pythonindenter.cpp \

View File

@@ -1,7 +1,7 @@
import qbs 1.0 import qbs 1.0
QtcPlugin { QtcPlugin {
name: "PythonEditor" name: "Python"
Depends { name: "Qt.widgets" } Depends { name: "Qt.widgets" }
Depends { name: "Utils" } Depends { name: "Utils" }
@@ -15,8 +15,8 @@ QtcPlugin {
name: "General" name: "General"
files: [ files: [
"pythoneditor.cpp", "pythoneditor.h", "pythoneditor.cpp", "pythoneditor.h",
"pythoneditorconstants.h", "pythonconstants.h",
"pythoneditorplugin.cpp", "pythoneditorplugin.h", "pythonplugin.cpp", "pythonplugin.h",
"pythonhighlighter.h", "pythonhighlighter.cpp", "pythonhighlighter.h", "pythonhighlighter.cpp",
"pythonindenter.cpp", "pythonindenter.h", "pythonindenter.cpp", "pythonindenter.h",
"pythonformattoken.h", "pythonformattoken.h",

View File

@@ -1,4 +1,4 @@
QTC_PLUGIN_NAME = PythonEditor QTC_PLUGIN_NAME = Python
QTC_LIB_DEPENDS += \ QTC_LIB_DEPENDS += \
extensionsystem \ extensionsystem \
utils utils

View File

@@ -27,7 +27,7 @@
#include <QtGlobal> #include <QtGlobal>
namespace PythonEditor { namespace Python {
namespace Constants { namespace Constants {
const char C_PYTHONEDITOR_ID[] = "PythonEditor.PythonEditor"; const char C_PYTHONEDITOR_ID[] = "PythonEditor.PythonEditor";
@@ -41,4 +41,4 @@ const char C_PY_MIMETYPE[] = "text/x-python";
const char C_PY_MIME_ICON[] = "text-x-python"; const char C_PY_MIME_ICON[] = "text-x-python";
} // namespace Constants } // namespace Constants
} // namespace PythonEditor } // namespace Python

View File

@@ -24,8 +24,8 @@
****************************************************************************/ ****************************************************************************/
#include "pythoneditor.h" #include "pythoneditor.h"
#include "pythoneditorconstants.h" #include "pythonconstants.h"
#include "pythoneditorplugin.h" #include "pythonplugin.h"
#include "pythonindenter.h" #include "pythonindenter.h"
#include "pythonhighlighter.h" #include "pythonhighlighter.h"
@@ -39,7 +39,7 @@
using namespace TextEditor; using namespace TextEditor;
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
PythonEditorFactory::PythonEditorFactory() PythonEditorFactory::PythonEditorFactory()
@@ -62,4 +62,4 @@ PythonEditorFactory::PythonEditorFactory()
} }
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -27,7 +27,7 @@
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
class PythonEditorFactory : public TextEditor::TextEditorFactory class PythonEditorFactory : public TextEditor::TextEditorFactory
@@ -37,4 +37,4 @@ public:
}; };
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -25,7 +25,7 @@
#pragma once #pragma once
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
enum Format { enum Format {
@@ -68,4 +68,4 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -41,7 +41,7 @@
#include <texteditor/texteditorconstants.h> #include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
/** /**
@@ -198,4 +198,4 @@ void PythonHighlighter::highlightImport(Scanner &scanner)
} }
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -27,7 +27,7 @@
#include <texteditor/syntaxhighlighter.h> #include <texteditor/syntaxhighlighter.h>
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
class Scanner; class Scanner;
@@ -47,4 +47,4 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -30,7 +30,7 @@
#include <algorithm> #include <algorithm>
namespace PythonEditor { namespace Python {
static bool isEmptyLine(const QString &t) static bool isEmptyLine(const QString &t)
{ {
@@ -124,4 +124,4 @@ int PythonIndenter::getIndentDiff(const QString &previousLine,
return 0; return 0;
} }
} // namespace PythonEditor } // namespace Python

View File

@@ -27,7 +27,7 @@
#include <texteditor/textindenter.h> #include <texteditor/textindenter.h>
namespace PythonEditor { namespace Python {
class PythonIndenter : public TextEditor::TextIndenter class PythonIndenter : public TextEditor::TextIndenter
{ {
@@ -44,4 +44,4 @@ private:
const TextEditor::TabSettings &tabSettings) const; const TextEditor::TabSettings &tabSettings) const;
}; };
} // namespace PythonEditor } // namespace Python

View File

@@ -23,9 +23,9 @@
** **
****************************************************************************/ ****************************************************************************/
#include "pythoneditorplugin.h" #include "pythonplugin.h"
#include "pythoneditor.h" #include "pythoneditor.h"
#include "pythoneditorconstants.h" #include "pythonconstants.h"
#include "pythonhighlighter.h" #include "pythonhighlighter.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -69,10 +69,10 @@
using namespace Core; using namespace Core;
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace PythonEditor::Constants; using namespace Python::Constants;
using namespace Utils; using namespace Utils;
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
const char PythonMimeType[] = "text/x-python-project"; // ### FIXME const char PythonMimeType[] = "text/x-python-project"; // ### FIXME
@@ -711,11 +711,11 @@ bool PythonProjectNode::renameFile(const QString &filePath, const QString &newFi
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
// //
// PythonEditorPlugin // PythonPlugin
// //
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
class PythonEditorPluginPrivate class PythonPluginPrivate
{ {
public: public:
PythonEditorFactory editorFactory; PythonEditorFactory editorFactory;
@@ -723,24 +723,24 @@ public:
SimpleRunWorkerFactory<SimpleTargetRunner, PythonRunConfiguration> runWorkerFactory; SimpleRunWorkerFactory<SimpleTargetRunner, PythonRunConfiguration> runWorkerFactory;
}; };
PythonEditorPlugin::~PythonEditorPlugin() PythonPlugin::~PythonPlugin()
{ {
delete d; delete d;
} }
bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage) bool PythonPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{ {
Q_UNUSED(arguments) Q_UNUSED(arguments)
Q_UNUSED(errorMessage) Q_UNUSED(errorMessage)
d = new PythonEditorPluginPrivate; d = new PythonPluginPrivate;
ProjectManager::registerProjectType<PythonProject>(PythonMimeType); ProjectManager::registerProjectType<PythonProject>(PythonMimeType);
return true; return true;
} }
void PythonEditorPlugin::extensionsInitialized() void PythonPlugin::extensionsInitialized()
{ {
// Add MIME overlay icons (these icons displayed at Project dock panel) // Add MIME overlay icons (these icons displayed at Project dock panel)
QString imageFile = creatorTheme()->imageFile(Theme::IconOverlayPro, QString imageFile = creatorTheme()->imageFile(Theme::IconOverlayPro,
@@ -751,6 +751,6 @@ void PythonEditorPlugin::extensionsInitialized()
} }
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python
#include "pythoneditorplugin.moc" #include "pythonplugin.moc"

View File

@@ -27,24 +27,24 @@
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
class PythonEditorPlugin : public ExtensionSystem::IPlugin class PythonPlugin : public ExtensionSystem::IPlugin
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "PythonEditor.json") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Python.json")
public: public:
PythonEditorPlugin() = default; PythonPlugin() = default;
~PythonEditorPlugin() final; ~PythonPlugin() final;
private: private:
bool initialize(const QStringList &arguments, QString *errorMessage) final; bool initialize(const QStringList &arguments, QString *errorMessage) final;
void extensionsInitialized() final; void extensionsInitialized() final;
class PythonEditorPluginPrivate *d = nullptr; class PythonPluginPrivate *d = nullptr;
}; };
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -25,10 +25,10 @@
#include "pythonscanner.h" #include "pythonscanner.h"
#include "pythoneditorconstants.h" #include "pythonconstants.h"
#include "pythoneditorplugin.h" #include "pythonplugin.h"
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
Scanner::Scanner(const QChar *text, const int length) Scanner::Scanner(const QChar *text, const int length)
@@ -389,4 +389,4 @@ void Scanner::parseState(State &state, QChar &savedData) const
} }
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python

View File

@@ -29,7 +29,7 @@
#include <QString> #include <QString>
namespace PythonEditor { namespace Python {
namespace Internal { namespace Internal {
/** /**
@@ -95,4 +95,4 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace PythonEditor } // namespace Python