Commit e8fe6414 authored by Steve Borho's avatar Steve Borho
Browse files

repofilter: hide revset/filter bar behind CTRL+S

parent b122e59035b0
......@@ -42,12 +42,12 @@ class QuickBar(QToolBar):
openact.setCheckable(True)
openact.setChecked(False)
openact.setShortcut(QKeySequence(openkey))
openact.triggered.connect(lambda: self.setVisible(True))
openact.triggered.connect(self.show)
closeact = QAction('Close', self)
closeact.setIcon(geticon('close'))
closeact.setShortcut(Qt.Key_Escape)
closeact.triggered.connect(lambda: self.setVisible(False))
closeact.triggered.connect(self.hide)
self._actions = {'open': openact, 'close': closeact}
......
......@@ -10,7 +10,7 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
from tortoisehg.hgqt.i18n import _
from tortoisehg.hgqt import revset
from tortoisehg.hgqt import revset, qtlib
class RepoFilterBar(QToolBar):
"""Toolbar for RepoWidget to filter changesets"""
......@@ -25,11 +25,20 @@ class RepoFilterBar(QToolBar):
branchChanged = pyqtSignal(unicode, bool)
"""Emitted (branch, allparents) when branch selection changed"""
def __init__(self, repo, parent=None):
def __init__(self, repo, parent):
super(RepoFilterBar, self).__init__(parent)
self.layout().setContentsMargins(0, 0, 0, 0)
self.setIconSize(QSize(16,16))
self.setFloatable(False)
self.setMovable(False)
self._repo = repo
closeact = QAction('Close', self)
closeact.setIcon(qtlib.geticon('close'))
closeact.setShortcut(Qt.Key_Escape)
closeact.triggered.connect(self.hide)
self.addAction(closeact)
self.entrydlg = revset.RevisionSetQuery(repo, self)
self.entrydlg.progress.connect(self.progress)
self.entrydlg.showMessage.connect(self.showMessage)
......
......@@ -107,7 +107,7 @@ class RepoWidget(QWidget):
b.setShown(False)
hbox.addWidget(b)
self.filterbar = RepoFilterBar(self.repo)
self.filterbar = RepoFilterBar(self.repo, self)
self.filterbar.branchChanged.connect(self.setBranch)
self.filterbar.progress.connect(self.progress)
self.filterbar.showMessage.connect(self.showMessage)
......@@ -116,6 +116,12 @@ class RepoWidget(QWidget):
self.filterbar.filterToggled.connect(self.filterToggled)
hbox.addWidget(self.filterbar)
openact = QAction('Open', self)
openact.setShortcut('Ctrl+S')
openact.triggered.connect(self.filterbar.show)
self.addAction(openact)
self.filterbar.hide()
self.revsetfilter = self.filterbar.filtercb.isChecked()
self.layout().addWidget(self.repotabs_splitter)
......@@ -277,6 +283,7 @@ class RepoWidget(QWidget):
self.bundleReject.setHidden(False)
self.filterbar.revsetle.setText('incoming()')
self.filterbar.setEnabled(False)
self.filterbar.show()
self.titleChanged.emit(self.title())
newlen = len(self.repo)
self.revset = [self.repo[n].node() for n in range(oldlen, newlen)]
......@@ -344,6 +351,7 @@ class RepoWidget(QWidget):
def setOutgoingNodes(self, nodes):
self.filterbar.revsetle.setText('outgoing()')
self.filterbar.show()
self.setRevisionSet(nodes)
def createGrepWidget(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment