116 Re-implemented to handle the user pressing the escape key. |
116 Re-implemented to handle the user pressing the escape key. |
117 |
117 |
118 @param ev key event (QKeyEvent) |
118 @param ev key event (QKeyEvent) |
119 """ |
119 """ |
120 if ev.key() == Qt.Key_Escape: |
120 if ev.key() == Qt.Key_Escape: |
121 res = E5MessageBox.yesNo(self, |
121 res = E5MessageBox.yesNo( |
|
122 self, |
122 self.trUtf8("Close dialog"), |
123 self.trUtf8("Close dialog"), |
123 self.trUtf8("""Do you really want to close the dialog?""")) |
124 self.trUtf8("""Do you really want to close the dialog?""")) |
124 if res: |
125 if res: |
125 self.reject() |
126 self.reject() |
126 |
127 |
135 |
136 |
136 def on_buttonBox_rejected(self): |
137 def on_buttonBox_rejected(self): |
137 """ |
138 """ |
138 Private slot to handle the rejected signal of the button box. |
139 Private slot to handle the rejected signal of the button box. |
139 """ |
140 """ |
140 res = E5MessageBox.yesNo(self, |
141 res = E5MessageBox.yesNo( |
|
142 self, |
141 self.trUtf8("Close dialog"), |
143 self.trUtf8("Close dialog"), |
142 self.trUtf8("""Do you really want to close the dialog?""")) |
144 self.trUtf8("""Do you really want to close the dialog?""")) |
143 if res: |
145 if res: |
144 self.reject() |
146 self.reject() |
145 |
147 |
299 errorStr = e.smtp_error.decode() |
301 errorStr = e.smtp_error.decode() |
300 elif isinstance(e, socket.error): |
302 elif isinstance(e, socket.error): |
301 errorStr = e[1] |
303 errorStr = e[1] |
302 else: |
304 else: |
303 errorStr = str(e) |
305 errorStr = str(e) |
304 res = E5MessageBox.retryAbort(self, |
306 res = E5MessageBox.retryAbort( |
|
307 self, |
305 self.trUtf8("Send bug report"), |
308 self.trUtf8("Send bug report"), |
306 self.trUtf8( |
309 self.trUtf8( |
307 """<p>Authentication failed.<br>Reason: {0}</p>""") |
310 """<p>Authentication failed.<br>Reason: {0}</p>""") |
308 .format(errorStr), |
311 .format(errorStr), |
309 E5MessageBox.Critical) |
312 E5MessageBox.Critical) |
324 errorStr = e.smtp_error.decode() |
327 errorStr = e.smtp_error.decode() |
325 elif isinstance(e, socket.error): |
328 elif isinstance(e, socket.error): |
326 errorStr = e[1] |
329 errorStr = e[1] |
327 else: |
330 else: |
328 errorStr = str(e) |
331 errorStr = str(e) |
329 res = E5MessageBox.retryAbort(self, |
332 res = E5MessageBox.retryAbort( |
|
333 self, |
330 self.trUtf8("Send bug report"), |
334 self.trUtf8("Send bug report"), |
331 self.trUtf8( |
335 self.trUtf8( |
332 """<p>Message could not be sent.<br>Reason: {0}</p>""") |
336 """<p>Message could not be sent.<br>Reason: {0}</p>""") |
333 .format(errorStr), |
337 .format(errorStr), |
334 E5MessageBox.Critical) |
338 E5MessageBox.Critical) |