Commit Graph

35 Commits

Author SHA1 Message Date
wmayer
e53e231677 Gui: remove some superfluous const_cast 2022-06-24 14:48:52 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
aa7977c51a [Gui] Task* and Text*: remove unused includes 2022-03-05 17:44:07 +01:00
wmayer
0ccca56532 Gui: [skip ci] make some minor improvements in ReportOutput class 2022-02-24 17:56:52 +01:00
wmayer
b9b32c7ebf Gui: Fix problem where Python output and errors are not redirected to report view until preferences window is opened 2022-02-24 17:42:40 +01:00
wmayer
afa40eaf87 Gui: reduce code duplication in ReportOutputObserver and ReportOutput 2021-12-27 17:50:48 +01:00
Uwe
5923ce1858 [GUI] don't show report view on warnings by default
I introduced FreeCAD to several people and see that especially newbies are confused with all the warnings they get but cannot understand.
The solution was to change that the report view panel is not automatically shown on every warning.
This PR does this.

More experienced users can anytime enable the option. Thus this PR has not much impact but obviously makes life easier for beginners.
2021-12-25 20:40:24 +01:00
wmayer
a853d80c73 Gui: make the Copy command of the report window working if an object in the tree is selected 2021-12-13 18:57:28 +01:00
wmayer
055bcbbe1a Gui: refactoring: move duplicated code to DockWindowManager::activate() 2021-12-09 07:40:44 +01:00
wmayer
df0f979f3b App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
Mark Ganson TheMarkster
c714dd0a78 [Report View] fix inconsistencies
Make default values consistent for whether to show report view on log and normal messages.  Default values should be warnings: true, errors: true, normals: false, logs: false.
2020-08-24 16:30:12 +02:00
wmayer
ed4876abb4 Gui: add an option to also suppress normal messages 2020-07-31 19:39:49 +02:00
mwganson
a41ad338e9 [report view] add preferences to report view context menu 2020-07-31 19:39:49 +02:00
wmayer
8fc8a949c9 Gui: [skip ci] avoid to write several time stamps to a single line 2020-07-15 12:49:20 +02:00
mikeprice99
921e89498c Add timecode option for report view 2020-07-10 13:03:37 +02: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
84a164ba30 Qt5: 'static QString Gui::TaskView::TaskWatcherCommands::trUtf8(const char*, const char*, int)' is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
mwganson
168ce605a1 [Report View] add options to show report view on warning, error, normal, and log message types individually 2020-03-16 19:21:49 +01:00
wmayer
867f22d3c8 fix regressions in SplashObserver::SendLog and ReportOutput::SendLog 2019-10-20 13:41:10 +02:00
ezzieyguywuf
f27e4590a6 Refactor and rename ConsoleObserver...
...Renamed to "ILogger", to designate that this is an Interface for a
Logger. This "Interface" is pure virtual, so that it cannot be
instantiated directly. This makes it clear that it is intended to be
derived.

Finally, got rid of all the individual log-style methods and replaced
with SendLog. The idea here is that day-to-day users will only interact
with ILogger through ConsoleSingleton (or, likely, LoggerSingleton in
the future). This singleton will manage an arbirtary collection of
ILogger, and call SendLog with the appropriate parameters based on what
the user requests.

Therefore, the singleton itself will have the individual Log, Message,
Error, etc... methods, while stil allowing us to simplify the code base
of ILogger and its derived classes.
2019-10-20 11:46:15 +02:00
Zheng, Lei
bd2f5191c9 Gui: Application/Document/MainWindow changes following App namespace
Application:

* signalNewDocument, check the extra argument, isMainDoc, the decide
  whether to create view of the new document. This is so that external
  linked document can be opened in background without crowding the tab
  list.

* slotDeleteDocument, calls Document::beforeDelete()

* slotActiveDocument, creates view if none, because external document
  is now opened without view.

* onLastWindowClosed(), switch to next active document, and creates view
  if none.

* send(Has)MsgToFocusView(), new API to send message to the active view
  in focus. This is to solve the ambiguity of things like pressing
  delete key, copy, paste handling when the active new is not in focus.
  For example, when spread sheet view is active, delete/copy/paste
  handling should be different when the focus on the spread sheet view
  or focus on tree view.

* tryClose(), delegate to MainWindow for close confirmation

* reopen(), new API to reload a partial document in full

Document/DocumentP:

* _CoinMap, new internal map for quick access view provider from its
  root node.

* slotNewObject, modified to support view provider override from
  App::FeaturePython, through new API
  DocumentObject::getViewProviderNameOverride().

* slotDeletedObject/slotTransactionRemove, improve handling of geo group
  children rebuild

* slotSkipRecompute, add special handling of document with skip
  recompute. Some command cannot work when skip recompute is active.
  For example, sketcher command will check if recompute is successful
  on many commands, and will undo if not. New 'PartialCompute' flag is
  added to allow recompute only the editing object and all its
  dependencies if 'SkipRecompute' is active.

* slotTouchedObject, new signal handling of manually touched object.

* setModified(), do nothing if already modified. This is a critical
  performance improvement, because marking tab window as modified turns
  out to be a relatively expensive operation, and will cause massive
  slow down if calling it on every property change.

* getViewProviderByPathFromHead/getViewProvidersByPath(), new APIs to
  obtain view provider(s) from coin SoPath.

* save/saveAll/saveCopy, modified to support external document saving.

* Save/RestoreDocFile(), save and restore tree item recursive expansion
  status.

* slotFinishRestoreObject(), handle new signal
  signalFinishRestoreObject(), unifies postprocessing in restore and
  import operation.

* createView/setActiveView(), add support of delayed view creations

* canClose(), delegate to MainWindows to ask for confirmation

* undo/redo(), support grouped transaction undo/redo. Transactions may
  be grouped by the same transaction ID if they are triggered by a
  single operation but involves objects from multiple documents.

* toggleInSceneGraph(), new API to add or remove root node from or to
  scenegraph without deleting the view object.

MainWindow:

* Update command status using a single shot timer instead of periodical
  one.

* Improve message display is status bar. Give error and warning message
  higher priority (using QStatusBar::showMessage()) than normal status
  message (using actionLabel), reversed from original implementation.

* confirmSave(), new API to check for modification, and ask user to save
  the document before closing. The confirmation dialog allows user to
  apply the answer to all document for convenience.

* saveAll(), new API to save all document with correct ordering in case
  of external linking.

* createMimeDataFromSelection/insertFromMimeData(), support copy paste
  object with external linking. A new dialog DlgObjectSelection is used
  to let user select exactly which object to export.

CommandDoc/CommandWindow:

* Related changes to object delete, document import, export, and save.
2019-08-17 15:08:33 +02:00
wmayer
53f51db8ae eliminate some bad old-style casts which hide an obscure error 2019-07-21 17:51:29 +02:00
mwganson
3cc93d1961 [enable report view on warnings/erros] add reportoutputobserver class, manage report view visibility via QDocketWidget toggleViewAction() rather than directly with show(), remove unnecessary variables 2019-07-21 15:58:12 +02:00
mwganson
50908da85d remove whitespace 2019-07-21 15:58:04 +02:00
mwganson
b20dd0da10 Show report view on all warnings or errors by default, can be disabled in preferences 2019-07-21 15:57:57 +02: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
wmayer
3cac7be520 issue #0002724: Redirecting messages to Python console apply issue. 2016-10-09 18:47:11 +02: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
wmayer
967eead27a + split file extension from descriptive text of file format to avoid that invalid translation breaks file dialog
+ add method to make image view unclosable for user
+ fix possible crash in MeshAlgorithm::GetMeshBorder
+ fix possible crash in MeshAlgorithm::ConnectLines
2015-10-06 17:28:52 +02:00
wmayer
f7644fc9f3 + issue #0002053: Support of themes 2015-07-12 22:54:56 +02:00
wmayer
1f478269af + use dialog button box where possible, replace old Python icon 2014-03-08 15:17:56 +01:00
wmayer
d927d0bcb9 + improve handling of default colors of report view and Python console when using style sheets 2014-01-31 11:34:30 +01:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00