4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing the search and replace widget. |
7 Module implementing the search and replace widget. |
8 """ |
8 """ |
|
9 |
|
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
9 |
11 |
10 from PyQt4.QtCore import pyqtSignal, Qt, pyqtSlot |
12 from PyQt4.QtCore import pyqtSignal, Qt, pyqtSlot |
11 from PyQt4.QtGui import QWidget, QHBoxLayout, QToolButton, QScrollArea, QSizePolicy, \ |
13 from PyQt4.QtGui import QWidget, QHBoxLayout, QToolButton, QScrollArea, QSizePolicy, \ |
12 QFrame |
14 QFrame |
13 |
15 |
37 @param vm reference to the viewmanager object |
39 @param vm reference to the viewmanager object |
38 @param parent parent widget of this widget (QWidget) |
40 @param parent parent widget of this widget (QWidget) |
39 @param sliding flag indicating the widget is embedded in the |
41 @param sliding flag indicating the widget is embedded in the |
40 sliding widget (boolean) |
42 sliding widget (boolean) |
41 """ |
43 """ |
42 super().__init__(parent) |
44 super(SearchReplaceWidget, self).__init__(parent) |
43 |
45 |
44 self.viewmanager = vm |
46 self.viewmanager = vm |
45 self.replace = replace |
47 self.replace = replace |
46 self.__sliding = sliding |
48 self.__sliding = sliding |
47 if sliding: |
49 if sliding: |
698 |
700 |
699 @param replace flag indicating a replace widget is called |
701 @param replace flag indicating a replace widget is called |
700 @param vm reference to the viewmanager object |
702 @param vm reference to the viewmanager object |
701 @param parent parent widget of this widget (QWidget) |
703 @param parent parent widget of this widget (QWidget) |
702 """ |
704 """ |
703 super().__init__(parent) |
705 super(SearchReplaceSlidingWidget, self).__init__(parent) |
704 |
706 |
705 self.__searchReplaceWidget = SearchReplaceWidget(replace, vm, self, True) |
707 self.__searchReplaceWidget = SearchReplaceWidget(replace, vm, self, True) |
706 srHeight = self.__searchReplaceWidget.height() |
708 srHeight = self.__searchReplaceWidget.height() |
707 |
709 |
708 self.__layout = QHBoxLayout(self) |
710 self.__layout = QHBoxLayout(self) |
775 Overridden slot from QWidget. |
777 Overridden slot from QWidget. |
776 |
778 |
777 @param text text to be shown in the findtext edit (string) |
779 @param text text to be shown in the findtext edit (string) |
778 """ |
780 """ |
779 self.__searchReplaceWidget.show(text) |
781 self.__searchReplaceWidget.show(text) |
780 super().show() |
782 super(SearchReplaceSlidingWidget, self).show() |
781 self.__enableScrollerButtons() |
783 self.__enableScrollerButtons() |
782 |
784 |
783 def __slideLeft(self): |
785 def __slideLeft(self): |
784 """ |
786 """ |
785 Private slot to move the widget to the left, i.e. show contents to the right. |
787 Private slot to move the widget to the left, i.e. show contents to the right. |