AddPrinterPagesModel.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (c) 2019 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from .WelcomePagesModel import WelcomePagesModel
  4. #
  5. # This Qt ListModel is more or less the same the WelcomePagesModel, except that this model is only for adding a printer,
  6. # so only the steps for adding a printer is included.
  7. #
  8. class AddPrinterPagesModel(WelcomePagesModel):
  9. def initialize(self, cancellable: bool = True) -> None:
  10. self._pages.append({"id": "add_network_or_local_printer",
  11. "page_url": self._getBuiltinWelcomePagePath("AddUltimakerOrThirdPartyPrinterStack.qml"),
  12. "next_page_id": "machine_actions",
  13. "next_page_button_text": self._catalog.i18nc("@action:button", "Add"),
  14. })
  15. self._pages.append({"id": "add_printer_by_ip",
  16. "page_url": self._getBuiltinWelcomePagePath("AddPrinterByIpContent.qml"),
  17. "next_page_id": "machine_actions",
  18. })
  19. self._pages.append({"id": "add_cloud_printers",
  20. "page_url": self._getBuiltinWelcomePagePath("AddCloudPrintersView.qml"),
  21. "is_final_page": True,
  22. "next_page_button_text": self._catalog.i18nc("@action:button", "Finish"),
  23. })
  24. self._pages.append({"id": "machine_actions",
  25. "page_url": self._getBuiltinWelcomePagePath("FirstStartMachineActionsContent.qml"),
  26. "should_show_function": self.shouldShowMachineActions,
  27. })
  28. if cancellable:
  29. self._pages[0]["previous_page_button_text"] = self._catalog.i18nc("@action:button", "Cancel")
  30. self.setItems(self._pages)
  31. __all__ = ["AddPrinterPagesModel"]