Skip to content

Commit cd09850

Browse files
committed
Fix syntax and import for Cura 4.x
1 parent 286520d commit cd09850

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

SidebarGUIPlugin.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
from UM.Application import Application
66
from UM.Extension import Extension
77
from UM.Logger import Logger
8-
from PyQt6.QtCore import QTimer
8+
9+
try:
10+
from cura.ApplicationMetadata import CuraSDKVersion
11+
except ImportError: # Cura <= 3.6
12+
CuraSDKVersion = "6.0.0"
13+
if CuraSDKVersion >= "8.0.0":
14+
from PyQt6.QtCore import QTimer
15+
else:
16+
from PyQt5.QtCore import QTimer
917

1018
from .SidebarGUIProxy import SidebarGUIProxy
1119

SidebarGUIProxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def setActiveView(self, view_id: str) -> None:
100100
"""Set the active view from QML."""
101101
controller = Application.getInstance().getController()
102102
if controller:
103-
Logger.log("d", f"SidebarGUI: Setting active view to {view_id}")
103+
Logger.log("d", "Setting active view to %s", view_id)
104104
controller.setActiveView(view_id)
105105

106106
@pyqtSlot("QVariant", result=bool)

resources/qml/PrepareStageLegend40.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ Cura.ExpandableComponent
8181
text: catalog.i18nc("@label", "X-Ray view")
8282
width: parent.width
8383
}
84-
}
8584

8685
Label
8786
{

0 commit comments

Comments
 (0)