90 Commits

Author SHA1 Message Date
Julien Cabieces
ed64834106 api(deprecated): add message to deprecated SIP annotation 2024-12-17 09:06:42 +01:00
Denis Rouzaud
5bfbccf63f remove multiline 2024-12-07 05:16:00 +10:00
Denis Rouzaud
5fdf6dd77a fix SIP_SKIP and SIP_FORCE being left alone 2024-12-07 05:16:00 +10:00
Denis Rouzaud
2562958772 sipify 2024-12-07 05:16:00 +10:00
Yoann Quenach de Quivillic
b2f3876e38 Apply suggestions from review 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
7e9a098b31 Show API Documentation on F1 2024-11-14 09:54:48 +10:00
Yoann Quenach de Quivillic
2067abc02d Add helpRequested signal 2024-11-14 09:54:48 +10:00
Nyall Dawson
ef9b326d04 Apply suggestions from code review 2024-10-10 14:10:40 +10:00
Yoann Quenach de Quivillic
b1d840f5b8 Handle wrap mode in calltips 2024-10-10 14:10:40 +10:00
Nyall Dawson
ef0289f3ec Fix formatting of Python ..deprecated annotations in docstrings
Fixes https://github.com/qgis/pyqgis-api-docs-builder/issues/174
2024-09-02 11:42:12 +10:00
Mathieu Pellerin
52816584cc Address review 2024-08-17 11:37:35 +07:00
Mathieu Pellerin
26308050c4 [processing] Fix script editor dialog wrongly jumping back to line 1 and setting changed to true after saving file 2024-08-16 14:53:53 +07:00
Nyall Dawson
3a578d6712 Header update 2024-08-13 20:28:55 +10:00
Nyall Dawson
8dcb158394 Move "share on gist" logic to QgsCodeEditorWidget
Allows this functionality to be used by other code editors, not
just console script editor
2024-06-24 18:40:00 +10:00
Nyall Dawson
9946a1d739 Move console script editor external file watching logic to QgsCodeEditorWidget
Ensures a consistent behavior between console script editor and
eg processing script editor
2024-06-18 05:23:57 +10:00
Nyall Dawson
d345c68c5a Move responsibility for loading scripts to QgsCodeEditorWidget 2024-06-18 05:23:57 +10:00
Nyall Dawson
0931624dea Add (non-exposed) setting for the external Python editor
This isn't exposed in the GUI, but allows users to
set a specific editor command to use when opening
Python files in the external editor.

Use the token <file> to insert the filename, <line>
to insert line number, and <col> to insert the column number.

Eg:

  QgsSettings().setValue(
    'gui/code-editor/python/external-editor',
    'kate -l <line> -c <col> "<file>"')
2024-06-15 09:01:33 +10:00
Nyall Dawson
6a018f65f5 Move responsibility for opening files in external editor to QgsCodeEditorWidget
This allows the editor to be opened in a proper detached process,
avoiding the editor being closed when QGIS is exited.

Move to a blocklist for terminal text editors instead of the fragile
polling approach (which eg doesn't work if the editor is set to
pycharm)
2024-06-07 20:46:45 +10:00
Nyall Dawson
e42dc886aa Move file path handling for console editor to QgsCodeEditorWidget 2024-06-07 20:46:45 +10:00
Nyall Dawson
1c23950304 Replace bar is not always visible when find is
Instead do the vscode/pycharm thing and only show it when a replace
toggle is clicked, or Ctrl + R is pressed
2024-05-16 08:44:14 +10:00
Nyall Dawson
1ea04ae712 Add warning methods to QgsCodeEditorWidget
These call the underlying QgsCodeEditor methods to show inline
warnings, but also add corresponding highlights on the scroll bar
2024-05-15 17:12:20 +10:00
Nyall Dawson
e435e3f931 Expose scrollbar controller to PyQGIS
Allows plugins etc to add custom highlights to the scrollbar
2024-05-15 17:12:20 +10:00
Nyall Dawson
280b92cd44 Indentation 2024-05-10 13:56:49 +10:00
Nyall Dawson
58dafb48f8 Move message bar logic to QgsCodeEditorWidget 2024-05-10 13:56:49 +10:00
Nyall Dawson
64e0fff67f [console] Rely on QgsCodeEditorWidget search functionality
Remove duplicate code searching functionality from console script
editor and just use the standard QgsCodeEditorWidget implementation
2024-05-10 13:56:49 +10:00
Nyall Dawson
a34669e784 Add code editor color scheme option for search match highlight color 2024-05-10 06:11:36 +10:00
Nyall Dawson
1e8c00354f Move QgsCodeEditorWidget to a new file 2024-05-08 11:56:35 +10:00
Nyall Dawson
8654d57f16 Rename methods for clarity 2024-05-08 11:56:35 +10:00
Nyall Dawson
347191e797 Add since 2024-05-08 11:56:35 +10:00
Nyall Dawson
b7f0770633 Introduce QgsCodeEditorWidget
This widget wraps an existing QgsCodeEditor object in a widget which provides
additional standard functionality, currently a line-for-line port of the Python
console script editor search tools.

The caller must create an unparented QgsCodeEditor object
(or a subclass of QgsCodeEditor) first, and then construct a
QgsCodeEditorWidget passing this object to the constructor.

Ideally, this functionality would be added to the base QgsCodeEditor
class itself. But this is NOT possible without considerable API
breakage, as QgsCodeEditor currently inherits the QsciScintilla widget.
We cannot change QgsCodeEditor to inherit a generic QWidget
container containing a QsciScintilla widget + other widgets in
a layout without breaking API. I've added a cleanup note for
QGIS 4.0 here.
2024-05-08 11:56:35 +10:00
Even Rouault
a68422b982 Various typo fixes
Including 3 public methods, which are deprecated by this commit and replaced by a typo-fixed version
2024-02-29 06:03:03 +10:00
Even Rouault
02caeb9db7
Header files: remove all mentions of '\since QGIS 2.' 2024-02-18 20:46:01 +01:00
Nyall Dawson
078fd4f2ea Make IntFlag enum type opt-in, rather than opt-out
And make sipify handle this nicely. This means that all our non-flag
style enums correctly map across to IntFlag python enums on Qt 6,
fixing issues with negative enum values for these and providing
a better match for the original c++ enum.
2024-01-31 17:16:18 +10:00
Yoann Quenach de Quivillic
f163937f3c Add methods to set and get cursor position 2023-10-28 05:07:36 +10:00
Nyall Dawson
8282b6631e Add QgsCodeEditorShell code editor subclass for Bash or Batch scripts 2023-04-24 15:26:50 +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
8f5476e6d7 Avoid loss of text in code editors when certain modifiers are pressed
These are triggered when a InputMethod event is sent to the widget.
There's upstream discussion at https://sourceforge.net/p/scintilla/bugs/1913/
and the fix was added to QScintilla version 2.13.3

As the loss of text is an extreme risk, just disable input method
handling in these widgets on affected versions entirely.

Fixes #52459
2023-04-04 14:12:26 +10:00
Nyall Dawson
50c76929e1
Followup 30700f1, ensure links to Qgis members are set in docstrings 2023-03-31 10:46:24 +10:00
Yoann Quenach de Quivillic
443df70628 Add Toggle comment capability to the Html Editor 2023-03-31 05:56:14 +10:00
Nyall Dawson
1822998bda [feature][console] Allow Python console to be toggled between a dock
widget and a full main window dialog

Adds the same toggle button as we use for 3d map canvases and attribute
tables to make it super-easy to switch the Python console to a full
main window.
2023-03-30 12:40:06 +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
a4469591a7 Add reformat capability to the HTML editor 2023-03-28 05:53:33 +10:00
Nyall Dawson
a6b4742e97 Use settings registry for new settings 2023-03-20 16:06:24 +10:00
Nyall Dawson
8e526353f9 Move toggle comment handling to base QgsCodeEditor class 2023-03-20 16:06:24 +10:00
Nyall Dawson
3312bf1ad2 Move syntax checking capability to QgsCodeEditorPython 2023-03-20 16:06:24 +10:00
Nyall Dawson
ac5f8da74e Support reformatting in base QgsCodeEditorPython class 2023-03-20 16:06:24 +10:00
Nyall Dawson
7b61080557 Port generic portions of reformat code action to base class 2023-03-20 16:06:24 +10:00
Yoann Quenach de Quivillic
74c60488f2 Fix sip 2023-01-11 07:33:27 +10:00
Yoann Quenach de Quivillic
59332e0984 Fix sip 2023-01-11 07:33:27 +10:00