mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 11:56:05 +08:00
Merge branch 'WIP_onboarding' of github.com:Ultimaker/Cura into WIP_onboarding
This commit is contained in:
commit
b4134e6dbb
@ -76,6 +76,12 @@ class WelcomePagesModel(ListModel):
|
|||||||
self._current_page_index = page_index
|
self._current_page_index = page_index
|
||||||
self.currentPageIndexChanged.emit()
|
self.currentPageIndexChanged.emit()
|
||||||
|
|
||||||
|
# Ends the Welcome-Pages. Put as a separate function for cases like the 'decline' in the User-Agreement.
|
||||||
|
@pyqtSlot()
|
||||||
|
def atEnd(self) -> None:
|
||||||
|
self.allFinished.emit()
|
||||||
|
self.resetState()
|
||||||
|
|
||||||
# Goes to the next page.
|
# Goes to the next page.
|
||||||
# If "from_index" is given, it will look for the next page to show starting from the "from_index" page instead of
|
# If "from_index" is given, it will look for the next page to show starting from the "from_index" page instead of
|
||||||
# the "self._current_page_index".
|
# the "self._current_page_index".
|
||||||
@ -100,8 +106,7 @@ class WelcomePagesModel(ListModel):
|
|||||||
|
|
||||||
# If we have reached the last page, emit allFinished signal and reset.
|
# If we have reached the last page, emit allFinished signal and reset.
|
||||||
if next_page_index == len(self._items):
|
if next_page_index == len(self._items):
|
||||||
self.allFinished.emit()
|
self.atEnd()
|
||||||
self.resetState()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check if the this page should be shown (default yes), if not, keep looking for the next one.
|
# Check if the this page should be shown (default yes), if not, keep looking for the next one.
|
||||||
|
@ -48,20 +48,6 @@ class SliceInfo(QObject, Extension):
|
|||||||
def _onAppInitialized(self):
|
def _onAppInitialized(self):
|
||||||
# DO NOT read any preferences values in the constructor because at the time plugins are created, no version
|
# DO NOT read any preferences values in the constructor because at the time plugins are created, no version
|
||||||
# upgrade has been performed yet because version upgrades are plugins too!
|
# upgrade has been performed yet because version upgrades are plugins too!
|
||||||
if not self._application.getPreferences().getValue("info/asked_send_slice_info"):
|
|
||||||
self.send_slice_info_message = Message(catalog.i18nc("@info", "Cura collects anonymized usage statistics."),
|
|
||||||
lifetime = 0,
|
|
||||||
dismissable = False,
|
|
||||||
title = catalog.i18nc("@info:title", "Collecting Data"))
|
|
||||||
|
|
||||||
self.send_slice_info_message.addAction("MoreInfo", name = catalog.i18nc("@action:button", "More info"), icon = None,
|
|
||||||
description = catalog.i18nc("@action:tooltip", "See more information on what data Cura sends."), button_style = Message.ActionButtonStyle.LINK)
|
|
||||||
|
|
||||||
self.send_slice_info_message.addAction("Dismiss", name = catalog.i18nc("@action:button", "Allow"), icon = None,
|
|
||||||
description = catalog.i18nc("@action:tooltip", "Allow Cura to send anonymized usage statistics to help prioritize future improvements to Cura. Some of your preferences and settings are sent, the Cura version and a hash of the models you're slicing."))
|
|
||||||
self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered)
|
|
||||||
self.send_slice_info_message.show()
|
|
||||||
|
|
||||||
if self._more_info_dialog is None:
|
if self._more_info_dialog is None:
|
||||||
self._more_info_dialog = self._createDialog("MoreInfoWindow.qml")
|
self._more_info_dialog = self._createDialog("MoreInfoWindow.qml")
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ Item
|
|||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
CuraApplication.writeToLog("i", "User declined the User Agreement.")
|
CuraApplication.writeToLog("i", "User declined the User Agreement.")
|
||||||
base.passLastPage()
|
base.endWizard()
|
||||||
CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved!
|
CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,13 @@ Item
|
|||||||
signal showNextPage()
|
signal showNextPage()
|
||||||
signal showPreviousPage()
|
signal showPreviousPage()
|
||||||
signal goToPage(string page_id) // Go to a specific page by the given page_id.
|
signal goToPage(string page_id) // Go to a specific page by the given page_id.
|
||||||
|
signal endWizard()
|
||||||
|
|
||||||
// Call the corresponding functions in the model
|
// Call the corresponding functions in the model
|
||||||
onShowNextPage: model.goToNextPage()
|
onShowNextPage: model.goToNextPage()
|
||||||
onShowPreviousPage: model.goToPreviousPage()
|
onShowPreviousPage: model.goToPreviousPage()
|
||||||
onGoToPage: model.goToPage(page_id)
|
onGoToPage: model.goToPage(page_id)
|
||||||
|
onEndWizard: model.atEnd()
|
||||||
|
|
||||||
Rectangle // Panel background
|
Rectangle // Panel background
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user