mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 08:35:09 +08:00
Directly use bindings in banner pages
CURA-8564
This commit is contained in:
parent
815aadb0d7
commit
7e1247b171
@ -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()
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user