Skip to content

Commit 75936eb

Browse files
committed
Fix compatibility with Cura 4.x
1 parent a70ec1c commit 75936eb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

SidebarIncompatibleVersion.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44
import os.path
55
import json
66

7-
from PyQt6.QtCore import QUrl
8-
from PyQt6.QtGui import QDesktopServices
7+
try:
8+
from cura.ApplicationMetadata import CuraSDKVersion
9+
except ImportError: # Cura <= 3.6
10+
CuraSDKVersion = "6.0.0"
11+
if CuraSDKVersion >= "8.0.0":
12+
from PyQt6.QtCore import QUrl
13+
from PyQt6.QtGui import QDesktopServices
14+
else:
15+
from PyQt5.QtCore import QUrl
16+
from PyQt5.QtGui import QDesktopServices
917

1018
from cura.CuraApplication import CuraApplication
1119
from UM.Extension import Extension
@@ -14,7 +22,7 @@
1422

1523
from UM.i18n import i18nCatalog
1624

17-
i18n_catalog = i18nCatalog("octoprint")
25+
i18n_catalog = i18nCatalog("cura")
1826

1927

2028
class SidebarIncompatibleVersion(Extension):

0 commit comments

Comments
 (0)