Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions UM/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def __init__(self, name: str, version: str, latest_url: str, api_version: str, a

self._app_install_dir = self.getInstallPrefix() # type: str

self._loading_workspace = False

# Intended for keeping plugin workspace metadata that is going to be saved in and retrieved from workspace files.
# When the workspace is stored, all workspace readers will need to ensure that the workspace metadata is correctly
# stored to the output file. The same also holds when loading a workspace; the existing data will be cleared
Expand All @@ -126,6 +128,12 @@ def __init__(self, name: str, version: str, latest_url: str, api_version: str, a
def getAPIVersion(self) -> "Version":
return self._api_version

def getloadingWorkspace(self) -> bool:
return self._loading_workspace

def setloadingWorkspace(self, loading_workspace: bool) -> None:
self._loading_workspace = loading_workspace

def getWorkspaceMetadataStorage(self) -> WorkspaceMetadataStorage:
return self._workspace_metadata_storage

Expand Down
3 changes: 3 additions & 0 deletions UM/Workspace/WorkspaceFileHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def readerRead(self, reader: WorkspaceReader, file_name: str, **kwargs):
return results

def _readLocalFile(self, file: QUrl, add_to_recent_files_hint: bool = True) -> None:
self._application.setloadingWorkspace(True)

from UM.FileHandler.ReadFileJob import ReadFileJob
filename = file.toLocalFile()
job = ReadFileJob(filename, handler = self, add_to_recent_files = add_to_recent_files_hint)
Expand All @@ -71,3 +73,4 @@ def _readWorkspaceFinished(self, job: ReadFileJob) -> None:

self._application.getWorkspaceMetadataStorage().setAllData(metadata)
self._application.workspaceLoaded.emit(cast(WorkspaceReader, self.workspace_reader).workspaceName())
self._application.setloadingWorkspace(False)
Loading