mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
CURA-5035 Small changes
This commit is contained in:
parent
f0c36f8471
commit
15b8d18da8
5 changed files with 26 additions and 9 deletions
|
@ -49,12 +49,12 @@ Window
|
|||
ToolboxDownloadsPage
|
||||
{
|
||||
id: viewDownloads
|
||||
visible: dataReady && manager.currentView != "installed" && manager.detailView == ""
|
||||
visible: manager.currentView != "installed" && !manager.detailView
|
||||
}
|
||||
ToolboxDetailsPage
|
||||
{
|
||||
id: viewDetail
|
||||
visible: dataReady && manager.currentView != "installed" && manager.detailView != ""
|
||||
visible: manager.currentView != "installed" && manager.detailView
|
||||
}
|
||||
ToolboxInstalledPage
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ Item
|
|||
}
|
||||
width: UM.Theme.getSize("base_unit").width * 4
|
||||
height: UM.Theme.getSize("base_unit").height * 2
|
||||
onClicked: manager.detailView = ""
|
||||
onClicked: manager.detailView = false
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
|
|
|
@ -63,7 +63,8 @@ Item
|
|||
anchors.fill: parent
|
||||
onClicked: {
|
||||
console.log(model.id)
|
||||
manager.detailView = model.id
|
||||
manager.detailView = true
|
||||
manager.setDetailData(model.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ Rectangle {
|
|||
{
|
||||
manager.filterPackagesByType("plugin")
|
||||
manager.currentView = "plugins"
|
||||
manager.detailView = ""
|
||||
manager.detailView = false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ Rectangle {
|
|||
{
|
||||
manager.filterPackagesByType("material")
|
||||
manager.currentView = "materials"
|
||||
manager.detailView = ""
|
||||
manager.detailView = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,8 @@ class Toolbox(QObject, Extension):
|
|||
|
||||
# Nowadays can be 'plugins', 'materials' or 'installed'
|
||||
self._current_view = "plugins"
|
||||
self._detail_view = ""
|
||||
self._detail_view = False
|
||||
self._detail_data = {}
|
||||
|
||||
self._restart_required = False
|
||||
|
||||
|
@ -297,14 +298,29 @@ class Toolbox(QObject, Extension):
|
|||
def currentView(self):
|
||||
return self._current_view
|
||||
|
||||
def setDetailView(self, detail_view = ""):
|
||||
self._detail_view = detail_view
|
||||
def setDetailView(self, bool = False):
|
||||
self._detail_view = bool
|
||||
self.detailViewChanged.emit()
|
||||
|
||||
@pyqtProperty(str, fset = setDetailView, notify = detailViewChanged)
|
||||
def detailView(self):
|
||||
return self._detail_view
|
||||
|
||||
# Set the detail data given a plugin ID:
|
||||
@pyqtSlot(str)
|
||||
def setDetailData(self, id):
|
||||
if not self._packages_model:
|
||||
return
|
||||
for plugin in self._plugins_model.items:
|
||||
if plugin.id is id:
|
||||
print(plugin)
|
||||
self._detail_view = plugin
|
||||
self.detailViewChanged.emit()
|
||||
|
||||
@pyqtProperty(QObject, notify = detailViewChanged)
|
||||
def detailData(self):
|
||||
return self._detail_data
|
||||
|
||||
@pyqtProperty(QObject, notify = packagesMetadataChanged)
|
||||
def pluginsModel(self):
|
||||
self._plugins_model = PluginsModel(None, self._current_view)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue