Skip to content

Commit 0e90f35

Browse files
authored
fix: prevent preview from being disabled when printer selected (#405)
* fix: prevent preview settings from being disabled when printer is selected * refactor: remove triple call to set combobox value --------- Signed-off-by: Pavel Polyakov <[email protected]>
1 parent 8a98758 commit 0e90f35

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

MachineConfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def supportScreenshot(self):
274274
global_container_stack = Application.getInstance().getGlobalContainerStack()
275275
if global_container_stack:
276276
meta_data = global_container_stack.getMetaData()
277-
if Constants.SIMAGE in meta_data or Constants.GIMAGE in meta_data:
277+
if Constants.SCREENSHOT_INDEX in meta_data or Constants.SIMAGE in meta_data or Constants.GIMAGE in meta_data:
278278
return True
279279
return False
280280

qml/MachineConfig.qml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ Cura.MachineAction {
2121

2222
property var printerSupportScreenshots: manager.supportScreenshot()
2323
property var printerScreenshotSizesList: manager.getScreenshotOptions()
24-
property var printerScreenshotIndex: {
25-
var sIndex = manager.getScreenshotIndex()
26-
27-
screenshotComboBox.currentIndex = sIndex
28-
return sIndex
29-
}
3024

3125
function connectPrinter() {
3226
if(base.selectedPrinter) {
@@ -334,11 +328,10 @@ Cura.MachineAction {
334328
manager.setSimage("")
335329
manager.setGimage("")
336330
manager.setScreenshotIndex("")
337-
screenshotComboBox.currentIndex = 0
338331
}
339332
simageTextInput.text = manager.getSimage()
340333
gimageTextInput.text = manager.getGimage()
341-
screenshotComboBox.currentIndex = printerScreenshotIndex
334+
screenshotComboBox.currentIndex = manager.getScreenshotIndex()
342335
}
343336

344337
enabled: mksSupport.checked

0 commit comments

Comments
 (0)