Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

qtlib: add setting a defaultbutton for question msgbox

it's sometimes more convenient to have No as default :)

Changeset d3096a43b508

Parent 27c8b424b27b

by Johan Samyn

Changes to one file · Browse files at d3096a43b508 Showing diff from parent 27c8b424b27b Diff from another changeset...

 
189
190
191
192
 
193
194
195
196
197
198
 
 
199
200
201
 
189
190
191
 
192
193
194
195
196
197
198
199
200
201
202
203
@@ -189,13 +189,15 @@
  return pixmap    def CommonMsgBox(icon, title, main, text='', buttons=QMessageBox.Close, - labels=[], parent=None): + labels=[], parent=None, defaultbutton=None):   msg = QMessageBox(parent)   msg.setIcon(icon)   msg.setWindowTitle(title)   msg.setStandardButtons(buttons)   for button_id, label in labels:   msg.setButtonText(button_id, label) + if defaultbutton: + msg.setDefaultButton(defaultbutton)   msg.setText('<b>%s</b>' % main)   info = ''   for line in text.split('\n'):