diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index a2415478a4..12828971cd 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -294,6 +294,7 @@ class CuraApplication(QtApplication): # \sa PluginRegistery def _loadPlugins(self): self._plugin_registry.addType("profile_reader", self._addProfileReader) + self._plugin_registry.addType("profile_writer", self._addProfileWriter) self._plugin_registry.addPluginLocation(os.path.join(QtApplication.getInstallPrefix(), "lib", "cura")) if not hasattr(sys, "frozen"): self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "plugins")) @@ -788,3 +789,6 @@ class CuraApplication(QtApplication): def _addProfileReader(self, profile_reader): # TODO: Add the profile reader to the list of plug-ins that can be used when importing profiles. pass + + def _addProfileWriter(self, profile_writer): + pass diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py index 1d27649498..c9b4e60046 100644 --- a/plugins/CuraProfileReader/CuraProfileReader.py +++ b/plugins/CuraProfileReader/CuraProfileReader.py @@ -3,7 +3,6 @@ from UM.Application import Application #To get the machine manager to create the new profile in. from UM.Logger import Logger -from UM.Settings.Profile import Profile from UM.Settings.ProfileReader import ProfileReader diff --git a/plugins/CuraProfileReader/__init__.py b/plugins/CuraProfileReader/__init__.py index bfaa16ed5e..c4206ab763 100644 --- a/plugins/CuraProfileReader/__init__.py +++ b/plugins/CuraProfileReader/__init__.py @@ -13,7 +13,7 @@ def getMetaData(): "author": "Ultimaker", "version": "1.0", "description": catalog.i18nc("@info:whatsthis", "Provides support for importing Cura profiles."), - "api": 2 + "api": 3 }, "profile_reader": [ { diff --git a/plugins/CuraProfileWriter/CuraProfileWriter.py b/plugins/CuraProfileWriter/CuraProfileWriter.py index 82df446b8a..c6c4244948 100644 --- a/plugins/CuraProfileWriter/CuraProfileWriter.py +++ b/plugins/CuraProfileWriter/CuraProfileWriter.py @@ -16,10 +16,10 @@ class CuraProfileWriter(ProfileWriter): # \return \code True \endcode if the writing was successful, or \code # False \endcode if it wasn't. def write(self, path, profile): - serialised = profile.serialise() + serialized = profile.serialize() try: with SaveFile(path, "wt", -1, "utf-8") as f: # Open the specified file. - f.write(serialised) + f.write(serialized) except Exception as e: Logger.log("e", "Failed to write profile to %s: %s", path, str(e)) return False diff --git a/plugins/CuraProfileWriter/__init__.py b/plugins/CuraProfileWriter/__init__.py index 43890de469..30528b8167 100644 --- a/plugins/CuraProfileWriter/__init__.py +++ b/plugins/CuraProfileWriter/__init__.py @@ -13,7 +13,7 @@ def getMetaData(): "author": "Ultimaker", "version": "1.0", "description": catalog.i18nc("@info:whatsthis", "Provides support for exporting Cura profiles."), - "api": 2 + "api": 3 }, "profile_writer": [ { diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 2030ced505..b382065a7e 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -299,7 +299,7 @@ UM.ManagementPage folder: base.model.getDefaultPath() onAccepted: { - var result = base.model.exportProfile(base.currentItem.id, fileUrl) + var result = base.model.exportProfile(base.currentItem.id, fileUrl, selectedNameFilter) if(result && result.status == "error") { messageDialog.icon = StandardIcon.Critical