Commit Graph

64 Commits

Author SHA1 Message Date
wmayer
b50b21576e core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
Zheng, Lei
fd0f4f5654 Split App::AutoTransaction into its own file 2019-09-10 14:17:07 +02:00
wmayer
9c69c886a4 fix MSVC compiler warnings 2019-08-17 19:35:21 +02:00
Zheng, Lei
d0ca893b3e Command: disable auto transaction if triggering editing
Each command will create an App::AutoTransaction to auto create and
commit a transaction for proper undo/redo. But if the command starts
editing, the current transaction may be required to out live the current
command.

Note that the command can only detect editing if the code calls
Gui::Document::setEdit(). There are objects that starts editing by
calling its own ViewProvider::setEdit(), e.g. various TechDraw
ViewProviders. In this case, to avoid auto committing, one can call
App::Application::setActiveTransaction() with the second argument set to
true, or call App::AutoTransaction::setEnable(false).
2019-08-17 15:32:51 +02:00
Zheng, Lei
b1c0de8dae Gui: Command API changes
* invoke(), distinguish between command triggering source. Also add
  support of auto transaction using App::AutoTransaction. Now all
  command will support undo/redo by default.

* setupCheckable(), a helper function to Improve support of
  PythonGroupCommand

* getObjectCmd(), helper function to output Python command to refer to
  an object without ambiguity. Because with introduction of external
  linking, an object can no longer be safely referred through the
  current active document.

* Support auto MacroManager command logger. For commands that does not
  log any output to MacroManager, a log entry of 'Gui.runCommand()' will
  be auto generated.

* Support linked object in copyVisual()

* Modified do/runCommand() to print calling file and line number.

* Add various helper macros for run command involving a document or
  object.
2019-08-17 14:52:10 +02:00
wmayer
f160cc7854 PVS: V773 A memory leak is possible 2019-02-17 19:17:02 +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
0c8da1c38a add an assert to several Command methods to be notified in debug mode if no active document exists 2018-10-31 11:21:33 +01:00
luz.paz
505488c4f9 Misc. typos
Found via `codespell`
2018-04-25 09:41:33 -03:00
looooo
75a98c9613 add Base::PyGILStateLocker in Gui::Command::getResources 2018-01-12 15:02:13 +01:00
wmayer
868d9cc6c2 improve whitespaces 2017-11-24 15:43:28 +01:00
luzpaz
0d1451f39d User-facing typo fixes
All user-facing strings that have double (consecutive) whitespace e.g. `\b  \b`have been removed. Inspired by the error message in https://forum.freecadweb.org/viewtopic.php?f=3&t=5899&p=200309#p200309
2017-11-21 17:21:23 -03:00
Markus Lampert
da57822615 Use command's tootltip as statustip if no statustip is specified. 2017-09-28 23:22:11 +02:00
wmayer
5d2b22ca28 improve whitespaces 2017-08-31 23:01:34 +02:00
triplus
2cd535e015 WhatsThis support for Python based commands
Enables What's This command for Python based FreeCAD commands.

Forum discussion:
https://forum.freecadweb.org/viewtopic.php?f=15&t=23865
2017-08-13 11:20:25 +02:00
wmayer
5f54fc0298 py3: fix several crashes 2017-06-04 11:12:53 +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
wmayer
d2cb4e4af9 Qt4/Qt5 neutral changes:
+ remove QCoreApplication::UnicodeUTF8/QApplication::UnicodeUTF8
+ remove QCoreApplication::CodecForTr/QApplication::CodecForTr
2016-12-12 14:52:09 +01:00
wmayer
57e7d3ad61 Qt4/Qt5 neutral changes:
+ remove class DownloadDialog
+ remove class HelpView
+ remove class DlgTipOfTheDay
2016-12-12 14:35:52 +01:00
Yorik van Havre
af97583026 Doc: Fixes in doxygen docs for Draft,Arch, FEM 2016-11-17 17:04:09 -02:00
wmayer
ff1b9dde41 issue #0002687: zoomin/out during transform 2016-10-09 18:32:18 +02:00
wmayer
f19d424d8b fix -Wextra in FreeCADGui 2016-09-21 20:54:52 +02:00
wmayer
afa37847b5 remove Application::runPythonCode 2016-09-15 23:14:31 +02:00
wmayer
f44df3cdf0 do not use doCommand without using format string, add overloaded method of runCommand 2016-09-15 18:53:37 +02:00
wmayer
a12ecd49bd fix unicode <=> utf-8 conversion issue 2016-09-12 20:52:24 +02:00
wmayer
ef363f9390 split compound command in separate commands to make shortcus customizable 2016-09-10 14:47:01 +02:00
wmayer
13528b0aec fix more Coverity issues 2016-08-17 21:55:00 +02:00
wmayer
3c269f4ccd + use QString's vsprintf to avoid to truncate the output string 2016-06-04 10:37:08 +02:00
wmayer
d8430f191f + simplify fix to avoid memory leaks in keySequenceToAccel 2016-03-09 17:19:19 +01:00
Eivind Kvedalen
e940274146 Fixed leak. 2016-03-08 16:09:25 +01:00
Abdullah Tahiri
8a3958ced5 Gui: Extension of CommandMacro for system-wide macros
=====================================================

What?
Extension of the CommandMacro constructor to take an additional optional argument to indicate that the macro
is located in the system-wide directory, and shall be executed accordingly.
2016-01-11 19:25:53 +01: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
wmayer
61e1a5ca2f + use Python's inspect module to get calling instance of addCommand 2015-12-16 23:07:24 +01:00
wmayer
c133457da5 + when running a bound macro check if file exists, proper unicode handling of macros in customize dialog 2015-10-08 12:37:30 +02:00
wmayer
b7be7aec13 + Prefer prefix ++/-- operators for non-primitive types 2015-10-07 13:38:17 +02:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
cda9bf9ed5 + allow to set a default action for an exclusive group 2015-09-20 15:47:11 +02:00
wmayer
ec91085765 + duplicate string array for Python commands 2015-09-20 14:11:53 +02:00
wmayer
26b424e776 + support of exclusive Python command groups 2015-09-02 22:52:04 +02:00
wmayer
27dc80c846 + support of checkable commands 2015-08-25 18:01:37 +02:00
wmayer
1e745a6a6f + improve formatting 2015-08-25 15:11:42 +02:00
wmayer
2b53da4eee + include missing header files 2015-06-30 17:48:03 +02:00
wmayer
cd0b369425 + issue #0002053: Support of themes 2015-06-28 23:30:42 +02:00
wmayer
eaa5b15291 + return 0 for empty icon names of Python commands 2015-06-27 19:24:11 +02:00
wmayer
882ecd3ce3 + implement class PythonGroupCommand 2015-06-27 17:21:02 +02:00
wmayer
c91018946c + Extend Command framework to allow to update QAction 2015-06-03 18:30:36 +02:00
wmayer
86882eec6a + Handle PyCXX exception in Command::invoke 2015-01-17 16:36:19 +01:00