mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
T466: Added disabling of view button
This commit is contained in:
parent
9da00563e5
commit
84add5be84
4 changed files with 15 additions and 3 deletions
|
@ -63,6 +63,16 @@ class PrintInformation(QObject):
|
||||||
|
|
||||||
currentPrintTimeChanged = pyqtSignal()
|
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)
|
@pyqtProperty(Duration, notify = currentPrintTimeChanged)
|
||||||
def currentPrintTime(self):
|
def currentPrintTime(self):
|
||||||
return self._current_print_time
|
return self._current_print_time
|
||||||
|
|
|
@ -72,11 +72,11 @@ class GCODEReader(MeshReader):
|
||||||
if not findAny():
|
if not findAny():
|
||||||
backend._pauseSlicing = False
|
backend._pauseSlicing = False
|
||||||
Application.getInstance().setHideSettings(False)
|
Application.getInstance().setHideSettings(False)
|
||||||
Application.getInstance().getPrintInformation()._pre_sliced = False
|
Application.getInstance().getPrintInformation().setPreSliced(False)
|
||||||
else:
|
else:
|
||||||
backend._pauseSlicing = True
|
backend._pauseSlicing = True
|
||||||
backend.backendStateChange.emit(3)
|
backend.backendStateChange.emit(3)
|
||||||
Application.getInstance().getPrintInformation()._pre_sliced = True
|
Application.getInstance().getPrintInformation().setPreSliced(True)
|
||||||
Application.getInstance().setHideSettings(True)
|
Application.getInstance().setHideSettings(True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -406,7 +406,8 @@ UM.MainWindow
|
||||||
iconSource: UM.Theme.getIcon("viewmode");
|
iconSource: UM.Theme.getIcon("viewmode");
|
||||||
|
|
||||||
style: UM.Theme.styles.tool_button;
|
style: UM.Theme.styles.tool_button;
|
||||||
tooltip: '';
|
tooltip: "";
|
||||||
|
enabled: !PrintInformation.isPreSliced
|
||||||
menu: ViewMenu { }
|
menu: ViewMenu { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ Menu
|
||||||
{
|
{
|
||||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
|
title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
|
||||||
id: menu
|
id: menu
|
||||||
|
enabled: !PrintInformation.isPreSliced
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
model: UM.ViewModel { }
|
model: UM.ViewModel { }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue