|
@@ -179,7 +179,7 @@ class CuraApplication(QtApplication):
|
|
|
self._use_single_instance = False
|
|
|
|
|
|
self._single_instance = None
|
|
|
- self._project_mode = None
|
|
|
+ self._open_project_mode: Optional[str] = None
|
|
|
|
|
|
self._cura_formula_functions = None # type: Optional[CuraFormulaFunctions]
|
|
|
|
|
@@ -1846,7 +1846,7 @@ class CuraApplication(QtApplication):
|
|
|
Logger.log("i", "Attempting to read file %s", file.toString())
|
|
|
if not file.isValid():
|
|
|
return
|
|
|
- self._project_mode = project_mode
|
|
|
+ self._open_project_mode = project_mode
|
|
|
scene = self.getController().getScene()
|
|
|
|
|
|
for node in DepthFirstIterator(scene.getRoot()):
|
|
@@ -1856,16 +1856,16 @@ class CuraApplication(QtApplication):
|
|
|
|
|
|
is_project_file = self.checkIsValidProjectFile(file)
|
|
|
|
|
|
- if self._project_mode is None:
|
|
|
- self._project_mode = self.getPreferences().getValue("cura/choice_on_open_project")
|
|
|
+ if self._open_project_mode is None:
|
|
|
+ self._open_project_mode = self.getPreferences().getValue("cura/choice_on_open_project")
|
|
|
|
|
|
- if is_project_file and self._project_mode == "open_as_project":
|
|
|
+ if is_project_file and self._open_project_mode == "open_as_project":
|
|
|
# open as project immediately without presenting a dialog
|
|
|
workspace_handler = self.getWorkspaceFileHandler()
|
|
|
workspace_handler.readLocalFile(file, add_to_recent_files_hint = add_to_recent_files)
|
|
|
return
|
|
|
|
|
|
- if is_project_file and self._project_mode == "always_ask":
|
|
|
+ if is_project_file and self._open_project_mode == "always_ask":
|
|
|
# present a dialog asking to open as project or import models
|
|
|
self.callLater(self.openProjectFile.emit, file, add_to_recent_files)
|
|
|
return
|
|
@@ -2001,9 +2001,9 @@ class CuraApplication(QtApplication):
|
|
|
|
|
|
node.translate(Vector(0, center_y, 0))
|
|
|
nodes_to_arrange.append(node)
|
|
|
- # If file extention is 3mf and models are to be loaded from a cura project,
|
|
|
- # models are to be arranged in buildplate.
|
|
|
- elif self._project_mode == "open_as_model":
|
|
|
+ # If the file is a project,and models are to be loaded from a that project,
|
|
|
+ # models inside file should be arranged in buildplate.
|
|
|
+ elif self._open_project_mode == "open_as_model":
|
|
|
nodes_to_arrange.append(node)
|
|
|
|
|
|
# This node is deep copied from some other node which already has a BuildPlateDecorator, but the deepcopy
|