Compare commits

..

5 Commits

Author SHA1 Message Date
af7eab3a70 Merge branch 'main' into feat/native-start-panel-167 2026-02-10 16:40:49 +00:00
6d231e80dd Merge pull request 'fix: use Gui.Document.Modified instead of App.Document.Modified' (#14) from fix/save-modified-attribute into main
Reviewed-on: #14
2026-02-10 12:57:29 +00:00
a7ef5f195b Merge branch 'main' into fix/save-modified-attribute 2026-02-10 12:57:16 +00:00
Zoe Forbes
7cf5867a7a fix: use Gui.Document.Modified instead of App.Document.Modified (#13)
App.Document has no 'Modified' attribute — it only exists on
Gui.Document. This caused every Silo save to fail with:
  Silo save failed: 'App.Document' object has no attribute 'Modified'

The save itself succeeded but the modified flag was never cleared,
so the document always appeared unsaved.
2026-02-09 18:40:42 -06:00
Zoe Forbes
9a6d1dfbd2 fix: use Gui.Document.Modified instead of App.Document.Modified (#13)
App.Document has no 'Modified' attribute — it only exists on
Gui.Document. This caused every Silo save to fail with:
  Silo save failed: 'App.Document' object has no attribute 'Modified'

The save itself succeeded but the modified flag was never cleared,
so the document always appeared unsaved.
2026-02-09 18:40:18 -06:00
2 changed files with 7 additions and 7 deletions

View File

@@ -990,10 +990,8 @@ def _check_pull_conflicts(part_number, local_path, doc=None):
conflicts = [] conflicts = []
# Check for unsaved changes in an open document # Check for unsaved changes in an open document
if doc is not None: if doc is not None and doc.IsModified():
gui_doc = FreeCADGui.getDocument(doc.Name) if doc.Name else None conflicts.append("Document has unsaved local changes.")
if gui_doc and gui_doc.Modified:
conflicts.append("Document has unsaved local changes.")
# Check local revision vs server latest # Check local revision vs server latest
if doc is not None: if doc is not None:
@@ -1215,7 +1213,7 @@ class Silo_Pull:
progress = QtGui.QProgressDialog( progress = QtGui.QProgressDialog(
f"Downloading {part_number} rev {rev_num}...", "Cancel", 0, 100 f"Downloading {part_number} rev {rev_num}...", "Cancel", 0, 100
) )
progress.setWindowModality(QtCore.Qt.WindowModal) progress.setWindowModality(2) # Qt.WindowModal
progress.setMinimumDuration(0) progress.setMinimumDuration(0)
progress.setValue(0) progress.setValue(0)

View File

@@ -392,8 +392,10 @@ class SiloOrigin:
obj.SiloPartNumber, str(file_path), properties, comment="" obj.SiloPartNumber, str(file_path), properties, comment=""
) )
# Clear modified flag # Clear modified flag (Modified is on Gui.Document, not App.Document)
doc.Modified = False gui_doc = FreeCADGui.getDocument(doc.Name)
if gui_doc:
gui_doc.Modified = False
return True return True
except Exception as e: except Exception as e: