UI/SearchWidget.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3366
6084bb3c3911
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
2 2
3 # Copyright (c) 2012 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2012 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the search box for the shel, terminal and log viewer. 7 Module implementing the search box for the shell, terminal and log viewer.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt 12 from PyQt4.QtCore import pyqtSlot, pyqtSignal, Qt
17 import UI.PixmapCache 17 import UI.PixmapCache
18 18
19 19
20 class SearchWidget(QWidget, Ui_SearchWidget): 20 class SearchWidget(QWidget, Ui_SearchWidget):
21 """ 21 """
22 Class implementing the search box for the shel, terminal and log viewer. 22 Class implementing the search box for the shell, terminal and log viewer.
23 23
24 @signal searchNext(text, caseSensitive, wholeWord) emitted when the user 24 @signal searchNext(text, caseSensitive, wholeWord) emitted when the user
25 pressed the next button (string, boolean, boolean) 25 pressed the next button (string, boolean, boolean)
26 @signal searchPrevious(text, caseSensitive, wholeWord) emitted when the 26 @signal searchPrevious(text, caseSensitive, wholeWord) emitted when the
27 user pressed the previous button (string, boolean, boolean) 27 user pressed the previous button (string, boolean, boolean)
60 60
61 self.findHistory = [] 61 self.findHistory = []
62 62
63 self.findtextCombo.lineEdit().returnPressed.connect( 63 self.findtextCombo.lineEdit().returnPressed.connect(
64 self.__findByReturnPressed) 64 self.__findByReturnPressed)
65
66 msh = self.minimumSizeHint()
67 self.resize(max(self.width(), msh.width()), msh.height())
65 68
66 @pyqtSlot() 69 @pyqtSlot()
67 def on_closeButton_clicked(self): 70 def on_closeButton_clicked(self):
68 """ 71 """
69 Private slot to close the widget. 72 Private slot to close the widget.
175 if found: 178 if found:
176 self.statusLabel.clear() 179 self.statusLabel.clear()
177 else: 180 else:
178 txt = self.findtextCombo.currentText() 181 txt = self.findtextCombo.currentText()
179 self.statusLabel.setText( 182 self.statusLabel.setText(
180 self.trUtf8("'{0}' was not found.").format(txt)) 183 self.tr("'{0}' was not found.").format(txt))

eric ide

mercurial