mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Get default settings view to work as sidebar component
This commit is contained in:
parent
5eeb98bbcf
commit
3c863fc388
8 changed files with 138 additions and 49 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue