summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/pythoneditorplugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rename PythonEditor plugin to PythonDavid Schulz2019-07-171-756/+0
| | | | | | | | 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>
* Merge remote-tracking branch 'origin/4.10'Tim Jenssen2019-07-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/libs/utils/synchronousprocess.cpp src/plugins/baremetal/iarewtoolchain.cpp src/plugins/cmakeprojectmanager/cmakeproject.cpp tests/unit/unittest/CMakeLists.txt Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
| * More Utils::toSet/toListhjk2019-07-041-1/+1
| | | | | | | | | | | | | | ... and unrelated cosmetic changes. Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Add special handling for removing filesVille Nummela2019-06-251-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | ... from a project which are pulled in via wildcards. Such files cannot be removed from a project file, because they are not listed verbatim. This kind of failure should not be reported to the user if the file is also deleted, as the file list will have the correct state after the next reparse. Fixes: QTCREATORBUG-22586 Done-with: Christian Kandeler <christian.kandeler@qt.io> Change-Id: I3dc66fe9a6594be7d0b86f46d830cd099ee49fd7 Reviewed-by: hjk <hjk@qt.io>
* | ProjectExplorer: Replace RunConfiguration::executablehjk2019-06-121-15/+7
| | | | | | | | | | | | | | | | | | | | ... by a RunConfiguration::commandLine(). That's what is typically consumed, and removes the need for some custom runnable() implementations. Change-Id: I7700b12cdd0965802a0add977b432314734a5a72 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Utils: Encourage marking of raw command line parametershjk2019-06-061-3/+2
|/ | | | | Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* PythonEditor: Use Utils::CommandLine when creating a runnablehjk2019-06-041-4/+5
| | | | | Change-Id: I670390f6034923d1f7f750435c0c8eb02d60b6f6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-13/+13
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Add executable() accessor to RunConfigurationChristian Kandeler2019-05-241-1/+4
| | | | | | | Amends f6c276daf0, which was a quick fix for 4.9. Change-Id: I94281af6a9a0d0bfe197ce836488f708d5bd677d Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Remove BuildTargetInfoList wrapper classhjk2019-05-141-2/+2
| | | | | Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-04-021-15/+16
|\ | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/pythoneditor/pythoneditorplugin.cpp Change-Id: I9a95df5e16b34538539ced7dfc5d326b700794e6
| * PythonEditorPlugin: Sprinkle const over codeEike Ziller2019-03-281-15/+15
| | | | | | | | | | Change-Id: I01b4b11299bd73f6bae87045deef0328753720a7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| * Fix detaches in for loopEike Ziller2019-03-281-3/+3
| | | | | | | | | | Change-Id: I8d1de1435c7f53057611597b06d8c2af709563ec Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | ProjectExplorer: Switch order of template parametershjk2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ... of SimpleRunWorkerFactory. This requires being explicit about the SimpleTargetRunner worker default, but makes the template re-usable for current users of RunWorker::registerWorker() which I would like to phase out now, for less variations in the RunWorkerFactory setup. Change-Id: I32638437e5bb29f143650f5fde706711ab25accf Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Introduce a SimpleRunWorkerFactory templatehjk2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and use in as replacement for RunConfiguration::addRunWorkerFactory. It is still convenient to have a simple way to set up run worker factories for the typical "just run for this configuration" case, but it's even better if it follows the nowadays predominant pattern of keeping factories in the plugin's pimpl. Also, it turned out there were two copies of QmlProjectRunconfigurationFactory code, one is enough. Change-Id: I0b28c4ea18d0f52165a49f6133dc8687a3b9c7cf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Python: De-macrofyhjk2019-03-151-6/+6
| | | | | | | | | | Change-Id: I5a0b2406d1ba8ad3a168c2635cbaec9711c4474f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Add more Python featuresCristián Maureira-Fredes2019-03-151-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the wizard related to Main Windows, not there are more options to specify the name of the files and classes. It's possible to Add and Remove files on Python projects that use the new .pyproject file. Improved the empty application, to template the .pyproject file and use the proper name for the file. Added the icons for file overlay. Change-Id: Iaba7feda69e0f608260b5fb1d1b04b2a42b08c2d Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-03-141-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/debugger/debuggerkitinformation.cpp src/plugins/languageclient/languageclientmanager.cpp src/plugins/plugins.pro src/plugins/projectexplorer/kit.cpp src/plugins/projectexplorer/kitmanager.cpp Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
| * PythonEditor: Fix stringsRobert Loehning2019-03-111-2/+2
| | | | | | | | | | Change-Id: Ib48c5b7c5cc56ac8bfe1d0641d595e680faf62e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | ProjectExplorer: Move RunControl related classes to separate file pairhjk2019-03-131-0/+1
| | | | | | | | | | Change-Id: I5da56f80336673d595907abcc797f628be680cd5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Split EnvironmentAspecthjk2019-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | ... at least logically a bit more into hunks responsible for one of the possible choices of base environments. This makes it possible to move code that modifies individual cases closer to the only place that uses it. Change-Id: I1c87bb869e04e44b92ff097b0bf25274f93808be Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-03-051-16/+40
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/tools/clangpchmanagerbackend/source/taskscheduler.h Change-Id: I518adaf647df412887c2a372416634359f09ad2a
| * Python projects: Add error handling to the JSON parserFriedemann Kleint2019-03-011-16/+40
| | | | | | | | | | | | | | | | | | | | Display parse errors in case the file is invalid. Amends f7e1354ae563ae6c475ee2e18764127e58073d2b. Task-number: QTCREATORBUG-21824 Change-Id: I0d357597257fcbc49719fae781c61f251a5392fe Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | ProjectExplorer: Flip default for ProjectNode::showInSimpleTreehjk2019-03-011-6/+0
| | | | | | | | | | Change-Id: Ibd4f91ad55b2be93d20dfc4f583de95274e981ca Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Merge Node::isFileNodeType and asFileNodehjk2019-03-011-1/+1
| | | | | | | | | | | | | | They were identifying the same set of nodes. Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: De-virtualize FolderNode::addFileFilterhjk2019-03-011-6/+1
| | | | | | | | | | | | | | | | ... which interestingly enough is only used with Add Existing Directory, not with Add Existing Files. Change-Id: If76ba5f192dc49f3cb56e3d0c9ab249e47aa1c28 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Replace Node::setNodeType by virtual functionshjk2019-03-011-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not the usual direction of change, but currently there are several systems to identify or invoke node functionality. Virtual functions are likely to stay in this context, so this here attempts to help consolidation by reducing the influence of the node type flags, hopefully leading to full removal by making remaining functionality available through the other mechanisms (virtual functions, asFooNode() 'casts', less so the FileType flag). Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Remove FileNode's isGenerated constructor boolhjk2019-02-251-1/+1
|/ | | | | | | Use setter of base class, similar to setListInProject() before. Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Add Qt for Python templates and better supportCristian Maureira-Fredes2019-02-041-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtCreator: * Add new icons * Add support for `.pyproject` files, * Set `.pyproject` as default, but keep compatibility with `.pyqtc` * `.pyproject` is a JSON file, while `.pyqtc` is a plain-text. Python class: * Add option to ask if use PySide2 or PyQt5 * Remove the old import try-except structure * Remove iconText and add icon option * Remove shebang * Add utf-8 support Python file: * Remove code * Remove iconText and add icon option * Remove shebang * Add utf-8 support Qt for Python - Empty * Add file with basic statements to execute a QApplication Qt for Python - Window * Add file with basic statements to execute a QApplication, which contains a QMainWindow Task-number: QTCREATORBUG-21824 Change-Id: I4adb3ab6b179f084c7b674a6d4f643445fe24929 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* PythonEditor: ModernizeAlessandro Portale2018-11-301-1/+1
| | | | | | | modernize-* Change-Id: I3d8a79b59822f9d13f90730b770121dbf582da84 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* ProjectExplorer: Rename 'extraAspect' to 'aspect'hjk2018-10-021-7/+7
| | | | | | | | | Using aspects is the standard pattern nowadays, there's nothing 'extra' to them anymore. Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* PythonEditor: Support file operationsOrgad Shaneh2018-10-011-2/+37
| | | | | Change-Id: I0fc5a3e1795fe56c753e300ed1c1ca7514964401 Reviewed-by: hjk <hjk@qt.io>
* PythonEditor: Avoid file duplicationOrgad Shaneh2018-10-011-6/+9
| | | | | | | Every add/remove of a file added another entry of the project file. Change-Id: I800adc3540c3fc8b109864e86ab590af5374e30b Reviewed-by: hjk <hjk@qt.io>
* PythonEditor: Remove dead codeOrgad Shaneh2018-10-011-8/+0
| | | | | Change-Id: I55f7d513755857a5759ba8688e5cfeccbdaa379f Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Remove IRunConfigurationAspect::runConfigurationhjk2018-09-131-3/+3
| | | | | | | | ... and adapt constructors to not take the now-unneeded RunConfiguration pointer. Change-Id: I53ff338f51334ff7b0c22d4bed92bfcfc8225ea7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Pass macro expander to ArgumentsAspect::argumentshjk2018-09-131-2/+3
| | | | | | | To remove the last user of IRCAspect::runConfiguration. Change-Id: I1390166730112008a4050877f96bb29f274e7ef1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Compactify runconfiguration aspect creationhjk2018-09-041-7/+5
| | | | | Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Remove RunConfiguration::fillConfigurationLayouthjk2018-09-041-9/+0
| | | | | | | | | | | | | Instead of using a hard-coded list of well-known (optional) aspects, add all aspects, so there is no need for special treatment of RunConfiguration with unusual/custom aspects needed. Price and benefit is that the individual run configs are again responsible for the aspect display order which is determined from the aspect construction order. Change-Id: Iff2656b2e358c0f0f789d4c006a5c44d0a1536a5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Unify key names for various fields in stored RunConfigurationshjk2018-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This replaces various versions of the key name of the arguments, working directory, use terminal and use dyld image suffix fields by unified versions ("RunConfiguration.Arguments", "RunConfiguration.WorkingDirectory", "RunConfiguration.UseTerminal", "RunConfiguration.UseDyldImageSuffix"). The different names for the fields are technically not needed (as proven by several cases that already now used the same key), partially outdated ("Qt4ProjectManager.MaemoRunConfiguration.Arguments") make RunConfiguration constructors less uniform and more complex than needed. The "RunConfiguration." prefix in the new names is not needed, but used by several other settings, so having it there looks more uniform now. In (the unexpected case) that different keys would ever be necessary, the default key name could still be overridden by using setSettingsKey from user code. Change-Id: Ifb74ad74e0a9c724c8bf5e71e1bb2424d5d1831b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Remove ApplicationLauncher::Modehjk2018-06-051-1/+0
| | | | | | | | | | | | | | | | | | The actual remaining use was to pop up a terminal in some setups where Mode == Console, with a default of Gui meaning "no console". In some downstream uses it was used set to Console (probably to mean "this helper process does not need a gui") but then luckily ignored when actually starting the helper processes. All cases where the console is useful and requested are nowadays RunWorkers belonging to RunConfigurations with a TerminalAspect, so they can directly get the relevant bit from their RunConfiguration without having it part of all StandardRunnables. Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* PythonEditor: Use new convenience function to set up run workershjk2018-05-301-6/+1
| | | | | Change-Id: I2c7b0c57a077794756643862c242c499d93295c9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Finish merging Runnable and StandardRunnablehjk2018-05-231-2/+1
| | | | | | | | | | As all Runnables are known to be StandardRunnables, this here essentially replaces all .is<StandardRunnable> by 'true'. .as<StandardRunnable> by no-op, and fixes the fallout. Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* PythonEditor: Fix history completer for interpreterChristian Stenger2018-05-091-0/+1
| | | | | Change-Id: I14e67e585e06adc926b052b625701b3fbe7fca94 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptrTobias Hunger2018-05-021-1/+2
| | | | | Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Use unique_ptr for Project::setRootProjectNodeTobias Hunger2018-05-021-2/+2
| | | | | Change-Id: If63a49d0eecfb93adcc6076fcb3208c87603af10 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Python: Code cosmeticshjk2018-04-301-9/+1
| | | | | | | | Remove some unnecessary #include and use a recently introduced RunConfiguration::builtTargetInfo() convenience function. Change-Id: I76750fd66ae2c268b68d225c62aad7d880256d07 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: More RunConfiguration aspect usehjk2018-04-301-94/+56
| | | | | | | Include interpreter and main script settings. Change-Id: I91c19ef124ff8b7da34bc67fb1a5ef054c3499b8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: Plugin code cosmeticshjk2018-04-271-5/+2
| | | | | | | Use the common pattern for PythonEditorPluginPrivate. Change-Id: Icec8d975e0ab921be7121d123af4dddecd7d0384 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Pass id to RunConfiguration constructorhjk2018-04-251-7/+4
| | | | | | | | | | | It's what the base class requires, and opens the possibility to have several factories creating the same type of run configuration. Also move ios, winrt and android factories closer to their products, it's the predominant pattern nowadays. Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Simplify runconfiguration aspect addTo... interfacehjk2018-04-241-2/+2
| | | | | | | | The parent widget is always given by the layout, no need to pass it as separate parameter. Change-Id: I9e7ed3a89eb63b78a549471d839060131737ff78 Reviewed-by: Christian Stenger <christian.stenger@qt.io>