Commit Graph

70 Commits

Author SHA1 Message Date
0penBrain 2630df6edd Gui: remove forcefully jumping to Python Console bottom line on single LMB click 2022-10-30 21:30:40 -05:00
0penBrain 5bb041deaa Gui: use default app text color for Python code instuctions highlighting
This allows to deal with OS native dark themes
 In such cases, Python instructions were black on a dark background
2022-10-10 07:33:41 -07:00
berniev 75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
berniev 656ef8961f Gui: redundant void 2 2022-08-08 10:21:44 +02:00
wmayer c4547c03e1 Gui: improve integrated Python console:
* correctly handle the case that Py_BuildValue() can return a null pointer
* fix a latin1 <-> UTF-8 conversion problem
2022-08-07 17:50:28 +02:00
wmayer 5354632bfb Fix several clazy issues:
* Mixing iterators with const_iterators [-Wclazy-strict-iterators]
2022-07-25 00:04:04 +02:00
Uwe 1d95c26e2e [Gui] remove more superfluous nullptr checks 2022-07-18 03:34:22 +02:00
wmayer d5921e08ec fix (Qt) issues found by clang's clazy tool:
+ -Wclazy-incorrect-emit
+ -Wclazy-strict-iterators
+ -Wclazy-overloaded-signal
+ -Wclazy-qstring-arg
+ -Wclazy-unused-non-trivial-variable
+ -Wclazy-container-anti-pattern
+ -Wclazy-range-loop-reference
+ -Wclazy-const-signal-or-slot
+ -Wclazy-detaching-temporary
+ -Wclazy-qfileinfo-exists
2022-06-29 21:00:54 +02:00
Uwe c23a30b916 [Gui] remove unnecessary Boolean comparisons 2022-06-19 15:17:01 +02:00
wmayer 96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe a55d1b03fd [Gui] Python and Property: remove unused includes 2022-03-05 03:44:45 +01:00
wmayer fb35944604 Gui: [skip ci] restore block cursor setting for Python console at startup 2022-02-23 22:49:35 +01:00
wmayer cf49fc7c6d Gui: Attach PythonConsole to parameter group and handle changes in its OnChange() method
This avoids code duplications and makes sure the group name is used only once.
The parameters are saved to the group 'PythonConsole' instead of 'General'.
2022-02-21 19:26:44 +01:00
Uwe dd5a681fd8 [Gui] remove unused headers 2022-02-19 03:41:28 +01:00
marioalexis ec167207bf Gui: Add functionality to enable/disable block shape cursor in text editor and console 2022-01-26 11:53:29 +01:00
wmayer 4f12416fa0 Gui: fix C++20 warning: bitwise operation between different enumeration types [-Wdeprecated-enum-enum-conversion] 2021-12-02 09:59:31 +01:00
wmayer bbacecb397 Gui: fix C++20 warning: bitwise operation between different enumeration types [-Wdeprecated-enum-enum-conversion] 2021-12-01 23:45:26 +01:00
luz paz 6a7184139d Gui: remove Py2 code from several src/Gui .cpp files 2021-04-14 14:56:02 +02:00
Mateusz Skowroński 1986e6b547 Qt::MidButton is deprecated. Use Qt::MiddleButton instead. 2021-04-04 11:33:51 +02:00
Fabio Rossi c6eda6dca7 [PythonConsole] Fixed pasting using middle mouse button on Linux 2020-12-24 17:07:48 +01:00
luz paz 298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer 6d0a136aad Qt5: 'void Q[Plain]TextEdit::setTabStopWidth(int)' is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer 1ee3d79d7c Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer 3f212ad8ac Porting Py3.8/Py3.9:
Since Py3.3: 'Py_ssize_t PyUnicode_GetSize(PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations]
2020-06-12 17:51:33 +02:00
wmayer c814eb1a50 Qt5: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
luz.paz 180805c55e Fix typos
Found via  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-03-06 14:50:35 +01:00
wmayer 250906d530 move Save history action to the correct position in the context-menu, do some minor optimizations 2019-09-07 15:48:16 +02:00
Yorik van Havre 1d0849f521 Python Console - only save max 100 history items 2019-09-07 15:27:04 +02:00
Yorik van Havre 164409cee9 Add Python console option to save history across sessions 2019-09-07 15:26:45 +02:00
wmayer de44a747f6 fix crash when checking an empty error message of an exception 2019-03-31 17:34:35 +02:00
wmayer 1daa0aa79c improve Copy&Paste handling in Python console 2019-03-05 10:20:50 +01:00
wmayer f0320d954a PVS: V629 Consider inspecting the 'col.red() << 24' expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. 2019-02-17 22:27:00 +01:00
Mateusz Skowroński 317bcd59c9 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
wmayer 64fa8cb855 improve handling of (raw) input in Python console 2019-01-04 14:16:50 +01:00
wmayer 7dc13bd2d6 Replace Base::Exception with appropriate subclass 2018-11-14 23:17:42 +01:00
wmayer 31cee58df6 fix crash when entering quit() in Python console for Py3 2018-04-28 12:13:42 +02:00
luz.paz 8690d870a5 Misc. typos
+ stepcode typo submitted upsream https://github.com/stepcode/stepcode/pull/372
2018-01-07 18:41:29 -02:00
wmayer 34b40f23a1 fixes #0002923: Python console history misbehaves with word-wrapped lines 2017-12-02 15:39:39 +01:00
wmayer 3b957a12b5 various minor changes:
+ whitespace improvement
+ code cleanup
2017-11-21 17:51:22 +01:00
wmayer 1b2b964c35 extend error text set in Python console by additional information if present 2017-05-17 19:59:17 +02:00
wmayer f3e722c6de in Python console check if exception is dict and set more readable text 2017-05-17 19:37:34 +02:00
Yorik van Havre aa3f9288d6 py3: Gui: files A-P ported to python3 2017-05-06 17:23:27 +02:00
wmayer 1673ab801e use specialized exception classes 2017-04-28 18:49:11 +02:00
Kurt Kremitzki f2467d7044 Add persistence to Python console word wrap 2017-02-07 10:58:38 -02:00
wmayer f19d424d8b fix -Wextra in FreeCADGui 2016-09-21 20:54:52 +02:00
wmayer 0824c5fd3c fix Coverity issues 2016-08-21 14:03:02 +02:00
Abdullah Tahiri 7fc7bdc302 Gui Enhancement: Support for macros in AppUserHome/Macro
=====================================================

What?
It was suggested that the macros should be moved to AppUserHome/Macro
http://forum.freecadweb.org/viewtopic.php?f=10&t=13433

Solution:
The solution is backwards compatible in the sense that if you have a running
configuration, updating should not change anything.

For new installations the macro directory will default to AppUserHome/Macro. However
this would break all the installation scripts (probably also ME's plugin manager).

Conflicts:
	src/Mod/Path/Gui/AppPathGuiPy.cpp
2016-01-11 19:24:22 +01:00
Mateusz Skowroński cd2db00f22 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
Mateusz Skowroński d5c074f80d QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:06:48 +01:00
Mateusz Skowroński 9aa3cfb4f9 Add missing QMimeData.h includes.
This change is Qt4/Qt5 neutral.
2015-12-24 13:36:46 +01:00