Commit Graph

131 Commits

Author SHA1 Message Date
Yorik van Havre
2512fcd7cb Qassistant retirement: Added GIL lock 2022-03-23 12:00:35 +01:00
Yorik van Havre
5ecda50d07 Retiring qtassistant : Added Werner's fixes 2022-03-21 13:27:27 +01:00
Yorik van Havre
736027d509 Gui: Disable use of qassistant
Displaying of help pages is now handled by the Help addon.
In case the Help addon is not installed, an info message is shown.
2022-03-21 13:26:58 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Yorik van Havre
e4ca93bfbc Preparation for Help module
Added a preference switch to enable the use of the Help module.
Doing this before the release so users of 0.20 will be able to
use the Help module when it's ready
2022-03-02 19:07:44 +01:00
wmayer
fce7e11636 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
60bbd420ee [Gui] Selection and MainWindow: remove unused headers 2022-02-19 04:55:50 +01:00
Syres916
ad6c607f5c [Gui] MainWindow New Doc camera position bugfix
See https://forum.freecadweb.org/viewtopic.php?p=556465#p556465
2021-12-28 20:49:58 +01:00
wmayer
f36126770c App: harmonize API of App::Application
* make getHomePath() static and return a std::string
* make getExecutableName() static and return a std::string
2021-11-04 10:50:09 +01:00
wmayer
e68d85de91 Gui: [skip ci] fix gcc warning -Wimplicit-fallthrough= 2021-10-09 15:18:06 +02:00
wmayer
014e5985fd Gui: [skip ci] reformat code 2021-10-09 15:17:24 +02:00
Ajinkya Dahale
c123bc2bf8 [Core] (Partially?) Fix data loss on dir rename (#4996)
* Fix lost filename in err msg

In some circumstances, FileExceptions are constructed empty, then have a
filename assigned to them, but the error message in these scenarios is
left as the default "unknown" one, which is sometimes shown to users.
This change fixes that case to be consistent with instances that are
constructed with the filename.

The exception can happen when trying to save the file in a location that does
not exist, or when the user does not have permission to write there. If it
comes when saving after closing the document, all previous changes can be lost.

Partially fixes issue #4098.

Co-authored-by: Heewa Barfchin <heewa.b@gmail.com>
2021-09-16 12:06:29 -05:00
0penBrain
1dab35b01d [Gui] Send 'mainWindowClosed' signal before window settings are saved
So macros/add-ons can eventually restore things
2021-07-20 20:55:04 +02:00
wmayer
00fc5ae402 Gui: [skip ci] support user-defined about image 2021-04-04 00:12:53 +02:00
Chris Hennes
dac8b8ea6a Allow different splash and about image 2021-04-03 22:36:28 +02:00
wmayer
8992084a9a Gui: [skip ci] remove MainWindow::showMainWindow() & timer 2021-04-02 11:15:04 +02:00
Chris Hennes
098d7b9aee [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
wmayer
dd4dd204d0 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
Chris Hennes
533814dd0f Silence Qt/Windows setGeometry Warning
Add the optional Qt::MSWindowsFixedSizeDialogHint parameter to all uses of the QInputDialog::getX static functions to silence a Qt/Windows debug mode warning about QWindowsWindow::setGeometry: Unable to set geometry. Increase the size of the unit calculator to eliminate the same warning. Finally, call adjustSize() on the "Unsaved Changes" dialog to silence the warning.
2020-12-11 09:58:09 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
mwganson
b7f829e15f [Macro Menu] add Recent macros to Macro menu + list size preference. Executes selected macro or if Shift+click opens macro in editor. 2020-09-03 11:29:37 +02:00
wmayer
45e0673645 LGTM: [skip ci] fix: Declaration hides parameter
A local variable hides a parameter. This may be confusing. Consider renaming one of them.
2020-07-27 10:57:34 +02:00
Zheng, Lei
36d046d489 App/Gui: introduce temporary document
Add new argument to Application::newDocument() to create a temporary
    document. Also exposed to Python API App.newDocument() with a named
    argument 'temp'.

    The temporary document is marked with status bit 'TempDoc'. The user
    will not be prompt for saving when closing. The undo/redo is disabled.
    The AutoSaver skips it. And the tree view will not show it.
    PropertyXLink allows linking to/from object within a temporary document
    without saving.
2020-07-14 19:36:05 +02:00
Torsten Sadowski
b89b674a1d Fix for Bug #4372 2020-07-11 11:34:40 +02:00
wmayer
cff0638672 Qt5: QDesktopWidget is deprecated use QScreen [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8dbe26a95f Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
40dc3ccedd Qt5: 'QString QFileInfo::readLink() const' is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
02a15cdbe0 Gui: [skip ci] fix some thread issues:
avoid to crash the application when trying to create thumbnail from worker thread
avoid that application behaves weirdly when triggering an action update from worker thread
2020-06-12 12:20:20 +02:00
triplus
4fe8215d0f Support for grouped dragging of dockwidgets
Forum discussion:
https://forum.freecadweb.org/viewtopic.php?f=9&t=45697
2020-04-27 11:42:01 +02:00
wmayer
3a1c12207f Gui: [skip ci] add slot to update editor related commands 2020-03-17 10:03:32 +01:00
0penBrain
6c8eb7e047 Add ability to remember which workbench is active for each tab of the viewport
Can be enabled/disabled through preferences => Connected to 'SaveWBbyTab' parameter
Workbench is saved when it is changed or when a new subwindow is created
It is restored when subwindow is activated if one was previously saved
2020-03-02 11:59:30 -03:00
wmayer
a9d57472c4 Gui: ComboView always must be created because it includes the task view. 2020-02-08 14:52:28 +01:00
wmayer
8648bbe3df Gui: fix naming inconsistency and rename 'combi' to 'combo' 2020-02-08 13:43:44 +01:00
Zheng, Lei
c89a62ba52 Gui: fix tree view mode option in general preference 2020-02-08 13:12:30 +01:00
wmayer
169e290b86 Gui: [skip-ci] rename Sequencer to SequencerBar 2020-01-25 16:06:29 +01:00
wmayer
71818b466d Gui: implementation classes don't inherit from UI classes any more 2020-01-09 14:30:45 +01:00
Zheng, Lei
737eec13d4 Fix copy/paste objects through temp file 2019-12-06 14:43:02 -03:00
Zheng, Lei
a17f38fb74 Do not reserve memory when copy/paste objects through file 2019-12-06 14:43:02 -03:00
wmayer
462c5d40dd trigger update of action when activating MDI view 2019-10-29 22:19:43 +01:00
ezzieyguywuf
9fcc18b08e 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
wmayer
9fa56345cf 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
f55b4ca7f7 Gui: minor adjustment on command status update 2019-09-10 14:17:07 +02:00
wmayer
a0811878c2 re-activate DAG view 2019-09-08 16:00:08 +02:00
Zheng, Lei
a6da78b4e5 Gui: expose MainWindow:showStatus()
Tree view now uses this to show error on hovering over object in error.
2019-08-30 14:33:31 +02:00
wmayer
b0fac402ad Fix bug in MainWindow::setActiveWindow
The method MainWindow::setActiveWindow() must not automatically add a view to the mdi area if it's not part of it because this causes a crash when trying to make a fullscreen window or undock a view.
Instead the calling instance must explicitly call MainWindow::addWindow where needed.
2019-08-23 23:44:19 +02:00
wmayer
4068df6483 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
+ fix -Wunused-variable
+ fix -Wbraced-scalar-init
+ fix -Wparentheses (View3DInventorViewer::checkGroupOnTop: operator '?:' has lower precedence than '+'; '+' will be evaluated first)
+ fix -Wundefined-bool-conversion (MainWindow::updateActions)
+ suppress -Woverloaded-virtual but fix later
2019-08-17 19:52:12 +02:00
Zheng, Lei
0c6b1a5d69 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
c92fe4e368 eliminate some bad old-style casts which hide an obscure error 2019-07-21 17:51:29 +02:00
mwganson
89a62366ab [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