Browse Source

Add dummy details for when there is no selection

CURA-5521
Lipu Fei 6 years ago
parent
commit
2e3528d9b2

+ 10 - 1
plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml

@@ -9,8 +9,17 @@ import UM 1.1 as UM
 Item
 Item
 {
 {
     id: page
     id: page
-    property var details: base.selection || {}
+    property var details: base.selection || dummy_details
     anchors.fill: parent
     anchors.fill: parent
+
+    property var dummy_details: new Object({
+        name: "",
+        description: "",
+        email: "",
+        website: "",
+        icon_url: ""
+    })
+
     ToolboxBackColumn
     ToolboxBackColumn
     {
     {
         id: sidebar
         id: sidebar

+ 13 - 1
plugins/Toolbox/resources/qml/ToolboxDetailPage.qml

@@ -9,9 +9,21 @@ import UM 1.1 as UM
 Item
 Item
 {
 {
     id: page
     id: page
-    property var details: base.selection
+    property var details: base.selection || dummy_details
     anchors.fill: parent
     anchors.fill: parent
     width: parent.width
     width: parent.width
+
+    property var dummy_details: new Object({
+        name: '',
+        version: '',
+        last_updated: '',
+        author_email: '',
+        author_name: '',
+        website: '',
+        icon_url: '',
+        download_count: ''
+    })
+
     ToolboxBackColumn
     ToolboxBackColumn
     {
     {
         id: sidebar
         id: sidebar