257 Commits

Author SHA1 Message Date
Mathieu Pellerin
ebd4cd8c13 [python console] Match key up / down behavior to that of bash and
allow for a 'soft' history to be editable

This commit reverts the recent behavior change of a key up / down
press event which meant to prevent accidental loss of content of
a command being edited when pressing the up key on the second line
of a reflowed text.

This new approach has the python console input line behave like
bash, whereas a key up / down will always move to the next /
previous history item wherever the cursor is located. However until
the user hits enter, any edits to historical items or the new
line will be remembered.

This insures that an accidental move back in history doesn't
lead to unwanted code loss.
2020-07-13 08:32:09 +07:00
Matthias Kuhn
af670a264e Improve security warning on console 2020-06-29 07:23:20 +10:00
Nyall Dawson
33fb57e4a0 Also restrict scope of Ctrl+A select all shortcut to avoid ambiguity 2020-06-04 10:59:27 +10:00
Nyall Dawson
873716c6fa Limit scope of Ctrl+C shortcut for copy features to canvas and for
python console to console widget

Avoids ambiguous shortcut warnings/unexpected behavior when pressing
Ctrl+C

Fixes #27035
Fixes #31918
Fixes #31914
Fixes #31392
2020-06-04 10:59:27 +10:00
nirvn
af474eaf81 [python console] Deal with remaining vanishing prompt scenarios 2020-06-03 17:31:45 +07:00
nirvn
bbdc9068b0 [python console] Additional tweaks to new prompt 2020-06-03 14:15:09 +07:00
nirvn
2a25c1847d [python console] Improve key up/down press for multiline command string 2020-06-03 14:15:09 +07:00
nirvn
2f36e18d11 [python console] Add help links to the PyQGIS API and Cookbook pages 2020-06-03 11:45:13 +07:00
nirvn
296fc6cf89 [python console] Move the >>> prompt into the margin to fix a gazillion issues 2020-06-03 11:45:13 +07:00
Nyall Dawson
601a717174 Import 3d python library by default in console 2020-05-29 03:44:55 +10:00
Juergen E. Fischer
b1edb5e70c test_defwindowtitle.sh: also check Dialog 2020-05-16 20:55:59 +02:00
Nyall Dawson
b6a7a10703 Fix some more python formatting issues, remove more flake exceptions 2020-05-11 11:41:50 +10:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
d0c24edf7d Import more useful libraries into console by default 2019-02-01 21:44:53 +11:00
Julien Cabieces
b82ce0e522 fix crash when print from qgis processing algorithm while the python console is displayed 2019-01-29 21:34:45 +11:00
Nyall Dawson
9d4b80e2f1 Refine multiline selection behaviour in editors 2019-01-11 10:15:51 +10:00
Nyall Dawson
dab069e1ea Improve multiline cursor behavior in Python console and expression editor
Now supports multi-line inserts and pastes
2018-12-20 17:23:52 +10:00
Nyall Dawson
cce5c4e802 [console] Correctly save settings when exiting app
The closeEvent approach which was previously used is not reliable
on application exit, so manually force a settings save in this case too.

Avoids loss of command history when closing QGIS

Also remove the manual "Save" history action, as it's redundant
2018-12-06 05:42:47 +10:00
Nyall Dawson
1f1bbbaeb6 [console] Fix saving scripts sometimes defaults to QGIS bin folder 2018-12-06 05:42:47 +10:00
Juergen E. Fischer
9ad01cf9ba replace three dots with ellipsises in translation strings 2018-10-27 19:06:37 +02:00
Nyall Dawson
ff90c13b3a Capitalization 2018-10-11 09:04:55 +10:00
nirvn
2aebeb0157 [ui] add security warning to the python console 2018-08-20 14:41:07 +07:00
Salvatore Larosa
059d0e21c4 [pyqgis-console] fix link to c++ api doc 2018-07-08 12:44:57 +02:00
Matthias Kuhn
ae192e8624 Make console printing safe
References #8343 https://issues.qgis.org/issues/8343
2018-07-02 18:35:24 -05:00
Nyall Dawson
398e2a17dd [console] Fix invalid regex warning 2018-06-22 13:37:58 +10:00
Salvatore Larosa
3edc07b4c2 also versioning cookbook url 2018-05-29 11:59:54 +02:00
Salvatore Larosa
8f5bde40cf use https for cookbook url 2018-05-29 11:52:43 +02:00
Salvatore Larosa
fc740d7140 Fixes #19001: update url to _pyqgis and _api commands 2018-05-28 08:42:45 +02:00
nirvn
45aca2f942 fix unclosed strings not style in python console & script editor 2018-05-23 10:08:02 +07:00
nirvn
9cf6bbf424 Improve default color scheme for python console & script editor 2018-05-22 17:56:25 +07:00
nirvn
45b045d212 Fix missing color settings for python console / script editor 2018-05-22 13:31:29 +07:00
Nyall Dawson
6d87a4cf3f [console] Fix unclosed strings don't respect the preset font size 2018-05-22 15:43:14 +10:00
Mathieu Pellerin
a7397b1726
[python console] improve settings UI (#7041)
- improve UI spacing
- harmonize reset icon
2018-05-21 16:48:43 +07:00
nirvn
6b3ebfc019 harmonize open script icons 2018-05-20 15:50:31 +07:00
nirvn
b0e93a175c [python console] update toolbar icon and action position
(harmonize position with the processing script editor)
2018-05-20 15:50:31 +07:00
Felis Pimeja
85660db91f Vectorized remaining propertyicons
List of icons^
gdal.png
network_and_proxy.png
locale.png
join.png
transparency.png
pyramids.png
overlay.png
map_tools.png
histogram.png
digitizing.png
attributes.png
2018-05-09 11:21:51 +07:00
Salvatore Larosa
3a5fb9d7bd Fixes #18526: Pasting data from clipboard inside Python console causes the text cursor to be moved to the end of the row 2018-03-23 22:41:00 +01:00
Shiva Reddy
536cc9cfbe Update writeOut to include isatty (#6602)
Added these lines so that QGIS 3 python console works in window
2018-03-16 08:20:14 +11:00
Felis Pimeja
198bf77208 Vectorize console icons (#6515) 2018-03-09 09:53:53 +07:00
Alexander Bruy
7823025b8d [python console] remove 'u' prefixes from strings (fix #18171) 2018-02-23 10:39:08 +02:00
Juergen E. Fischer
6dfedc38e9 translation string fixes and cleanups 2018-02-15 22:31:15 +01:00
Denis Rouzaud
3dc3d9d1b2 unite QgsMessageLog::Level and QgsMessageBar::MessageLevel in Qgis::MessageLevel
make enum items lower case
remove unused QgsMessageLog::None and All
2018-02-06 08:56:40 -04:00
Juergen E. Fischer
325af48680 fix #18050 (followup f6269c41d) 2018-02-05 14:04:07 +01:00
Jürgen Fischer
ad21d371b8
Merge pull request #6213 from nyalldawson/interrupt_console
[console] Allow breaking execution of scripts via Ctrl-C
2018-02-02 17:02:53 +01:00
Nyall Dawson
77e54d3502 [console] Make console action checkable, and bring behaviour into
line with style dock/processing toolbox

Where the action is checked only if the dock is open and user visible,
and checking the action brings hidden tabs to the foreground instead
of closing them.
2018-01-30 14:33:06 +11:00
Nyall Dawson
f6269c41da [console] Allow breaking execution of scripts via Ctrl-C
This allows (in some circumstances) scripts running in the console
to be halted via the Ctrl (or Meta) + C shortcut.

(It's only possible to catch and abort when the script is printing
outputs to the console - because this triggers
QCoreApplication.processEvents() calls. Without these calls the
whole QGIS application is unresponsive during script execution
and there's no ability to even catch a shortcut in order to
halt the execution.

Still, even with this limitation it's handy to be able to
break out of lengthy:

for f in iface.activeLayer().getFeatures():
    print(f.attributes())

loops!)
2018-01-30 09:58:31 +10:00
Nyall Dawson
0f79bfba1c Use svg version of python console icon, courtesy of @pkinglinz (#6016) 2018-01-09 10:33:08 +07:00
Salvatore Larosa
d7485a4349 [pyqgis-console] fix strings in options tooltips 2017-11-29 17:45:46 +01:00
Salvatore Larosa
77f5959a7a [pyqgis-console][ui] move find text tools to toolbar widget 2017-11-28 23:40:29 +01:00
Salvatore Larosa
52efa5c36e [pyqgis-console] fix missing import for pap file compiler 2017-11-28 21:05:11 +01:00