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

hgtk: keep track of whether bugreport needs gtk.main()

Changeset 5f246c386b3d

Parent 89c6b627f417

by Steve Borho

Changes to one file · Browse files at 5f246c386b3d Showing diff from parent 89c6b627f417 Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​hgtk.py Stacked
 
35
36
37
 
38
39
40
 
45
46
47
 
48
49
50
51
52
53
54
55
56
57
 
 
 
 
 
 
58
59
60
 
207
208
209
210
 
211
212
213
 
217
218
219
 
220
 
221
222
223
 
35
36
37
38
39
40
41
 
46
47
48
49
50
51
52
 
53
54
55
 
 
 
56
57
58
59
60
61
62
63
64
 
211
212
213
 
214
215
216
217
 
221
222
223
224
225
226
227
228
229
@@ -35,6 +35,7 @@
  gobject.signal_new(sig, gtk.Window,   gobject.SIGNAL_ACTION, gobject.TYPE_NONE, ())   +gtkmainalive = False  def dispatch(args):   "run the command specified in args"   try: @@ -45,16 +46,19 @@
  pdb.set_trace()   return _runcatch(u, args)   except: + from hggtk.bugreport import run   if '--debugger' in args:   pdb.post_mortem(sys.exc_info()[2])   error = traceback.format_exc() - from hggtk.bugreport import run   opts = {}   opts['cmd'] = ' '.join(sys.argv[1:])   opts['error'] = error - # TODO: keep track of whether gtk.main() is running - print error - run(u, **opts) + if gtkmainalive: + dlg = run(u, **opts) + dlg.display() + dlg.show_all() + else: + gtkrun(run(u, **opts))    def get_list_from_file(filename):   try: @@ -207,7 +211,7 @@
  mainwindow.destroy()    def gtkrun(win): - global mainwindow + global mainwindow, gtkmainalive   mainwindow = win   if hasattr(win, 'display'):   win.display() @@ -217,7 +221,9 @@
  win.connect('destroy', gtk.main_quit)   gtk.gdk.threads_init()   gtk.gdk.threads_enter() + gtkmainalive = True   gtk.main() + gtkmainalive = False   gtk.gdk.threads_leave()    def about(ui, *pats, **opts):