13 from E5Gui.E5Application import e5App |
13 from E5Gui.E5Application import e5App |
14 |
14 |
15 import UI.PixmapCache |
15 import UI.PixmapCache |
16 import Preferences |
16 import Preferences |
17 |
17 |
|
18 |
18 class LogViewer(QTextEdit): |
19 class LogViewer(QTextEdit): |
19 """ |
20 """ |
20 Class providing a specialized text edit for displaying logging information. |
21 Class providing a specialized text edit for displaying logging information. |
21 """ |
22 """ |
22 def __init__(self, parent = None): |
23 def __init__(self, parent=None): |
23 """ |
24 """ |
24 Constructor |
25 Constructor |
25 |
26 |
26 @param parent reference to the parent widget (QWidget) |
27 @param parent reference to the parent widget (QWidget) |
27 """ |
28 """ |
55 @param coord the position of the mouse pointer (QPoint) |
56 @param coord the position of the mouse pointer (QPoint) |
56 """ |
57 """ |
57 coord = self.mapToGlobal(coord) |
58 coord = self.mapToGlobal(coord) |
58 self.__menu.popup(coord) |
59 self.__menu.popup(coord) |
59 |
60 |
60 def __appendText(self, txt, error = False): |
61 def __appendText(self, txt, error=False): |
61 """ |
62 """ |
62 Public method to append text to the end. |
63 Public method to append text to the end. |
63 |
64 |
64 @param txt text to insert (string) |
65 @param txt text to insert (string) |
65 @param error flag indicating to insert error text (boolean) |
66 @param error flag indicating to insert error text (boolean) |
78 """ |
79 """ |
79 Public slot to appand text to the "stdout" tab. |
80 Public slot to appand text to the "stdout" tab. |
80 |
81 |
81 @param txt text to be appended (string) |
82 @param txt text to be appended (string) |
82 """ |
83 """ |
83 self.__appendText(txt, error = False) |
84 self.__appendText(txt, error=False) |
84 QApplication.processEvents() |
85 QApplication.processEvents() |
85 |
86 |
86 def appendToStderr(self, txt): |
87 def appendToStderr(self, txt): |
87 """ |
88 """ |
88 Public slot to appand text to the "stderr" tab. |
89 Public slot to appand text to the "stderr" tab. |
89 |
90 |
90 @param txt text to be appended (string) |
91 @param txt text to be appended (string) |
91 """ |
92 """ |
92 self.__appendText(txt, error = True) |
93 self.__appendText(txt, error=True) |
93 QApplication.processEvents() |
94 QApplication.processEvents() |
94 |
95 |
95 def preferencesChanged(self): |
96 def preferencesChanged(self): |
96 """ |
97 """ |
97 Public slot to handle a change of the preferences. |
98 Public slot to handle a change of the preferences. |