~sylvain-pineau/checkbox/git_release_tools

« back to all changes in this revision

Viewing changes to checkbox-touch/components/ConfirmationDialog.qml

"automatic merge of lp:~kissiel/checkbox/converged-keyboard-support/ by tarmac [r=pierre-equoy][bug=1231844,1318466][author=kissiel]"

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
            title: question
67
67
 
68
68
            Button {
 
69
                id: yesButton
69
70
                text: i18n.tr("YES")
70
71
                objectName: "yesButton"
71
72
                color: UbuntuColors.green
72
73
                onClicked: {
73
 
                    answer(true, checkBox.checked);
74
 
                    PopupUtils.close(dlg);
 
74
                    _giveAnswer(true);
75
75
                }
76
76
            }
77
77
            Button {
 
78
                id: noButton
78
79
                text: i18n.tr("NO")
79
80
                objectName: "noButton"
80
81
                color: UbuntuColors.red
81
82
                onClicked: {
82
 
                    answer(false, checkBox.checked);
83
 
                    PopupUtils.close(dlg);
 
83
                    _giveAnswer(false);
84
84
                }
85
85
            }
86
86
 
102
102
                    }
103
103
                }
104
104
            }
 
105
            Component.onCompleted: {
 
106
                rootKeysDelegator.setHandler('alt+y', confirmationDialog, yesButton.clicked);
 
107
                rootKeysDelegator.setHandler('alt+n', confirmationDialog, noButton.clicked);
 
108
                rootKeysDelegator.activeStack.push(confirmationDialog);
 
109
            }
 
110
            function _giveAnswer(confirmation) {
 
111
                // ensures that dialog is closed
 
112
                answer(confirmation, checkBox.checked);
 
113
                PopupUtils.close(dlg);
 
114
                rootKeysDelegator.activeStack.pop();
 
115
            }
105
116
        }
106
117
    }
107
118
}