17 QWidget, QHBoxLayout, QShortcut |
17 QWidget, QHBoxLayout, QShortcut |
18 from PyQt4.Qsci import QsciScintilla |
18 from PyQt4.Qsci import QsciScintilla |
19 |
19 |
20 from E5Gui.E5Application import e5App |
20 from E5Gui.E5Application import e5App |
21 |
21 |
22 from . import Lexers |
|
23 from .QsciScintillaCompat import QsciScintillaCompat |
22 from .QsciScintillaCompat import QsciScintillaCompat |
24 |
23 |
25 import Preferences |
24 import Preferences |
26 import Utilities |
25 import Utilities |
27 |
26 |
28 import UI.PixmapCache |
27 import UI.PixmapCache |
29 from UI.SearchWidget import SearchWidget |
|
30 |
|
31 from .ShellHistoryDialog import ShellHistoryDialog |
|
32 |
28 |
33 |
29 |
34 class TerminalAssembly(QWidget): |
30 class TerminalAssembly(QWidget): |
35 """ |
31 """ |
36 Class implementing the containing widget for the terminal. |
32 Class implementing the containing widget for the terminal. |
45 super().__init__(parent) |
41 super().__init__(parent) |
46 |
42 |
47 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
43 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
48 |
44 |
49 self.__terminal = Terminal(vm, self) |
45 self.__terminal = Terminal(vm, self) |
|
46 |
|
47 from UI.SearchWidget import SearchWidget |
50 self.__searchWidget = SearchWidget(self.__terminal, self) |
48 self.__searchWidget = SearchWidget(self.__terminal, self) |
51 self.__searchWidget.hide() |
49 self.__searchWidget.hide() |
52 |
50 |
53 self.__layout = QHBoxLayout(self) |
51 self.__layout = QHBoxLayout(self) |
54 self.__layout.setContentsMargins(1, 1, 1, 1) |
52 self.__layout.setContentsMargins(1, 1, 1, 1) |
297 if Utilities.isWindowsPlatform(): |
295 if Utilities.isWindowsPlatform(): |
298 self.language = "Batch" |
296 self.language = "Batch" |
299 else: |
297 else: |
300 self.language = "Bash" |
298 self.language = "Bash" |
301 if Preferences.getTerminal("SyntaxHighlightingEnabled"): |
299 if Preferences.getTerminal("SyntaxHighlightingEnabled"): |
|
300 from . import Lexers |
302 self.lexer_ = Lexers.getLexer(self.language, self) |
301 self.lexer_ = Lexers.getLexer(self.language, self) |
303 else: |
302 else: |
304 self.lexer_ = None |
303 self.lexer_ = None |
305 |
304 |
306 if self.lexer_ is None: |
305 if self.lexer_ is None: |
476 |
475 |
477 def __showHistory(self): |
476 def __showHistory(self): |
478 """ |
477 """ |
479 Private slot to show the shell history dialog. |
478 Private slot to show the shell history dialog. |
480 """ |
479 """ |
|
480 from .ShellHistoryDialog import ShellHistoryDialog |
481 dlg = ShellHistoryDialog(self.history, self.vm, self) |
481 dlg = ShellHistoryDialog(self.history, self.vm, self) |
482 if dlg.exec_() == QDialog.Accepted: |
482 if dlg.exec_() == QDialog.Accepted: |
483 self.history = dlg.getHistory() |
483 self.history = dlg.getHistory() |
484 self.histidx = -1 |
484 self.histidx = -1 |
485 |
485 |