|
@@ -104,6 +104,7 @@ from cura.Settings.UserChangesModel import UserChangesModel
|
|
|
from cura.Settings.ExtrudersModel import ExtrudersModel
|
|
|
from cura.Settings.MaterialSettingsVisibilityHandler import MaterialSettingsVisibilityHandler
|
|
|
from cura.Settings.ContainerManager import ContainerManager
|
|
|
+from cura.Settings.SidebarCustomMenuItemsModel import SidebarCustomMenuItemsModel
|
|
|
|
|
|
from cura.ObjectsModel import ObjectsModel
|
|
|
|
|
@@ -226,6 +227,8 @@ class CuraApplication(QtApplication):
|
|
|
|
|
|
self._need_to_show_user_agreement = True
|
|
|
|
|
|
+ self._sidebar_custom_menu_items = [] # type: list # Keeps list of custom menu items for the side bar
|
|
|
+
|
|
|
self._plugins_loaded = False
|
|
|
|
|
|
# Backups
|
|
@@ -944,6 +947,7 @@ class CuraApplication(QtApplication):
|
|
|
qmlRegisterType(MachineNameValidator, "Cura", 1, 0, "MachineNameValidator")
|
|
|
qmlRegisterType(UserChangesModel, "Cura", 1, 0, "UserChangesModel")
|
|
|
qmlRegisterSingletonType(ContainerManager, "Cura", 1, 0, "ContainerManager", ContainerManager.getInstance)
|
|
|
+ qmlRegisterType(SidebarCustomMenuItemsModel, "Cura", 1, 0, "SidebarCustomMenuItemsModel")
|
|
|
|
|
|
# As of Qt5.7, it is necessary to get rid of any ".." in the path for the singleton to work.
|
|
|
actions_url = QUrl.fromLocalFile(os.path.abspath(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml")))
|
|
@@ -1731,3 +1735,11 @@ class CuraApplication(QtApplication):
|
|
|
@pyqtSlot()
|
|
|
def showMoreInformationDialogForAnonymousDataCollection(self):
|
|
|
cast(SliceInfo, self._plugin_registry.getPluginObject("SliceInfoPlugin")).showMoreInfoDialog()
|
|
|
+
|
|
|
+
|
|
|
+ def addSidebarCustomMenuItem(self, menu_item: list) -> None:
|
|
|
+ self._sidebar_custom_menu_items.append(menu_item)
|
|
|
+
|
|
|
+ def getSidebarCustomMenuItems(self) -> list:
|
|
|
+ return self._sidebar_custom_menu_items
|
|
|
+
|