Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable cmdui: derive Runner from QObject

Now that parent is a non-optional argument, we can parent the core and QDialog
widgets directly to the parent. This fixes some oddities in our code.

Changeset 2e85ede9dbde

Parent e16c6ff4dd06

by Steve Borho

Changes to one file · Browse files at 2e85ede9dbde Showing diff from parent e16c6ff4dd06 Diff from another changeset...

 
787
788
789
790
 
791
792
793
 
805
806
807
808
809
810
811
812
813
814
815
816
817
818
 
819
820
821
 
850
851
852
853
 
854
855
856
 
787
788
789
 
790
791
792
793
 
805
806
807
 
 
 
 
 
 
 
808
809
810
 
811
812
813
814
 
843
844
845
 
846
847
848
849
@@ -787,7 +787,7 @@
  self.closeBtn.setShown(True)   self.closeBtn.setFocus()   -class Runner(QWidget): +class Runner(QObject):   """A component for running Mercurial command without UI     This command runner doesn't show any UI element unless it gets a warning @@ -805,17 +805,10 @@
    def __init__(self, useInternal, parent):   super(Runner, self).__init__(parent) - - # XXX: workaround not to eat mouse-click around left-top corner of - # the parent widget. Runner shouldn't be a QWidget, but for now - # it's a QWidget in order to become a parent of self.core.thread - # and self.dlg. - self.resize(0, 0) -   self.internallog = useInternal   self.title = _('TortoiseHg')   - self.core = Core(useInternal, self) + self.core = Core(useInternal, parent)   self.core.commandStarted.connect(self.commandStarted)   self.core.commandFinished.connect(self.onCommandFinished)   self.core.commandCanceling.connect(self.commandCanceling) @@ -850,7 +843,7 @@
  if not self.internallog:   return   if not hasattr(self, 'dlg'): - self.dlg = dlg = QDialog(self) + self.dlg = dlg = QDialog(self.parent())   dlg.setWindowTitle(self.title)   dlg.setWindowFlags(Qt.Dialog)   dlg.setLayout(QVBoxLayout())