Fix style in some components

This commit is contained in:
Diego Prado Gesto 2018-07-05 14:35:12 +02:00
parent ab339e7784
commit c738f306fb
5 changed files with 30 additions and 5 deletions

View file

@ -224,6 +224,11 @@ class Toolbox(QObject, Extension):
if not self._dialog:
self._dialog = self._createDialog("Toolbox.qml")
if not self._dialog:
Logger.log("e", "Unexpected error trying to create the 'Toolbox' dialog.")
return
self._dialog.show()
# Apply enabled/disabled state to installed plugins
@ -231,7 +236,10 @@ class Toolbox(QObject, Extension):
def _createDialog(self, qml_name: str) -> Optional[QObject]:
Logger.log("d", "Toolbox: Creating dialog [%s].", qml_name)
path = os.path.join(PluginRegistry.getInstance().getPluginPath(self.getPluginId()), "resources", "qml", qml_name)
plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId())
if not plugin_path:
return None
path = os.path.join(plugin_path, "resources", "qml", qml_name)
dialog = self._application.createQmlComponent(path, {"toolbox": self})
return dialog