CURA-5442 Final fixes

This commit is contained in:
Ian Paschal 2018-06-04 17:00:59 +02:00
parent 096f0775a8
commit 71f41b8ada
3 changed files with 302 additions and 2 deletions

View file

@ -34,6 +34,7 @@ Column
// Don't allow installing while another download is running // Don't allow installing while another download is running
enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model)
opacity: enabled ? 1.0 : 0.5 opacity: enabled ? 1.0 : 0.5
visible: !updateButton.visible // Don't show when the update button is visible
} }
ToolboxProgressButton ToolboxProgressButton
@ -55,7 +56,7 @@ Column
// Don't allow installing while another download is running // Don't allow installing while another download is running
enabled: !(toolbox.isDownloading && toolbox.activePackage != model) enabled: !(toolbox.isDownloading && toolbox.activePackage != model)
opacity: enabled ? 1.0 : 0.5 opacity: enabled ? 1.0 : 0.5
visible: installed && canUpdate visible: canUpdate
} }
Connections Connections
{ {

View file

@ -238,6 +238,23 @@ class Toolbox(QObject, Extension):
dialog = Application.getInstance().createQmlComponent(path, {"toolbox": self}) dialog = Application.getInstance().createQmlComponent(path, {"toolbox": self})
return dialog return dialog
def _convertPluginMetadata(self, plugin: dict) -> dict:
formatted = {
"package_id": plugin["id"],
"package_type": "plugin",
"display_name": plugin["plugin"]["name"],
"package_version": plugin["plugin"]["version"],
"sdk_version": plugin["plugin"]["api"],
"author": {
"author_id": plugin["plugin"]["author"],
"display_name": plugin["plugin"]["author"]
},
"is_installed": True,
"description": plugin["plugin"]["description"]
}
return formatted
@pyqtSlot() @pyqtSlot()
def _updateInstalledModels(self) -> None: def _updateInstalledModels(self) -> None:
@ -245,19 +262,28 @@ class Toolbox(QObject, Extension):
# list of old plugins # list of old plugins
old_plugin_ids = self._plugin_registry.getInstalledPlugins() old_plugin_ids = self._plugin_registry.getInstalledPlugins()
installed_package_ids = self._package_manager.getAllInstalledPackageIDs() installed_package_ids = self._package_manager.getAllInstalledPackageIDs()
self._old_plugin_ids = [] self._old_plugin_ids = []
self._old_plugin_metadata = []
for plugin_id in old_plugin_ids: for plugin_id in old_plugin_ids:
if plugin_id not in installed_package_ids: if plugin_id not in installed_package_ids:
Logger.log('i', 'Found a plugin that was installed with the old plugin browser: %s', plugin_id) Logger.log('i', 'Found a plugin that was installed with the old plugin browser: %s', plugin_id)
old_metadata = self._plugin_registry.getMetaData(plugin_id)
new_metadata = self._convertPluginMetadata(old_metadata)
self._old_plugin_ids.append(plugin_id) self._old_plugin_ids.append(plugin_id)
self._old_plugin_metadata.append(new_metadata)
all_packages = self._package_manager.getAllInstalledPackagesInfo() all_packages = self._package_manager.getAllInstalledPackagesInfo()
if "plugin" in all_packages: if "plugin" in all_packages:
self._metadata["plugins_installed"] = all_packages["plugin"] self._metadata["plugins_installed"] = all_packages["plugin"] + self._old_plugin_metadata
self._models["plugins_installed"].setMetadata(self._metadata["plugins_installed"]) self._models["plugins_installed"].setMetadata(self._metadata["plugins_installed"])
self.metadataChanged.emit() self.metadataChanged.emit()
if "material" in all_packages: if "material" in all_packages:
self._metadata["materials_installed"] = all_packages["material"] self._metadata["materials_installed"] = all_packages["material"]
# TODO: ADD MATERIALS HERE ONCE MATERIALS PORTION OF TOOLBOX IS LIVE
self._models["materials_installed"].setMetadata(self._metadata["materials_installed"]) self._models["materials_installed"].setMetadata(self._metadata["materials_installed"])
self.metadataChanged.emit() self.metadataChanged.emit()
@ -383,6 +409,7 @@ class Toolbox(QObject, Extension):
return False return False
# Check for plugins that were installed with the old plugin browser # Check for plugins that were installed with the old plugin browser
@pyqtSlot(str, result = bool)
def isOldPlugin(self, plugin_id: str) -> bool: def isOldPlugin(self, plugin_id: str) -> bool:
if plugin_id in self._old_plugin_ids: if plugin_id in self._old_plugin_ids:
return True return True

View file

@ -1132,5 +1132,277 @@
"website": "https://www.vellemanprojects.eu" "website": "https://www.vellemanprojects.eu"
} }
} }
},
"ConsoleLogger": {
"package_info": {
"package_id": "ConsoleLogger",
"package_type": "plugin",
"display_name": "Console Logger",
"description": "Outputs log information to the console.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"OBJReader": {
"package_info": {
"package_id": "OBJReader",
"package_type": "plugin",
"display_name": "Wavefront OBJ Reader",
"description": "Makes it possible to read Wavefront OBJ files.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"OBJWriter": {
"package_info": {
"package_id": "OBJWriter",
"package_type": "plugin",
"display_name": "Wavefront OBJ Writer",
"description": "Makes it possible to write Wavefront OBJ files.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"STLReader": {
"package_info": {
"package_id": "STLReader",
"package_type": "plugin",
"display_name": "STL Reader",
"description": "Provides support for reading STL files.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"STLWriter": {
"package_info": {
"package_id": "STLWriter",
"package_type": "plugin",
"display_name": "STL Writer",
"description": "Provides support for writing STL files.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"FileLogger": {
"package_info": {
"package_id": "FileLogger",
"package_type": "plugin",
"display_name": "File Logger",
"description": "Outputs log information to a file in your settings folder.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"LocalContainerProvider": {
"package_info": {
"package_id": "LocalContainerProvider",
"package_type": "plugin",
"display_name": "Local Container Provider",
"description": "Provides built-in setting containers that come with the installation of the application.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"LocalFileOutputDevice": {
"package_info": {
"package_id": "LocalFileOutputDevice",
"package_type": "plugin",
"display_name": "Local File Output Device",
"description": "Enables saving to local files.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"CameraTool": {
"package_info": {
"package_id": "CameraTool",
"package_type": "plugin",
"display_name": "Camera Tool",
"description": "Provides the tool to manipulate the camera.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"MirrorTool": {
"package_info": {
"package_id": "MirrorTool",
"package_type": "plugin",
"display_name": "Mirror Tool",
"description": "Provides the Mirror tool.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"RotateTool": {
"package_info": {
"package_id": "RotateTool",
"package_type": "plugin",
"display_name": "Rotate Tool",
"description": "Provides the Rotate tool.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"ScaleTool": {
"package_info": {
"package_id": "ScaleTool",
"package_type": "plugin",
"display_name": "Scale Tool",
"description": "Provides the Scale tool.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"SelectionTool": {
"package_info": {
"package_id": "SelectionTool",
"package_type": "plugin",
"display_name": "Selection Tool",
"description": "Provides the Selection tool.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"TranslateTool": {
"package_info": {
"package_id": "TranslateTool",
"package_type": "plugin",
"display_name": "Move Tool",
"description": "Provides the Move tool.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"UpdateChecker": {
"package_info": {
"package_id": "UpdateChecker",
"package_type": "plugin",
"display_name": "Update Checker",
"description": "Checks for updates of the software.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
},
"SimpleView": {
"package_info": {
"package_id": "SimpleView",
"package_type": "plugin",
"display_name": "Simple View",
"description": "Provides a simple solid mesh view.",
"package_version": "1.0.0",
"sdk_version": 4,
"website": "https://ultimaker.com",
"author": {
"author_id": "Ultimaker",
"display_name": "Ultimaker B.V.",
"email": "plugins@ultimaker.com",
"website": "https://ultimaker.com"
}
}
} }
} }