From 7b464e5550b08d3e88da417ae638f00ca38c4bb4 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Mon, 20 Apr 2020 15:06:31 +0200 Subject: [PATCH] Close welcome wizard when user has cloud printers If the user signs in during the welcome process, if he/she has cloud printers connected to his/her account, then the welcome wizard will close so that the user will not be asked to add local printers. CURA-7019 --- .../src/Cloud/CloudOutputDeviceManager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index ccc64f8073..61506693a9 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -88,6 +88,14 @@ class CloudOutputDeviceManager: ## Callback for when the request for getting the clusters is finished. def _onGetRemoteClustersFinished(self, clusters: List[CloudClusterResponse]) -> None: online_clusters = {c.cluster_id: c for c in clusters if c.is_online} # type: Dict[str, CloudClusterResponse] + + # If the user signs in from the welcome dialog, then we will search for cloud printers and if any of them are + # found, the welcome screen will close. This way we avoid prompting the user to add printers if he/she already + # has cloud printers + welcome_pages_model = CuraApplication.getInstance().getWelcomePagesModel() + cloud_page_idx = welcome_pages_model.getPageIndexById("cloud") + if welcome_pages_model.currentPageIndex == cloud_page_idx and online_clusters: + CuraApplication.getWelcomePagesModel().atEnd() for device_id, cluster_data in online_clusters.items(): if device_id not in self._remote_clusters: self._onDeviceDiscovered(cluster_data)