mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:09:01 +08:00
CURA-5570 Expose the CuraSDKVersion to qml and show the buildplate
selector only when "dev" version is selected.
This commit is contained in:
parent
98a0bb5002
commit
b1c073aab6
@ -117,11 +117,12 @@ if TYPE_CHECKING:
|
|||||||
numpy.seterr(all = "ignore")
|
numpy.seterr(all = "ignore")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cura.CuraVersion import CuraVersion, CuraBuildType, CuraDebugMode
|
from cura.CuraVersion import CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion
|
||||||
except ImportError:
|
except ImportError:
|
||||||
CuraVersion = "master" # [CodeStyle: Reflecting imported value]
|
CuraVersion = "master" # [CodeStyle: Reflecting imported value]
|
||||||
CuraBuildType = ""
|
CuraBuildType = ""
|
||||||
CuraDebugMode = False
|
CuraDebugMode = False
|
||||||
|
CuraSDKVerion = ""
|
||||||
|
|
||||||
|
|
||||||
class CuraApplication(QtApplication):
|
class CuraApplication(QtApplication):
|
||||||
@ -910,6 +911,7 @@ class CuraApplication(QtApplication):
|
|||||||
engine.rootContext().setContextProperty("CuraApplication", self)
|
engine.rootContext().setContextProperty("CuraApplication", self)
|
||||||
engine.rootContext().setContextProperty("PrintInformation", self._print_information)
|
engine.rootContext().setContextProperty("PrintInformation", self._print_information)
|
||||||
engine.rootContext().setContextProperty("CuraActions", self._cura_actions)
|
engine.rootContext().setContextProperty("CuraActions", self._cura_actions)
|
||||||
|
engine.rootContext().setContextProperty("CuraSDKVersion", CuraSDKVersion)
|
||||||
|
|
||||||
qmlRegisterUncreatableType(CuraApplication, "Cura", 1, 0, "ResourceTypes", "Just an Enum type")
|
qmlRegisterUncreatableType(CuraApplication, "Cura", 1, 0, "ResourceTypes", "Just an Enum type")
|
||||||
|
|
||||||
|
@ -231,8 +231,8 @@ UM.MainWindow
|
|||||||
onObjectRemoved: settingsMenu.removeItem(object)
|
onObjectRemoved: settingsMenu.removeItem(object)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Temporary hidden, add back again when feature ready
|
// TODO Only show in dev mode. Remove check when feature ready
|
||||||
BuildplateMenu { title: catalog.i18nc("@title:menu", "&Build plate"); visible: Cura.MachineManager.hasVariantBuildplates }
|
BuildplateMenu { title: catalog.i18nc("@title:menu", "&Build plate"); visible: CuraSDKVersion == "dev" ? Cura.MachineManager.hasVariantBuildplates : false }
|
||||||
ProfileMenu { title: catalog.i18nc("@title:menu", "&Profile"); }
|
ProfileMenu { title: catalog.i18nc("@title:menu", "&Profile"); }
|
||||||
|
|
||||||
MenuSeparator { }
|
MenuSeparator { }
|
||||||
|
@ -476,8 +476,8 @@ Column
|
|||||||
{
|
{
|
||||||
id: buildplateRow
|
id: buildplateRow
|
||||||
height: UM.Theme.getSize("sidebar_setup").height
|
height: UM.Theme.getSize("sidebar_setup").height
|
||||||
// TODO Temporary hidden, add back again when feature ready
|
// TODO Only show in dev mode. Remove check when feature ready
|
||||||
visible: false //Cura.MachineManager.hasVariantBuildplates && !sidebar.hideSettings
|
visible: CuraSDKVersion == "dev" ? Cura.MachineManager.hasVariantBuildplates && !sidebar.hideSettings : false
|
||||||
|
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user