From fccfff14bcd230148981cbc25879e1356128f0f6 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 15 May 2018 09:44:58 +0200 Subject: [PATCH 1/5] Now using api.ultimaker.com instead of api-staging.ultimaker.com --- plugins/Toolbox/src/Toolbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 3ee6787cf4..2ba91dcdba 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -34,7 +34,7 @@ class Toolbox(QObject, Extension): self._plugin_registry = Application.getInstance().getPluginRegistry() self._packages_version = self._getPackagesVersion() self._api_version = 1 - self._api_url = "https://api-staging.ultimaker.com/cura-packages/v{api_version}/cura/v{package_version}".format( api_version = self._api_version, package_version = self._packages_version) + self._api_url = "https://api.ultimaker.com/cura-packages/v{api_version}/cura/v{package_version}".format( api_version = self._api_version, package_version = self._packages_version) # Network: self._get_packages_request = None From 0a9f38939659e584cfa79f14a32cf3582d203eee Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 May 2018 11:13:59 +0200 Subject: [PATCH 2/5] Search for bundled packages file in all search paths For this we need to rename bundled_packages to disambiguate between that and the other packages.json file for user-installed packages. Contributes to issue CURA-5364. --- cura/CuraApplication.py | 1 - cura/CuraPackageManager.py | 17 ++++++++--------- .../{packages.json => bundled_packages.json} | 0 3 files changed, 8 insertions(+), 10 deletions(-) rename resources/{packages.json => bundled_packages.json} (100%) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index c8e49b186d..80390c907f 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -153,7 +153,6 @@ class CuraApplication(QtApplication): if not hasattr(sys, "frozen"): resource_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources") Resources.addSearchPath(resource_path) - Resources.setBundledResourcesPath(resource_path) self._use_gui = True self._open_file_queue = [] # Files to open when plug-ins are loaded. diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 2b91081e4d..69378ffade 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -28,15 +28,14 @@ class CuraPackageManager(QObject): self._container_registry = self._application.getContainerRegistry() self._plugin_registry = self._application.getPluginRegistry() - # JSON file that keeps track of all installed packages. - self._bundled_package_management_file_path = os.path.join( - os.path.abspath(Resources.getBundledResourcesPath()), - "packages.json" - ) - self._user_package_management_file_path = os.path.join( - os.path.abspath(Resources.getDataStoragePath()), - "packages.json" - ) + #JSON files that keep track of all installed packages. + for search_path in Resources.getSearchPaths(): + candidate_bundled_path = os.path.join(search_path, "bundled_packages.json") + if os.path.exists(candidate_bundled_path): + self._bundled_package_management_file_path = candidate_bundled_path + candidate_user_path = os.path.join(search_path, "packages.json") + if os.path.exists(candidate_user_path): + self._user_package_management_file_path = candidate_user_path self._bundled_package_dict = {} # A dict of all bundled packages self._installed_package_dict = {} # A dict of all installed packages diff --git a/resources/packages.json b/resources/bundled_packages.json similarity index 100% rename from resources/packages.json rename to resources/bundled_packages.json From 0aa1aaf11b273534a50c8c6778068b75e6663593 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 May 2018 11:23:26 +0200 Subject: [PATCH 3/5] Fix loading packages.json when file doesn't exist yet Contributes to issue CURA-5364. --- cura/CuraPackageManager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 69378ffade..c765587eef 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -29,6 +29,8 @@ class CuraPackageManager(QObject): self._plugin_registry = self._application.getPluginRegistry() #JSON files that keep track of all installed packages. + self._user_package_management_file_path = None + self._bundled_package_management_file_path = None for search_path in Resources.getSearchPaths(): candidate_bundled_path = os.path.join(search_path, "bundled_packages.json") if os.path.exists(candidate_bundled_path): @@ -36,6 +38,8 @@ class CuraPackageManager(QObject): candidate_user_path = os.path.join(search_path, "packages.json") if os.path.exists(candidate_user_path): self._user_package_management_file_path = candidate_user_path + if self._user_package_management_file_path is None: #Doesn't exist yet. + self._user_package_management_file_path = os.path.join(Resources.getDataStoragePath(), "packages.json") self._bundled_package_dict = {} # A dict of all bundled packages self._installed_package_dict = {} # A dict of all installed packages From 8707d12bf308f83a18234a8b5856715a73df5ca4 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 15 May 2018 11:25:56 +0200 Subject: [PATCH 4/5] Show package version in installed tab --- plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index 6004832a57..b585a084b3 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -90,6 +90,16 @@ Item color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") linkColor: UM.Theme.getColor("text_link") } + + Label + { + text: model.version + width: parent.width + height: UM.Theme.getSize("toolbox_property_label").height + color: UM.Theme.getColor("text") + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + } } ToolboxInstalledTileActions { From ed1ba41aa6d0cf03a3d563035135e0f0e6eb949b Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 15 May 2018 11:42:17 +0200 Subject: [PATCH 5/5] Undo setting wrong name in PrintInformation. CURA-5323 --- cura/PrintInformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index a59f235741..01d0b43f5b 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -346,7 +346,7 @@ class PrintInformation(QObject): Logger.log("w", "Unsupported Mime Type Database file extension") if data is not None and check_name is not None: - self._base_name = check_name + self._base_name = data else: self._base_name = ''