Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

gdialog: switch CustomPrompt base class to gtk.MessageDialog

something about gtklib.MessageDialog makes GTK lockup if you
create an instance of it from a thread. Who knows?

Changeset 652ac1a00139

Parent c67cf2afb3e5

by Steve Borho

Changes to one file · Browse files at 652ac1a00139 Showing diff from parent c67cf2afb3e5 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​gdialog.py Stacked
 
46
47
48
49
 
50
51
52
 
54
55
56
57
58
 
 
59
60
 
61
62
63
 
46
47
48
 
49
50
51
52
 
54
55
56
 
 
57
58
59
 
60
61
62
63
@@ -46,7 +46,7 @@
  buttons[0].add_accelerator("clicked", accel_group, key,   modifier, gtk.ACCEL_VISIBLE)   -class CustomPrompt(SimpleMessage): +class CustomPrompt(gtk.MessageDialog):   ''' Custom prompt dialog. Provide a list of choices with ampersands   to delineate response given for each choice (and keyboard   accelerator). Default must be one of the choice responses. @@ -54,10 +54,10 @@
  # ret = CustomPrompt('Title', 'Message', self, ('&Yes', 'N&o'), 'o').run()   # ret will be (gtk.RESPONSE_DELETE_EVENT, ord('y'), or ord('o'))   def __init__(self, title, message, parent, choices, default=None): - SimpleMessage.__init__(self, parent, gtk.DIALOG_MODAL, - gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE) + gtk.MessageDialog.__init__(self, parent, gtk.DIALOG_MODAL, + gtk.MESSAGE_QUESTION)   self.set_title(hglib.toutf(title)) - self.set_markup('<b>' + hglib.toutf(message) + '</b>') + self.format_secondary_markup('<b>' + hglib.toutf(message) + '</b>')   accel_group = gtk.AccelGroup()   self.add_accel_group(accel_group)   for s in choices: