adding option of opening model as UCP or normal project file

CURA-11403
This commit is contained in:
Saumya Jain 2024-02-29 15:45:13 +01:00
parent c817f11c02
commit f3c49e494e
6 changed files with 187 additions and 35 deletions

View file

@ -1979,6 +1979,18 @@ class CuraApplication(QtApplication):
openProjectFile = pyqtSignal(QUrl, bool, arguments = ["project_file", "add_to_recent_files"]) # Emitted when a project file is about to open.
@pyqtSlot(QUrl, bool)
def readLocalUcpFile(self, file: QUrl, add_to_recent_files: bool = True):
file_name = QUrl(file).toLocalFile()
workspace_reader = self.getWorkspaceFileHandler()
if workspace_reader is None:
Logger.log("w", "Workspace reader not found")
return
workspace_reader.getReaderForFile(file_name).setOpenAsUcp(True)
workspace_reader.readLocalFile(file, add_to_recent_files)
@pyqtSlot(QUrl, str, bool)
@pyqtSlot(QUrl, str)
@pyqtSlot(QUrl)