core, add confirmation dialog on exit#208
Conversation
| focus: true | ||
| activityInfo: ActivityInfoTree.rootMenu | ||
| // set to true when returned to home from a dialog. | ||
| property bool returnFromDialog: false |
There was a problem hiding this comment.
This variable is needed to handle the cases when we close a dialog.
home() is called when we close a dialog, so to prevent the confirmation dialog to pop up, in that case, I have used this variable to handle this.
petitlapin
left a comment
There was a problem hiding this comment.
It misses a configuration variable to enable this feature.
If you click multiple times on Escape, the dialog will pop up as much times as the number of clicks.
| else { | ||
| Core.showMessageDialog(parent, | ||
| qsTr("Do you really want to quit?"), | ||
| qsTr("Yes"), function() { pageView.pop(); |
There was a problem hiding this comment.
go back to line for the function if it is not a one line function
There was a problem hiding this comment.
this code is copied/pasted 3 times, can be in a function instead
| // A confirmation dialog to quit the current activity is popped. | ||
| else { | ||
| Core.showMessageDialog(parent, | ||
| qsTr("Do you really want to quit?"), |
There was a problem hiding this comment.
"Do you want to leave current activity?" would be better
| // set to true when returned to home from a dialog. | ||
| property bool returnFromDialog: false | ||
|
|
||
| onBack: { |
There was a problem hiding this comment.
I think it should also be added there (I don't have mouse with back button but I think it will trigger this signal)
There was a problem hiding this comment.
This signal is triggered only on back pressed from phones or other touch devices. Currently, back button from the mouse is not enabled.
petitlapin
left a comment
There was a problem hiding this comment.
When I leave GCompris I have the following error:
qrc:/gcompris/src/core/GCDialog.qml:131: TypeError: Cannot read property of null
qrc:/gcompris/src/core/GCDialog.qml:132: TypeError: Cannot read property of null
qrc:/gcompris/src/core/GCButtonCancel.qml:33: TypeError: Cannot read property of null
qrc:/gcompris/src/core/GCButtonCancel.qml:34: TypeError: Cannot read property of null
qrc:/gcompris/src/core/GCDialog.qml:185: TypeError: Cannot read property of null
qrc:/gcompris/src/core/GCDialog.qml:204: TypeError: Cannot read property of null
file:///usr/lib/qt/qml/QtQuick/Controls/Private/Control.qml:90: ReferenceError: parent is not defined
file:///usr/lib/qt/qml/QtQuick/Controls/Private/BasicButton.qml:194: ReferenceError: parent is not defined
file:///usr/lib/qt/qml/QtQuick/Controls/Private/Control.qml:90: ReferenceError: parent is not defined
file:///usr/lib/qt/qml/QtQuick/Controls/Private/BasicButton.qml:194: ReferenceError: parent is not defined
Can you check?
When I disable the option, I still have the confirmation on linux.
The option should be disabled by default.
Can you rebase on master and add the corresponding unit test?
|
|
||
| GCDialogCheckBox { | ||
| id: enableExitDialogBox | ||
| text: qsTr("Enable activity Exit confirmation dialog") |
There was a problem hiding this comment.
Confirm before leaving current activity
Patch for Task5013
--> Shows confirmation dialog on exiting an activity or closing an activity.