Commits

Yuya Nishihara  committed 03a84cb

fin

  • Participants
  • Parent commits 88d6cff

Comments (0)

Files changed (2)

File qop.diff

-# HG changeset patch
-# Date 1367313831 -32400
-# Parent 68e816118e6fcd28597c9cd0c844d8932cfc1dc0
-quickop: change HeadlessQuickop to QObject and pass to qtrun as dummy QWidget
-
-Since 3380d68b55d3, Qt's eventloop won't be executed if dlgfunc returns None.
-
-Instead of keeping hidden widget by quickop, now quickop.run returns dummy
-QWidget-like object to qtrun. This also fixes temporary appearance of empty
-window on drag_copy and drag_move.
-
-diff --git a/tortoisehg/hgqt/quickop.py b/tortoisehg/hgqt/quickop.py
---- a/tortoisehg/hgqt/quickop.py
-+++ b/tortoisehg/hgqt/quickop.py
-@@ -255,22 +255,26 @@ class QuickOpDialog(QDialog):
-             self.files = lfiles
-             self.cmd.run(cmdline)
- 
--instance = None
--class HeadlessQuickop(QWidget):
-+class HeadlessQuickop(QObject):
-     def __init__(self, repo, cmdline):
--        QWidget.__init__(self)
-+        QObject.__init__(self)
-         self.files = cmdline[1:]
-         os.chdir(repo.root)
--        self.cmd = cmdui.Runner(True, self)
-+        self.cmd = cmdui.Runner(True, None)  # parent must be QWidget or None
-         self.cmd.commandFinished.connect(self.commandFinished)
-         self.cmd.run(cmdline)
--        self.hide()
- 
-     def commandFinished(self, ret):
-         if ret == 0:
-             shlib.shell_notify(self.files)
-             sys.exit(0)
- 
-+    # dummy methods to act as QWidget (see run.qtrun)
-+    def show(self):
-+        pass
-+    def raise_(self):
-+        pass
-+
- def run(ui, *pats, **opts):
-     pats = hglib.canonpaths(pats)
-     if opts.get('canonpats'):
-@@ -284,8 +288,6 @@ def run(ui, *pats, **opts):
-     imm = repo.ui.config('tortoisehg', 'immediate', '')
-     if command in imm.lower():
-         cmdline = [command] + pats
--        global instance
--        instance = HeadlessQuickop(repo, cmdline)
--        return None
-+        return HeadlessQuickop(repo, cmdline)
-     else:
-         return QuickOpDialog(repo, command, pats, None)
-qop.diff
+lazyrevcolor.diff
 clonclose.diff
-lazyrevcolor.diff
 dbgtools-centos.diff
 repow-infobar-headeroverflow.diff
 repov-unusedargs.diff