[PATCH] qscilib: add a button to search for the previous occurrence

0 views
Skip to first unread message

Angel Ezquerra

unread,
Jul 27, 2012, 5:57:19 PM7/27/12
to thg...@googlegroups.com
# HG changeset patch
# User Angel Ezquerra <angel.e...@gmail.com>
# Date 1343426224 -7200
# Node ID ca34d952edb3f44a4aff51467e6ad33b46928971
# Parent 5a17c2bcc4c0cf1e348fce457a563a5e77622a07
qscilib: add a button to search for the previous occurrence

Also, relable the "Search" button into "Next".

diff --git a/tortoisehg/hgqt/qscilib.py b/tortoisehg/hgqt/qscilib.py
--- a/tortoisehg/hgqt/qscilib.py
+++ b/tortoisehg/hgqt/qscilib.py
@@ -413,9 +413,16 @@
self.addWidget(self._chk)
self._wrapchk = QCheckBox(_('Wrap search'))
self.addWidget(self._wrapchk)
- self._bt = QPushButton(_('Search'), enabled=False)
+ self._btprev = QPushButton('<< ' + _('Prev'), enabled=False)
+ self._btprev.clicked.connect(
+ lambda: self._emitSearchRequested(forward=False))
+ self.addWidget(self._btprev)
+ self._bt = QPushButton(_('Next') + ' >>', enabled=False)
self._bt.clicked.connect(self._emitSearchRequested)
- self._le.textChanged.connect(lambda s: self._bt.setEnabled(bool(s)))
+ def setEnabledSearchButtons(s):
+ self._btprev.setEnabled(bool(s))
+ self._bt.setEnabled(bool(s))
+ self._le.textChanged.connect(setEnabledSearchButtons)
self.addWidget(self._bt)

self.setFocusProxy(self._le)
thg.patch

Angel Ezquerra

unread,
Jul 27, 2012, 6:29:18 PM7/27/12
to thg...@googlegroups.com
I'm thinking that perhaps I should use "Previous" rather than "Prev"
on the button, but I don't want the buttons to be too big. Also, we
could put arrow icons on the buttons as well.

Angel

Yuya Nishihara

unread,
Aug 1, 2012, 12:06:24 PM8/1/12
to thg...@googlegroups.com
On Sat, 28 Jul 2012 00:29:18 +0200, Angel Ezquerra wrote:
> On Fri, Jul 27, 2012 at 11:57 PM, Angel Ezquerra
> <angel.e...@gmail.com> wrote:
> > # HG changeset patch
> > # User Angel Ezquerra <angel.e...@gmail.com>
> > # Date 1343426224 -7200
> > # Node ID ca34d952edb3f44a4aff51467e6ad33b46928971
> > # Parent 5a17c2bcc4c0cf1e348fce457a563a5e77622a07
> > qscilib: add a button to search for the previous occurrence
> >
> > Also, relable the "Search" button into "Next".

Pushed to default, thanks.

> I'm thinking that perhaps I should use "Previous" rather than "Prev"
> on the button, but I don't want the buttons to be too big. Also, we
> could put arrow icons on the buttons as well.

I agree. "Previous" will narrow the input box needlessly.

Reagards,
Reply all
Reply to author
Forward
0 new messages