* 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>
+ 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
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.
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.
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
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
...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.
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.
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.