Get default settings view to work as sidebar component

This commit is contained in:
ChrisTerBeke 2017-12-04 16:28:35 +01:00
parent 5eeb98bbcf
commit 3c863fc388
8 changed files with 138 additions and 49 deletions

View file

@ -1,7 +1,9 @@
# Copyright (c) 2017 Ultimaker B.V.
from PyQt5.QtCore import QUrl
from UM.Logger import Logger
from UM.PluginObject import PluginObject
from UM.PluginRegistry import PluginRegistry
# Abstract class for sidebar view objects.
# By default the sidebar is Cura's settings, slicing and printing overview.
@ -10,4 +12,13 @@ class SidebarView(PluginObject):
def __init__(self):
super().__init__()
print("sidebar view hello")
self._view = None
## Get the path to the component QML file as QUrl
def getComponentPath(self):
try:
sidebar_component_file_path = PluginRegistry.getInstance().getMetaData(self.getPluginId())["sidebar_view"]["sidebar_component"]
return QUrl.fromLocalFile(sidebar_component_file_path)
except KeyError:
Logger.log("w", "Could not find sidebar component QML file for %s", self.getPluginId())
return QUrl()