166 Commits

Author SHA1 Message Date
Yoann Quenach de Quivillic
b137461998 Use standardKey instead of hardcoded F1 2025-07-14 12:15:02 +12:00
Denis Rouzaud
0f032e5f2d run pre-commit on all files 2024-11-29 15:38:02 +01:00
Yoann Quenach de Quivillic
ea75091351 Switch to QWebEngineView if available 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
b2f3876e38 Apply suggestions from review 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
ff2f1f0e3f Remove python parameter and add context menu actions 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
08ae213fc0 Add settings 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
c851835729 add showApiDocumentation method 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
25480e872c Interactive Help on F1 2024-11-14 09:54:48 +10:00
Nyall Dawson
5959be560e Fix future imports 2024-05-10 13:56:49 +10:00
Nyall Dawson
cd3b7f17bf Fix lint error in type checking 2024-05-10 13:56:49 +10:00
Nyall Dawson
249cc6d591 [console] Clean up objects a little
- Don't use ambiguous .parent members, use explicit names
- Add some typehints
2024-05-10 13:56:49 +10:00
Nyall Dawson
5b912fab9d Escape filenames correctly 2024-04-18 11:32:28 +10:00
Nyall Dawson
c033ac8ccd Show filename in exceptions raised from Python console scripts
Instead of "", ensure the actual filename (or tab title, for unsaved
scripts) is shown in exceptions
2024-04-18 11:32:28 +10:00
Nyall Dawson
4dcdddaa02 [console] Don't needlessly store QgsSettings objects
These are cheap to construct by design, so we can avoid
storing them and the messy cross-class access to member
variables
2024-03-07 14:17:22 +01:00
Nyall Dawson
9fab1623a3 Update deprecated removed enum value 2024-01-19 19:44:48 +10:00
Nyall Dawson
77f289d32e Fix incorrect operator for flags 2024-01-19 19:44:48 +10:00
Nyall Dawson
29a87bf0fc Fix enums in console 2024-01-19 19:44:48 +10:00
Yoann Quenach de Quivillic
88c3c41638 Improve console help 2023-05-26 09:38:25 +10:00
Yoann Quenach de Quivillic
139ee639c2 Add named constants to designate interpreter states 2023-04-24 10:57:12 +10:00
Yoann Quenach de Quivillic
6257a659b1 Add IPython-style assignment 2023-04-24 10:57:12 +10:00
Yoann Quenach de Quivillic
73e9596064 Run system commands with ! 2023-04-24 10:57:12 +10:00
Nyall Dawson
895a68faee Expose 'Search Selection in PyQGIS docs' action for all python code editors 2023-04-06 08:32:41 +10:00
Nyall Dawson
03e1d90b39 Immediately write out the console history file BEFORE running commands
This prevents loss of history when a user enters a Python command
which results in a QGIS crash
2023-03-28 15:04:39 +10:00
Nyall Dawson
b9b06b057a Don't add 'exec(Path(...))' entries to console history when running scripts
These just clutter the history
2023-03-28 15:04:39 +10:00
Yoann Quenach de Quivillic
a1a43e5362 Fixes #49191 make "__file__" available to scripts 2023-03-03 15:57:24 +01:00
Yoann Quenach de Quivillic
e992797f8b Restore autoCloseBracket settings and factorize autoInsertImport 2023-01-11 07:33:27 +10:00
Yoann Quenach de Quivillic
f98266b768 Get rid of the old autoCloseBracket setting 2023-01-11 07:33:27 +10:00
Nyall Dawson
941adaa4a8 Some more code to base class 2022-10-24 16:46:11 +10:00
Nyall Dawson
955c72388d Factor out interpreter 2022-10-24 16:46:11 +10:00
Nyall Dawson
73b75af8c3 Move prompt handling to QgsCodeEditor 2022-10-24 16:46:11 +10:00
Nyall Dawson
374dcbab53 Minor cleanups 2022-10-24 16:46:11 +10:00
Nyall Dawson
b7ffb0cb6f Move responsibility for storing history of run commands to base class 2022-10-24 16:46:11 +10:00
Nyall Dawson
3786cd178d Move python console history handling to base QgsCodeEditor class
So that other non-python-console code editors can utilise this too
2022-10-24 16:46:11 +10:00
Nyall Dawson
34227bdf1c Fix broken logic in clearing python console history
- clearing session was also clearing the file history
- clearing file history was doing nothing
2022-10-12 08:22:34 +10:00
Nyall Dawson
ed54489a09 Move some useful python console methods to base class 2022-10-10 14:01:24 +10:00
Hannes
cb914be6f3 Fix PEP8 E266 for second level heading comment 2022-09-04 06:05:10 +10:00
Hannes
ccb46e79d8 Python Console: Don't throw exception if compiled without 3D
Fixes #49987
2022-09-04 06:05:10 +10:00
Nyall Dawson
d00356a0fa [console] Use a more modern approach to running script files, to
avoid 'unclosed file' warnings dumped whenever script files
are run through the Python console
2022-01-18 15:23:08 +10:00
Nyall Dawson
8113aac88e Use a monospaced font in console command history list 2021-06-14 13:04:59 +10:00
Andrea Giudiceandrea
ea4131a5d7 Fix opening the console
when an error occurs (specifically when 3d library is not built) before the console is displayed.
2021-04-21 08:15:39 +10:00
Nyall Dawson
12905ccf4e Gracefully handle import errors in console
Fixes opening the console when 3d library is not built

Fixes #41855
2021-04-04 06:40:55 +10:00
Salvatore Larosa
a65143e8bc [pyqgis-console] select last row of history: address @uclaros comment 2020-10-24 05:49:33 +10:00
Salvatore Larosa
2748215b20 [pyqgis-console] fix spell check 2020-10-24 05:49:33 +10:00
Salvatore Larosa
77c4823b50 [pyqgis-console] set focus to run button in history dialog and renaming label to run button 2020-10-24 05:49:33 +10:00
Salvatore Larosa
6eec68ad74 [pyqgis-console] run multiple items selected from command history dialogy 2020-10-24 05:49:33 +10:00
Salvatore Larosa
7b7a909318
Merge pull request #39350 from uclaros/fix-del-console-history
Fix deleting python console history entries
2020-10-13 20:45:05 +02:00
uclaros
1f26bb03f4 Fix deleting python console history entries 2020-10-13 20:11:31 +03:00
Nyall Dawson
8d3e028d15 Cleanup raw margin manipulation used to hide holding controls, use proper methods 2020-10-13 14:14:53 +10:00
Nyall Dawson
1ac59415ec Cleanup handling of margins in QgsCodeEditor and subclasses 2020-10-13 14:14:53 +10:00
Nyall Dawson
3098fa5906 Move code editor color scheme tracking to dedicated registry,
QgsCodeEditorColorSchemeRegistry

This cleans up the code, and makes it possible for creation of plugins
which add new code editor color schemes!
2020-10-06 17:11:34 +10:00