Commits

Yuya Nishihara committed e99bb07

finish some gc patches, etc.

Comments (0)

Files changed (8)

+# HG changeset patch
+# User Yuya Nishihara <yuya@tcha.org>
+# Date 1361707667 -32400
+#      Sun Feb 24 21:07:47 2013 +0900
+# Node ID 5cf571e59e8ab5f17e36c784610a25da4b3a662a
+# Parent  5bba6c45243a78985ba0e1a19f9d1aca1ab7147e
+qtlib: keep target widget of PaletteSwitcher by weakref
+
+diff --git a/tortoisehg/hgqt/qtlib.py b/tortoisehg/hgqt/qtlib.py
+--- a/tortoisehg/hgqt/qtlib.py
++++ b/tortoisehg/hgqt/qtlib.py
+@@ -1267,7 +1267,7 @@ class PaletteSwitcher(object):
+     enablefilterpalette() method.
+     """
+     def __init__(self, targetwidget):
+-        self._targetwidget = targetwidget
++        self._targetwref = weakref.ref(targetwidget)  # avoid circular ref
+         self._defaultpalette = targetwidget.palette()
+         bgcolor = self._defaultpalette.color(QPalette.Base)
+         if bgcolor.black() <= 128:
+@@ -1280,8 +1280,11 @@ class PaletteSwitcher(object):
+         self._filterpalette.setColor(QPalette.Base, filterbgcolor)
+ 
+     def enablefilterpalette(self, enabled=False):
++        targetwidget = self._targetwref()
++        if not targetwidget:
++            return
+         if enabled:
+             pl = self._filterpalette
+         else:
+             pl = self._defaultpalette
+-        self._targetwidget.setPalette(pl)
++        targetwidget.setPalette(pl)

filterbarev.diff

-# HG changeset patch
-# Parent b91aa12673978ad544b4af4ae9bd1cc80cc0328c
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -159,6 +159,7 @@ class RepoFilterBar(_QToolBar):
-         self.revsetcombo.setCurrentIndex(-1)
- 
-     def showEvent(self, event):
-+        super(RepoFilterBar, self).showEvent(event)
-         self.revsetcombo.lineEdit().setFocus()
- 
-     def openEditor(self):

infobar-gc.diff

-# HG changeset patch
-# Parent 52be3c33476b6e345de1f61749350183a2bae9ac
-
-diff --git a/tortoisehg/hgqt/qtlib.py b/tortoisehg/hgqt/qtlib.py
---- a/tortoisehg/hgqt/qtlib.py
-+++ b/tortoisehg/hgqt/qtlib.py
-@@ -916,9 +916,6 @@ def linkifyMessage(message, subrepo=None
- class InfoBar(QFrame):
-     """Non-modal confirmation/alert (like web flash or Chrome's InfoBar)
- 
--    You shouldn't reuse InfoBar object after close(). It is automatically
--    deleted.
--
-     Layout::
- 
-         |widgets ...                |right widgets ...|x|
-@@ -942,8 +939,6 @@ class InfoBar(QFrame):
-     def __init__(self, parent=None):
-         super(InfoBar, self).__init__(parent, frameShape=QFrame.StyledPanel,
-                                       frameShadow=QFrame.Plain)
--        self.setAttribute(Qt.WA_DeleteOnClose)
--
-         self.setAutoFillBackground(True)
-         p = self.palette()
-         p.setColor(QPalette.Window, QColor(self._colormap[self.infobartype]))
+13667.diff
 longbra.diff
 branch-editable.diff
 revsetnotfound.diff
 branch-selectall.diff
 branch-sep.diff
 dbgtools-gcmode.diff
-filterbarev.diff
 finished-nodel-debug.diff
 no-delete-later.diff
-infobar-gc.diff
 mq-nosync.diff
 issue2406-trace.diff
 cipygtype.diff
 repotree-indexpare.diff
 openall-recursive.diff
 reporeg-no-childroots.diff
-shelve-no-done.diff
-shelve-parentnone.diff
 shelve-modeless.diff
 bisect-modeless.diff
-status-deref-stfilter.diff
-status-deref-pat.diff
 commit-autodisco.diff
 commit-lessslot.diff
 commit-try-commentout.diff

shelve-no-done.diff

-# HG changeset patch
-# Parent 385f036027d6182fce15ec099fa1e9552593014d
-diff --git a/tortoisehg/hgqt/shelve.py b/tortoisehg/hgqt/shelve.py
---- a/tortoisehg/hgqt/shelve.py
-+++ b/tortoisehg/hgqt/shelve.py
-@@ -195,10 +195,6 @@ class ShelveDialog(QDialog):
-         self.setWindowTitle(_('TortoiseHg Shelve - %s') % repo.displayname)
-         self.restoreSettings()
- 
--    def done(self, ret):
--        self.repo.repositoryChanged.disconnect(self.refreshCombos)
--        super(ShelveDialog, self).done(ret)
--
-     @pyqtSlot()
-     def moveFileRight(self):
-         if self.combob.currentIndex() == -1:

shelve-parentnone.diff

-# HG changeset patch
-# Parent 2cbd7c0c9f6418ece48191fa46e893d2c8837d4b
-diff --git a/tortoisehg/hgqt/shelve.py b/tortoisehg/hgqt/shelve.py
---- a/tortoisehg/hgqt/shelve.py
-+++ b/tortoisehg/hgqt/shelve.py
-@@ -22,7 +22,7 @@ class ShelveDialog(QDialog):
- 
-     wdir = _('Working Directory')
- 
--    def __init__(self, repo, parent):
-+    def __init__(self, repo, parent=None):
-         QDialog.__init__(self, parent)
-         self.setWindowFlags(Qt.Window)
- 
-@@ -490,4 +490,4 @@ def run(ui, *pats, **opts):
-         from tortoisehg.util import paths
-         from tortoisehg.hgqt import thgrepo
-         repo = thgrepo.repository(ui, path=paths.find_root())
--    return ShelveDialog(repo, None)
-+    return ShelveDialog(repo)

status-deref-pat.diff

-# HG changeset patch
-# Parent ff9cc18d7747fb42fcf24e7fe11f4c4e22a98f11
-
-diff --git a/tortoisehg/hgqt/status.py b/tortoisehg/hgqt/status.py
---- a/tortoisehg/hgqt/status.py
-+++ b/tortoisehg/hgqt/status.py
-@@ -141,15 +141,10 @@ class StatusWidget(QWidget):
-         vbox.addWidget(tv)
-         split.addWidget(frame)
- 
--        if self.pats:
--            def clearPattern():
--                self.pats = []
--                self.refreshWctx()
--                cpb.setVisible(False)
--                self.titleTextChanged.emit(self.getTitle())
--            cpb = QPushButton(_('Remove filter, show root'))
--            vbox.addWidget(cpb)
--            cpb.clicked.connect(clearPattern)
-+        self.clearPatternBtn = QPushButton(_('Remove filter, show root'))
-+        vbox.addWidget(self.clearPatternBtn)
-+        self.clearPatternBtn.clicked.connect(self.clearPattern)
-+        self.clearPatternBtn.setVisible(bool(self.pats))
- 
-         tv.setItemsExpandable(False)
-         tv.setRootIsDecorated(False)
-@@ -417,6 +412,13 @@ class StatusWidget(QWidget):
-             self.tv.enablefilterpalette(bool(match))
- 
-     @pyqtSlot()
-+    def clearPattern(self):
-+        self.pats = []
-+        self.refreshWctx()
-+        self.clearPatternBtn.setVisible(False)
-+        self.titleTextChanged.emit(self.getTitle())
-+
-+    @pyqtSlot()
-     def updateCheckCount(self):
-         'user has toggled one or more checkboxes, update counts and checkall'
-         model = self.tv.model()

status-deref-stfilter.diff

-# HG changeset patch
-# Parent 3763a5e29e423c8f04b6a48436072c57fffcb851
-
-diff --git a/tortoisehg/hgqt/status.py b/tortoisehg/hgqt/status.py
---- a/tortoisehg/hgqt/status.py
-+++ b/tortoisehg/hgqt/status.py
-@@ -159,13 +159,7 @@ class StatusWidget(QWidget):
-         tv.menuRequest.connect(self.onMenuRequest)
-         le.textEdited.connect(self.setFilter)
- 
--        def statusTypeTrigger(status):
--            status = str(status)
--            for s in statusTypes:
--                val = statusTypes[s]
--                self.opts[val.name] = s in status
--            self.refreshWctx()
--        self.statusfilter.statusChanged.connect(statusTypeTrigger)
-+        self.statusfilter.statusChanged.connect(self.setStatusFilter)
- 
-         self.tv = tv
-         self.le = le
-@@ -407,6 +401,14 @@ class StatusWidget(QWidget):
-         elif status in 'C?':
-             qtlib.editfiles(self.repo, [path])
- 
-+    @pyqtSlot(str)
-+    def setStatusFilter(self, status):
-+        status = str(status)
-+        for s in statusTypes:
-+            val = statusTypes[s]
-+            self.opts[val.name] = s in status
-+        self.refreshWctx()
-+
-     @pyqtSlot(QString)
-     def setFilter(self, match):
-         model = self.tv.model()