mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Small fixes for disable user data triggering preferences window
This commit is contained in:
parent
c3954c40ac
commit
b29047abd3
3 changed files with 14 additions and 12 deletions
|
@ -409,6 +409,14 @@ class CuraApplication(QtApplication):
|
||||||
else:
|
else:
|
||||||
self.exit(0)
|
self.exit(0)
|
||||||
|
|
||||||
|
## Signal to connect preferences action in QML
|
||||||
|
showPreferencesWindow = pyqtSignal()
|
||||||
|
|
||||||
|
## Show the preferences window
|
||||||
|
@pyqtSlot()
|
||||||
|
def showPreferences(self):
|
||||||
|
self.showPreferencesWindow.emit()
|
||||||
|
|
||||||
## A reusable dialogbox
|
## A reusable dialogbox
|
||||||
#
|
#
|
||||||
showMessageBox = pyqtSignal(str, str, str, str, int, int, arguments = ["title", "text", "informativeText", "detailedText", "buttons", "icon"])
|
showMessageBox = pyqtSignal(str, str, str, str, int, int, arguments = ["title", "text", "informativeText", "detailedText", "buttons", "icon"])
|
||||||
|
@ -1426,11 +1434,3 @@ class CuraApplication(QtApplication):
|
||||||
node = node.getParent()
|
node = node.getParent()
|
||||||
|
|
||||||
Selection.add(node)
|
Selection.add(node)
|
||||||
|
|
||||||
|
|
||||||
triggerPreferenceWindow = pyqtSignal()
|
|
||||||
|
|
||||||
# This event has a simple logic, display pereference window if user decided to disable "collect information"
|
|
||||||
@pyqtProperty(bool, notify = triggerPreferenceWindow)
|
|
||||||
def showMyTest(self):
|
|
||||||
return True
|
|
|
@ -52,11 +52,13 @@ class SliceInfo(Extension):
|
||||||
self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered)
|
self.send_slice_info_message.actionTriggered.connect(self.messageActionTriggered)
|
||||||
self.send_slice_info_message.show()
|
self.send_slice_info_message.show()
|
||||||
|
|
||||||
|
## Perform action based on user input.
|
||||||
|
# Note that clicking "Disable" won't actually disable the data sending, but rather take the user to preferences where they can disable it.
|
||||||
def messageActionTriggered(self, message_id, action_id):
|
def messageActionTriggered(self, message_id, action_id):
|
||||||
if action_id == "Disable":
|
|
||||||
CuraApplication.getInstance().triggerPreferenceWindow.emit()
|
|
||||||
self.send_slice_info_message.hide()
|
|
||||||
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
|
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
|
||||||
|
if action_id == "Disable":
|
||||||
|
CuraApplication.getInstance().showPreferences()
|
||||||
|
self.send_slice_info_message.hide()
|
||||||
|
|
||||||
def _onWriteStarted(self, output_device):
|
def _onWriteStarted(self, output_device):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -531,7 +531,7 @@ UM.MainWindow
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: CuraApplication
|
target: CuraApplication
|
||||||
onShowMyTestChanged: preferences.visible = true
|
onShowPreferencesWindow: preferences.visible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageDialog
|
MessageDialog
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue