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

wctxactions: pass parent widget to run function

to properly align any pop-up windows

Changeset a17277d023ec

Parent 89373632bfbe

by Steve Borho

Changes to one file · Browse files at a17277d023ec Showing diff from parent 89373632bfbe Diff from another changeset...

 
27
28
29
30
 
31
32
33
 
66
67
68
69
 
70
71
72
 
77
78
79
80
 
81
82
 
83
84
85
86
87
 
88
89
 
90
91
92
 
27
28
29
 
30
31
32
33
 
66
67
68
 
69
70
71
72
 
77
78
79
 
80
81
 
82
83
84
85
86
 
87
88
 
89
90
91
92
@@ -27,7 +27,7 @@
  action = menu.addAction(text)   if icon:   action.setIcon(icon) - action.wrapper = lambda files=files: run(func, files, repo) + action.wrapper = lambda files=files: run(func, parent, files, repo)   parent.connect(action, SIGNAL('triggered()'), action.wrapper)   return action   @@ -66,7 +66,7 @@
  menu.addMenu(rmenu)   return menu.exec_(point)   -def run(func, files, repo): +def run(func, parent, files, repo):   'run wrapper for all action methods'   wfiles = [repo.wjoin(x) for x in files]   hu = htmlui.htmlui() @@ -77,16 +77,16 @@
  notify = func(hu, wfiles, repo)   o, e = hu.getdata()   if e: - QMessageBox.warning(None, name + _(' reported errors'), str(e)) + QMessageBox.warning(parent, name + _(' reported errors'), str(e))   elif o: - QMessageBox.information(None, name + _(' reported errors'), str(o)) + QMessageBox.information(parent, name + _(' reported errors'), str(o))   elif notify:   shlib.shell_notify(wfiles)   return notify   except (util.Abort, IOError, OSError), e: - QMessageBox.critical(None, name + _(' Aborted'), str(e)) + QMessageBox.critical(parent, name + _(' Aborted'), str(e))   except (error.LookupError), e: - QMessageBox.critical(None, name + _(' Aborted'), str(e)) + QMessageBox.critical(parent, name + _(' Aborted'), str(e))   return False    def filelist(files):