Moved calculating UCP only to Preread and getting value here

CURA-11403
This commit is contained in:
Saumya Jain 2024-03-05 16:34:41 +01:00
parent 0e70b80446
commit b119a010ca
3 changed files with 8 additions and 12 deletions

View file

@ -1,6 +1,5 @@
# Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import zipfile
from typing import List, cast
from PyQt6.QtCore import QObject, QUrl, pyqtSignal, pyqtProperty
@ -33,8 +32,6 @@ from cura.Operations.SetBuildPlateNumberOperation import SetBuildPlateNumberOper
from UM.Logger import Logger
from UM.Scene.SceneNode import SceneNode
USER_SETTINGS_PATH = "Cura/user-settings.json"
class CuraActions(QObject):
def __init__(self, parent: QObject = None) -> None:
super().__init__(parent)
@ -196,13 +193,6 @@ class CuraActions(QObject):
operation.addOperation(SetObjectExtruderOperation(node, extruder_id))
operation.push()
@pyqtSlot(str, result = bool)
def isProjectUcp(self, file_url) -> bool:
file_name = QUrl(file_url).toLocalFile()
archive = zipfile.ZipFile(file_name, "r")
cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")]
return USER_SETTINGS_PATH in cura_file_names
@pyqtSlot(int)
def setBuildPlateForSelection(self, build_plate_nr: int) -> None:
Logger.log("d", "Setting build plate number... %d" % build_plate_nr)