329 Commits

Author SHA1 Message Date
nicogodet
c7207f58f1 Remove asterisk from file name when using Save 2022-04-11 08:22:33 +02:00
nicogodet
b8b2ceed95 Remove asterisk from file name when using Save As... 2022-04-11 08:22:20 +02: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
550a1d3a52 Factories can specify a path to add their pages to the options tree 2021-07-29 15:48:53 +10:00
Nyall Dawson
174d5ee9e0 Ensure python script files saved in the Python console editor use
.py file extension
2021-07-01 15:40:20 +10:00
Nyall Dawson
8113aac88e Use a monospaced font in console command history list 2021-06-14 13:04:59 +10:00
Denis Rouzaud
da08c8a435
[cmake] generalize Python output directory in UseTest macro (#43191)
* [cmake] generalize Python output directory in UseTest macro

this is helpful in case we set up another python output directory (eg PySide2)

* define python output directories to the parent scope

* try with target_include_directories

* define vars on top level

* Update UsePythonTest.cmake

* some cleanup

* more cleanup

* fix uic

* fix path for all platforms

* fix var
2021-05-13 07:32:03 +02: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
Nyall Dawson
0f54df6675 [console] Prepend introductory text with '#' to avoid attempting to format it as Python code 2021-03-31 05:22:12 +10:00
Nyall Dawson
18d8a76009 Fix incorrect capitalization 2021-03-31 05:22:12 +10:00
Denis Rouzaud
eddf6feb45 modernize CMakeLists.txt files 2020-11-12 07:14:46 +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
c0f09aa8e0 followup ae6ed7d: fix name of QPushButton 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
deacc51e1e [pyqgis-console] use play icon to run single command 2020-10-20 08:25:16 +10:00
Salvatore Larosa
3c0fb94880 [pyqgis-console] use asterisk to track changes in script 2020-10-20 06:59:24 +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
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