104 Re-implemented to handle the user pressing the escape key. |
104 Re-implemented to handle the user pressing the escape key. |
105 |
105 |
106 @param ev key event (QKeyEvent) |
106 @param ev key event (QKeyEvent) |
107 """ |
107 """ |
108 if ev.key() == Qt.Key_Escape: |
108 if ev.key() == Qt.Key_Escape: |
109 res = E5MessageBox.question(self, |
109 res = E5MessageBox.yesNo(self, |
110 self.trUtf8("Close dialog"), |
110 self.trUtf8("Close dialog"), |
111 self.trUtf8("""Do you really want to close the dialog?"""), |
111 self.trUtf8("""Do you really want to close the dialog?""")) |
112 QMessageBox.StandardButtons(\ |
112 if res: |
113 QMessageBox.No | \ |
|
114 QMessageBox.Yes), |
|
115 QMessageBox.No) |
|
116 if res == QMessageBox.Yes: |
|
117 self.reject() |
113 self.reject() |
118 |
114 |
119 def on_buttonBox_clicked(self, button): |
115 def on_buttonBox_clicked(self, button): |
120 """ |
116 """ |
121 Private slot called by a button of the button box clicked. |
117 Private slot called by a button of the button box clicked. |
127 |
123 |
128 def on_buttonBox_rejected(self): |
124 def on_buttonBox_rejected(self): |
129 """ |
125 """ |
130 Private slot to handle the rejected signal of the button box. |
126 Private slot to handle the rejected signal of the button box. |
131 """ |
127 """ |
132 res = E5MessageBox.question(self, |
128 res = E5MessageBox.yesNo(self, |
133 self.trUtf8("Close dialog"), |
129 self.trUtf8("Close dialog"), |
134 self.trUtf8("""Do you really want to close the dialog?"""), |
130 self.trUtf8("""Do you really want to close the dialog?""")) |
135 QMessageBox.StandardButtons(\ |
131 if res: |
136 QMessageBox.No | \ |
|
137 QMessageBox.Yes), |
|
138 QMessageBox.No) |
|
139 if res == QMessageBox.Yes: |
|
140 self.reject() |
132 self.reject() |
141 |
133 |
142 @pyqtSlot() |
134 @pyqtSlot() |
143 def on_sendButton_clicked(self): |
135 def on_sendButton_clicked(self): |
144 """ |
136 """ |