310 Commits

Author SHA1 Message Date
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
5c8013df61 [console] Fix exception when running scripts (followup cce7aa7)
and move responsibility for showing warning messages to QgsCodeEditor
base class, so that the same code can be used by other dialog script editors
2020-10-12 13:06:34 +10:00
Salvatore Larosa
cce7aa7315 [pyqgis-console] restore marker icon for syntax check 2020-10-12 09:49:45 +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
Nyall Dawson
31dba5453b Fix test 2020-10-06 17:04:49 +10:00
Nyall Dawson
9093bdfd1e Don't silently close QGIS with unsaved changes in the console script
editors

Instead prompt the user what to do with these changes

Fixes #38529
2020-10-06 17:04:49 +10:00
Nyall Dawson
e7a34f33cb Console options widget is not a dialog 2020-10-06 03:57:50 +10:00
Nyall Dawson
33f50496d7 Fix bad merge 2020-10-06 03:57:50 +10:00
Nyall Dawson
ec2b21001e Ensure autocomplete correctly works for all QgsCodeEditorPython instances 2020-10-06 03:57:50 +10:00
Nyall Dawson
8ec7f0e69c Remove QgsPythonConsoleBase so that we have a single definitive Python editor class (QgsCodeEditorPython) 2020-10-06 03:57:50 +10:00
nirvn
f67515c674 [console] Additional tweaks to looks of console input/output area 2020-10-05 17:18:43 +07:00
Nyall Dawson
3db9e52e31 Cleanup inconsistent margins in options dialog 2020-10-05 19:26:23 +10:00
Nyall Dawson
d12dcf3c49 Cleanup layout resizing for Python Console settings tab 2020-10-05 19:26:23 +10:00
Nyall Dawson
bb8cb8b6b0 Fix duplicate margins show in python console 2020-10-05 18:37:46 +10:00
Nyall Dawson
bc55102eb8 Move icon references back out of QgsPythonConsoleBase 2020-10-05 18:37:46 +10:00
Nyall Dawson
e66a0a025b Move more code out of QgsPythonConsoleBase 2020-10-05 18:37:46 +10:00
Nyall Dawson
d9782a12f5 Move more code to QgsCodeEditorPython base class 2020-10-05 13:24:46 +10:00
Nyall Dawson
527e8850ef Add universal last-resort signal QgsGui::optionsChanged()
This signal is emitted whenever the application options have been changed.

This signal is a "blanket" signal, and will be emitted whenever the options dialog
has been accepted regardless of whether or not individual settings are changed.
It is designed as a "last resort" fallback only, allowing widgets to respond
to possible settings changes.
2020-10-05 13:24:46 +10:00
Nyall Dawson
47236421af [needs-docs] Move Python Console settings for font colors and family
to new "Code Editor" tab in options dialog

These settings apply to more than just the Python console editors -
rather they apply to all code editors across QGIS (including expression
editors)
2020-10-05 13:24:46 +10:00
Nyall Dawson
e2ff63da48 Copy font setting logic from QgsPythonConsoleBase to QgsCodeEditor 2020-10-05 13:24:46 +10:00
Salvatore Larosa
2cf6d11997 [pyqgis-console] revert changes for handy commands 2020-10-04 13:19:26 +10:00
Salvatore Larosa
f724793cf0 [pyqgis-console] a better attribute name 2020-10-04 13:19:26 +10:00
Salvatore Larosa
74631215e6 [pyqgis-console] fix missing import 2020-10-04 13:19:26 +10:00
Salvatore Larosa
8533d9a89b [pyqgis-console] restore the correct prompt 2020-10-04 13:19:26 +10:00
Nyall Dawson
5ed37da0b8 Don't hardcode font family for python editor line numbers 2020-10-04 05:02:57 +10:00
Nyall Dawson
ad946d45c8 Ensure colors in Python console match colors for Python editors
used elsewhere in the application
2020-10-04 05:02:57 +10:00
Nyall Dawson
89ace9aeca QgsPythonConsoleBase should use the standard QgsCodeEditorPython
class as a base class

Actually it should be completely folded into QgsCodeEditorPython
so that we have a single definitive Python code editor widget, but
this is a first step toward that...
2020-10-04 05:02:57 +10:00
Salvatore Larosa
7c476d176a [pyqgis-console] fix instance attibute name 2020-10-03 08:46:35 +02:00
Salvatore Larosa
f32725658f [pyqgis-console] fix missing import, amd minor fixws to UI 2020-10-03 09:11:32 +10:00
Salvatore Larosa
4fea3ed822 [pyqgis-console] move console options to main app options 2020-10-03 09:11:32 +10:00
Salvatore Larosa
e17913c6ea [pyqgis-console] add search icon to filterlineedit 2020-09-27 11:14:38 +02:00
Salvatore Larosa
a2fb7f3eeb [pyqgis-console] change message bar to Warning 2020-09-27 04:55:13 +10:00
Salvatore Larosa
1760e26a3a [pyqgis-console] warn user to generate personal access token 2020-09-27 04:55:13 +10:00
Salvatore Larosa
4347e81202 [pyqgis-console] adress some comment: add button to link at generate token page 2020-09-27 04:55:13 +10:00
Salvatore Larosa
eee29257bd [pyqgis-console] use QgsBlockingNetworkRequest to create Gist 2020-09-27 04:55:13 +10:00
Salvatore Larosa
c92e873815 [pyqgis-console] using gist to share snippets instead of codepad 2020-09-27 04:55:13 +10:00
Salvatore Larosa
bc71fae005 [pyqgis-console] fix byte conversion 2020-09-21 17:19:57 +02:00
Salvatore Larosa
b696b465ab Fix indentation (which doing start up of python console very slow) 2020-09-20 06:47:11 +10:00
Matthias Kuhn
d5350c618c
Merge pull request #37602 from rduivenvoorde/console_base_class
Add/use simple BaseClass to Python Console classes
2020-09-12 08:53:15 +02:00
Richard Duivenvoorde
982e4f1262 Rename BaseClass to QgsPythonConsoleBase 2020-09-03 16:03:25 +02:00
Richard Duivenvoorde
701d323509 Remove redundant TODO 2020-09-03 15:49:06 +02:00
Richard Duivenvoorde
09fc2e6aa9 Merged console and editor settings stuff
So the Editor and Console etc share one set of settings:
- Merged Editor and Console settings-tabs in one Settings tab in the settings dialog
- Removed the Editor ui from the settings dialog
- Changed all names of settings in Editor so it uses the normal/console settings
2020-08-27 22:53:21 +02:00
Richard Duivenvoorde
a48e85a512 Move color info to base class and use those 2020-08-27 19:03:03 +02:00
Richard Duivenvoorde
354b9598ec Move font, margin and caret code to baseclass 2020-08-27 18:26:54 +02:00
nirvn
38a7e7212a [console] Fix error when console history file is missing
from the user profile directory (fixes #38142)
2020-08-05 10:18:38 +07:00
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
Richard Duivenvoorde
ab83e57cc8 Context menu 'Search selected in PyQGIS docs' in Console panes 2020-07-08 21:47:08 +02:00