diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index d0a165138e..5f45d5770d 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -14,7 +14,7 @@ import UM 1.1 as UM Window { id: base - title: catalog.i18nc("@title:tab", "Toolbox"); + title: catalog.i18nc("@title:tab", "Toolbox") modality: Qt.ApplicationModal width: 720 * screenScaleFactor height: 640 * screenScaleFactor @@ -73,10 +73,14 @@ Window ToolboxFooter { id: footer + visible: toolbox.restartRequired + height: toolbox.restartRequired ? UM.Theme.getSize("base_unit").height * 5 : 0 } ToolboxShadow { - anchors.top: footer.top + visible: toolbox.restartRequired + anchors.bottom: footer.top + reversed: true } UM.I18nCatalog { id: catalog; name: "cura" } diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 4236a282e1..d30ec8845c 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -74,13 +74,7 @@ Item width: childrenRect.width Label { - text: "Version:" - font: UM.Theme.getFont("very_small") - color: UM.Theme.getColor("text_medium") - } - Label - { - text: "Author:" + text: catalog.i18nc("@label", "Contact") + ":" font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text_medium") } @@ -99,15 +93,21 @@ Item width: UM.Theme.getSize("base_unit").width * 12 Label { - text: details.name - font: UM.Theme.getFont("very_small") - color: UM.Theme.getColor("text") - } - Label - { - text: details.name + text: + { + if (details.email) + { + return ""+details.name+"" + } + else + { + console.log(""+details.author_name+"") + return ""+details.name+"" + } + } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") + onLinkActivated: Qt.openUrlExternally(link) } } Rectangle diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index f0982cdf80..62a6db41d2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -74,19 +74,19 @@ Item width: childrenRect.width Label { - text: "Version:" + text: catalog.i18nc("@label", "Version") + ":" font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text_medium") } Label { - text: "Last Update:" + text: catalog.i18nc("@label", "Last updated") + ":" font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text_medium") } Label { - text: "Author:" + text: catalog.i18nc("@label", "Author") + ":" font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text_medium") } @@ -117,9 +117,20 @@ Item } Label { - text: details.author_name + text: + { + if (details.author_email) + { + return ""+details.author_name+"" + } + else + { + return ""+details.author_name+"" + } + } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") + onLinkActivated: Qt.openUrlExternally(link) } } Rectangle diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index c12b1cfa31..bb19f9b8a1 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -34,7 +34,21 @@ Rectangle Label { width: parent.width - text: model.description + text: + { + if (model.description.length > 235) + { + if (model.description.substring(234, 235) == " ") + { + return model.description.substring(0, 234) + "..." + } + else + { + return model.description.substring(0, 235) + "..." + } + } + return model.description + } wrapMode: Text.WordWrap color: UM.Theme.getColor("text") font: UM.Theme.getFont("default") diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 6c5907a9bd..3e815e8990 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -58,7 +58,8 @@ Item Label { id: info - text: { + text: + { if (model.description.length > 50) { return model.description.substring(0, 50) + "..." diff --git a/plugins/Toolbox/resources/qml/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/ToolboxFooter.qml index cebf501762..58b1d959df 100644 --- a/plugins/Toolbox/resources/qml/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/ToolboxFooter.qml @@ -14,7 +14,6 @@ import UM 1.1 as UM Item { width: parent.width - height: UM.Theme.getSize("base_unit").height * 4 anchors.bottom: parent.bottom Label { diff --git a/plugins/Toolbox/resources/qml/ToolboxShadow.qml b/plugins/Toolbox/resources/qml/ToolboxShadow.qml index f22e3b5cc3..0f2f98beb9 100644 --- a/plugins/Toolbox/resources/qml/ToolboxShadow.qml +++ b/plugins/Toolbox/resources/qml/ToolboxShadow.qml @@ -5,18 +5,19 @@ import QtQuick 2.2 Rectangle { + property bool reversed: false width: parent.width height: 8 gradient: Gradient { GradientStop { - position: 0.0 - color: Qt.rgba(0,0,0,0.2) + position: reversed ? 1.0 : 0.0 + color: reversed ? Qt.rgba(0,0,0,0.05) : Qt.rgba(0,0,0,0.2) } GradientStop { - position: 1.0 + position: reversed ? 0.0 : 1.0 color: Qt.rgba(0,0,0,0) } } diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py index 6b75126084..b85980bd8d 100644 --- a/plugins/Toolbox/src/AuthorsModel.py +++ b/plugins/Toolbox/src/AuthorsModel.py @@ -36,7 +36,7 @@ class AuthorsModel(ListModel): items.append({ "name": author["name"], "email": author["email"] if "email" in author else None, - "website": author["website"] if "website" in author else None, + "website": author["website"], "type": author["type"] if "type" in author else None, "icon_url": author["icon_url"] if "icon_url" in author else None, "packages_count": author["packages_count"] if "packages_count" in author else 0 diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 87edef4af2..bc2b930ff9 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -129,7 +129,6 @@ class Toolbox(QObject, Extension): self._active_package = None self._dialog = None - self._restartDialog = None self._restart_required = False # variables for the license agreement dialog @@ -158,7 +157,6 @@ class Toolbox(QObject, Extension): filterChanged = pyqtSignal() metadataChanged = pyqtSignal() showLicenseDialog = pyqtSignal() - showRestartDialog = pyqtSignal() @pyqtSlot(result = str) def getLicenseDialogPluginName(self): @@ -172,20 +170,12 @@ class Toolbox(QObject, Extension): def getLicenseDialogLicenseContent(self): return self._license_dialog_license_content - @pyqtSlot(result = str) - def getRestartDialogMessage(self): - return self._restart_dialog_message - def openLicenseDialog(self, plugin_name, license_content, plugin_file_location): self._license_dialog_plugin_name = plugin_name self._license_dialog_license_content = license_content self._license_dialog_plugin_file_location = plugin_file_location self.showLicenseDialog.emit() - def openRestartDialog(self, message): - self._restart_dialog_message = message - self.showRestartDialog.emit() - def _onAppInitialized(self): self._package_manager = Application.getInstance().getCuraPackageManager() @@ -250,12 +240,16 @@ class Toolbox(QObject, Extension): self._plugin_registry.enablePlugin(plugin_id) self.enabledChanged.emit() Logger.log("i", "%s was set as 'active'.", plugin_id) + self._restart_required = True + self.restartRequiredChanged.emit() @pyqtSlot(str) def disable(self, plugin_id): self._plugin_registry.disablePlugin(plugin_id) self.enabledChanged.emit() Logger.log("i", "%s was set as 'deactive'.", plugin_id) + self._restart_required = True + self.restartRequiredChanged.emit() @pyqtProperty(bool, notify = metadataChanged) def dataReady(self):