diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index fa0b43993e..4379ec72ca 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -63,6 +63,16 @@ class PrintInformation(QObject): currentPrintTimeChanged = pyqtSignal() + preSlicedChanged = pyqtSignal() + + @pyqtProperty(bool, notify=preSlicedChanged) + def isPreSliced(self): + return self._pre_sliced + + def setPreSliced(self, pre_sliced): + self._pre_sliced = pre_sliced + self.preSlicedChanged.emit() + @pyqtProperty(Duration, notify = currentPrintTimeChanged) def currentPrintTime(self): return self._current_print_time diff --git a/plugins/GCODEReader/GCODEReader.py b/plugins/GCODEReader/GCODEReader.py index 55802e5c16..4b13f03220 100644 --- a/plugins/GCODEReader/GCODEReader.py +++ b/plugins/GCODEReader/GCODEReader.py @@ -72,11 +72,11 @@ class GCODEReader(MeshReader): if not findAny(): backend._pauseSlicing = False Application.getInstance().setHideSettings(False) - Application.getInstance().getPrintInformation()._pre_sliced = False + Application.getInstance().getPrintInformation().setPreSliced(False) else: backend._pauseSlicing = True backend.backendStateChange.emit(3) - Application.getInstance().getPrintInformation()._pre_sliced = True + Application.getInstance().getPrintInformation().setPreSliced(True) Application.getInstance().setHideSettings(True) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 314f3b7443..e4843f7eb5 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -406,7 +406,8 @@ UM.MainWindow iconSource: UM.Theme.getIcon("viewmode"); style: UM.Theme.styles.tool_button; - tooltip: ''; + tooltip: ""; + enabled: !PrintInformation.isPreSliced menu: ViewMenu { } } diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index 74579932e0..dc9cbe7501 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -11,6 +11,7 @@ Menu { title: catalog.i18nc("@title:menu menubar:toplevel", "&View"); id: menu + enabled: !PrintInformation.isPreSliced Instantiator { model: UM.ViewModel { }