149 res = __messageBox(parent, title, text, icon, |
149 res = __messageBox(parent, title, text, icon, |
150 QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No), |
150 QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No), |
151 yesDefault and QMessageBox.Yes or QMessageBox.No) |
151 yesDefault and QMessageBox.Yes or QMessageBox.No) |
152 return res == QMessageBox.Yes |
152 return res == QMessageBox.Yes |
153 |
153 |
|
154 def retryAbort(parent, title, text, type_ = Question): |
|
155 """ |
|
156 Function to show a model abort/retry message box. |
|
157 |
|
158 @param parent parent widget of the message box (QWidget) |
|
159 @param title caption of the message box (string) |
|
160 @param text text to be shown by the message box (string) |
|
161 @keyparam type_ type of the dialog (Critical, Information, Question or Warning) |
|
162 @return flag indicating the selection of the Retry button (boolean) |
|
163 """ |
|
164 assert type_ in [Critical, Information, Question, Warning] |
|
165 |
|
166 if type_ == Question: |
|
167 icon = QMessageBox.Question |
|
168 elif type_ == Warning: |
|
169 icon = QMessageBox.Warning |
|
170 elif type_ == Critical: |
|
171 icon = QMessageBox.Critical |
|
172 elif type_ == Information: |
|
173 icon = QMessageBox.Information |
|
174 |
|
175 res = __messageBox(parent, title, text, icon, |
|
176 QMessageBox.StandardButtons(QMessageBox.Retry | QMessageBox.Abort), |
|
177 QMessageBox.Retry) |
|
178 return res == QMessageBox.Retry |
|
179 |
154 def okToClearData(parent, title, text, saveFunc): |
180 def okToClearData(parent, title, text, saveFunc): |
155 """ |
181 """ |
156 Function to show a model message box to ask for clearing the data. |
182 Function to show a model message box to ask for clearing the data. |
157 |
183 |
158 @param parent parent widget of the message box (QWidget) |
184 @param parent parent widget of the message box (QWidget) |