diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6cf2593bbf..21924a2680 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -2015,33 +2015,6 @@ class CuraApplication(QtApplication): show_whatsnew_only = has_active_machine and has_app_just_upgraded return show_whatsnew_only - @pyqtSlot(result = bool) - def shouldShowMarketPlacePluginBanner(self) -> bool: - return self._preferences.getValue("cura/market_place_show_plugin_banner") - - @pyqtSlot(result = bool) - def shouldShowMarketPlaceMaterialBanner(self) -> bool: - return self._preferences.getValue("cura/market_place_show_material_banner") - - @pyqtSlot(result = bool) - def shouldShowMarketPlaceManagePackagesBanner(self) -> bool: - return self._preferences.getValue("cura/market_place_show_manage_packages_banner") - - @pyqtSlot() - def closeMarketPlacePluginBanner(self) -> None: - Logger.log("i", "Close market place plugin banner") - self._preferences.setValue("cura/market_place_show_plugin_banner", False) - - @pyqtSlot() - def closeMarketPlaceMaterialBanner(self) -> None: - Logger.log("i", "Close market place material banner") - self._preferences.setValue("cura/market_place_show_material_banner", False) - - @pyqtSlot() - def closeMarketPlaceManagePackagesBanner(self) -> None: - Logger.log("i", "Close market place manage packages banner") - self._preferences.setValue("cura/market_place_show_manage_packages_banner", False) - @pyqtSlot(result = int) def appWidth(self) -> int: main_window = QtApplication.getInstance().getMainWindow() diff --git a/plugins/Marketplace/resources/qml/ManagedPackages.qml b/plugins/Marketplace/resources/qml/ManagedPackages.qml index e8e54d77b5..677a9ee574 100644 --- a/plugins/Marketplace/resources/qml/ManagedPackages.qml +++ b/plugins/Marketplace/resources/qml/ManagedPackages.qml @@ -11,12 +11,12 @@ Packages { pageTitle: catalog.i18nc("@header", "Manage packages") - bannerVisible: CuraApplication.shouldShowMarketPlaceManagePackagesBanner() + bannerVisible: UM.Preferences.getValue("cura/market_place_show_manage_packages_banner"); bannerIcon: "ArrowDoubleCircleRight" bannerBody: catalog.i18nc("@text", "Manage your Ultimaker Cura plugins and material profiles here. Make sure to keep your plugins up to date and backup your setup regularly.") readMoreUrl: "" // TODO add when support page is ready onRemoveBanner: function() { - CuraApplication.closeMarketPlaceManagePackagesBanner(); + UM.Preferences.setValue("cura/market_place_show_manage_packages_banner", false); bannerVisible = false; } diff --git a/plugins/Marketplace/resources/qml/Materials.qml b/plugins/Marketplace/resources/qml/Materials.qml index fc4869dac5..e4cd554334 100644 --- a/plugins/Marketplace/resources/qml/Materials.qml +++ b/plugins/Marketplace/resources/qml/Materials.qml @@ -2,17 +2,18 @@ // Cura is released under the terms of the LGPLv3 or higher. import Marketplace 1.0 as Marketplace +import UM 1.4 as UM Packages { pageTitle: catalog.i18nc("@header", "Install Materials") - bannerVisible: CuraApplication.shouldShowMarketPlaceMaterialBanner() + bannerVisible: UM.Preferences.getValue("cura/market_place_show_material_banner") bannerIcon: "Spool" bannerBody: catalog.i18nc("@text", "Streamline your workflow and customize your Ultimaker Cura experience with plugins contributed by our amazing community of users.") readMoreUrl: "" // TODO add when support page is ready onRemoveBanner: function() { - CuraApplication.closeMarketPlaceMaterialBanner(); + UM.Preferences.setValue("cura/market_place_show_material_banner", false); bannerVisible = false; } diff --git a/plugins/Marketplace/resources/qml/Plugins.qml b/plugins/Marketplace/resources/qml/Plugins.qml index f0c101153c..11aabedb85 100644 --- a/plugins/Marketplace/resources/qml/Plugins.qml +++ b/plugins/Marketplace/resources/qml/Plugins.qml @@ -2,17 +2,18 @@ // Cura is released under the terms of the LGPLv3 or higher. import Marketplace 1.0 as Marketplace +import UM 1.4 as UM Packages { pageTitle: catalog.i18nc("@header", "Install Plugins") - bannerVisible: CuraApplication.shouldShowMarketPlacePluginBanner() + bannerVisible: UM.Preferences.getValue("cura/market_place_show_plugin_banner") bannerIcon: "Shop" bannerBody: catalog.i18nc("@text", "Select and install material profiles optimised for your Ultimaker 3D printers.") readMoreUrl: "" // TODO add when support page is ready onRemoveBanner: function() { - CuraApplication.closeMarketPlacePluginBanner(); + UM.Preferences.setValue("cura/market_place_show_plugin_banner", false) bannerVisible = false; }