Skip to content

Commit b42dc65

Browse files
committed
Fix sdk version comparison
1 parent 487b16d commit b42dc65

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

resources/qml/MonitorStageMenu.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Item
3030
isLE410 = (CuraSDKVersion <= "7.6.0")
3131
isLE413 = (CuraSDKVersion <= "7.9.0")
3232
isLE51 = (CuraSDKVersion <= "8.1.0")
33-
isLE52 = (CuraSDKVersion <= "8.2.0") && UM.Application.version != "master" && UM.Application.version != "dev"
33+
isLE52 = (CuraSDKVersion <= "8.2.0")
3434

3535
// adjust message stack position for sidebar
3636
var messageStack

resources/qml/SidebarStageMenu.qml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Item
2020
property bool isLE50
2121
property bool isLE51
2222
property bool isLE52
23+
property bool isLE59
2324

2425
property bool prepareStageActive: UM.Controller.activeStage.toString().indexOf("PrepareStage") == 0
2526
property bool preSlicedData: PrintInformation !== null && PrintInformation.preSliced
@@ -32,15 +33,18 @@ Item
3233

3334
Component.onCompleted:
3435
{
35-
is40 = (CuraSDKVersion == "6.0.0")
36-
isLE43 = (CuraSDKVersion <= "6.3.0")
37-
isLE44 = (CuraSDKVersion <= "7.0.0")
38-
isLE46 = (CuraSDKVersion <= "7.2.0")
39-
isLE410 = (CuraSDKVersion <= "7.6.0")
40-
isLE413 = (CuraSDKVersion <= "7.9.0")
41-
isLE50 = (CuraSDKVersion <= "8.0.0")
42-
isLE51 = (CuraSDKVersion <= "8.1.0")
43-
isLE52 = (CuraSDKVersion <= "8.2.0") && UM.Application.version != "master" && UM.Application.version != "dev"
36+
// create a version string that can be easily compared, even with the minor version >= 10
37+
var SortableSDKVersion = parseInt(CuraSDKVersion.replace(/\.(\d)\./g, ".0$1."))
38+
is40 = (SortableSDKVersion == "6.00.0")
39+
isLE43 = (SortableSDKVersion <= "6.03.0")
40+
isLE44 = (SortableSDKVersion <= "7.00.0")
41+
isLE46 = (SortableSDKVersion <= "7.02.0")
42+
isLE410 = (SortableSDKVersion <= "7.06.0")
43+
isLE413 = (SortableSDKVersion <= "7.09.0")
44+
isLE50 = (SortableSDKVersion <= "8.00.0")
45+
isLE51 = (SortableSDKVersion <= "8.01.0")
46+
isLE52 = (SortableSDKVersion <= "8.02.0")
47+
isLE59 = (SortableSDKVersion <= "8.09.0") && CuraApplication.version != "master" && CuraApplication.version != "dev"
4448
if(is40)
4549
{
4650
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 4.0")
@@ -67,11 +71,15 @@ Item
6771
}
6872
else if(isLE52)
6973
{
70-
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.2 and newer")
74+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.2")
75+
}
76+
else if(isLE59)
77+
{
78+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.3 - 5.9")
7179
}
7280
else
7381
{
74-
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.3 and newer")
82+
CuraApplication.log("SidebarGUIPlugin patching interface for Cura 5.10 and newer")
7583
}
7684

7785
// top-align toolbar (defined in Cura.qml)

0 commit comments

Comments
 (0)