93 @signal searchStringFound(found) emitted to indicate the search |
93 @signal searchStringFound(found) emitted to indicate the search |
94 result (boolean) |
94 result (boolean) |
95 """ |
95 """ |
96 searchStringFound = pyqtSignal(bool) |
96 searchStringFound = pyqtSignal(bool) |
97 |
97 |
98 def __init__(self, dbs, vm, parent=None): |
98 def __init__(self, dbs, vm, windowedVariant, parent=None): |
99 """ |
99 """ |
100 Constructor |
100 Constructor |
101 |
101 |
102 @param dbs reference to the debug server object |
102 @param dbs reference to the debug server object |
103 @param vm reference to the viewmanager object |
103 @param vm reference to the viewmanager object |
104 @param parent parent widget (QWidget) |
104 @param parent parent widget (QWidget) |
|
105 @param windowedVariant flag indicating the shell window variant |
|
106 (boolean) |
105 """ |
107 """ |
106 super(Shell, self).__init__(parent) |
108 super(Shell, self).__init__(parent) |
107 self.setUtf8(True) |
109 self.setUtf8(True) |
108 |
110 |
109 self.vm = vm |
111 self.vm = vm |
110 self.__mainWindow = parent |
112 self.__mainWindow = parent |
111 self.__lastSearch = () |
113 self.__lastSearch = () |
|
114 self.__windowed = windowedVariant |
112 |
115 |
113 self.linesepRegExp = r"\r\n|\n|\r" |
116 self.linesepRegExp = r"\r\n|\n|\r" |
114 |
117 |
|
118 # TODO: change this for Shell Window |
115 self.passive = Preferences.getDebugger("PassiveDbgEnabled") |
119 self.passive = Preferences.getDebugger("PassiveDbgEnabled") |
116 if self.passive: |
120 if self.passive: |
117 self.setWindowTitle(self.tr('Shell - Passive')) |
121 self.setWindowTitle(self.tr('Shell - Passive')) |
118 else: |
122 else: |
119 self.setWindowTitle(self.tr('Shell')) |
123 self.setWindowTitle(self.tr('Shell')) |
120 |
124 |
121 self.setWhatsThis(self.tr( |
125 if self.__windowed: |
122 """<b>The Shell Window</b>""" |
126 self.setWhatsThis(self.tr( |
123 """<p>This is simply an interpreter running in a window. The""" |
127 """<b>The Shell Window</b>""" |
124 """ interpreter is the one that is used to run the program""" |
128 """<p>You can use the cursor keys while entering commands.""" |
125 """ being debugged. This means that you can execute any command""" |
129 """ There is also a history of commands that can be recalled""" |
126 """ while the program being debugged is running.</p>""" |
130 """ using the up and down cursor keys. Pressing the up or""" |
127 """<p>You can use the cursor keys while entering commands. There""" |
131 """ down key after some text has been entered will start an""" |
128 """ is also a history of commands that can be recalled using the""" |
132 """ incremental search.</p>""" |
129 """ up and down cursor keys. Pressing the up or down key after""" |
133 """<p>The shell has some special commands. 'reset' kills the""" |
130 """ some text has been entered will start an incremental search.""" |
134 """ shell and starts a new one. 'clear' clears the display""" |
131 """</p>""" |
135 """ of the shell window. 'start' is used to switch the shell""" |
132 """<p>The shell has some special commands. 'reset' kills the""" |
136 """ language and must be followed by a supported language.""" |
133 """ shell and starts a new one. 'clear' clears the display of""" |
137 """ Supported languages are listed by the 'languages'""" |
134 """ the shell window. 'start' is used to switch the shell""" |
138 """ command. These commands (except 'languages') are""" |
135 """ language and must be followed by a supported language.""" |
139 """ available through the context menu as well.</p>""" |
136 """ Supported languages are listed by the 'languages' command.""" |
140 """<p>Pressing the Tab key after some text has been entered""" |
137 """ These commands (except 'languages') are available through""" |
141 """ will show a list of possible completions. The relevant""" |
138 """ the context menu as well.</p>""" |
142 """ entry may be selected from this list. If only one entry""" |
139 """<p>Pressing the Tab key after some text has been entered will""" |
143 """ is available, this will be inserted automatically.</p>""" |
140 """ show a list of possible commandline completions. The""" |
144 )) |
141 """ relevant entry may be selected from this list. If only one""" |
145 else: |
142 """ entry is available, this will inserted automatically.</p>""" |
146 self.setWhatsThis(self.tr( |
143 """<p>In passive debugging mode the shell is only available""" |
147 """<b>The Shell Window</b>""" |
144 """ after the program to be debugged has connected to the IDE""" |
148 """<p>This is simply an interpreter running in a window. The""" |
145 """ until it has finished. This is indicated by a different""" |
149 """ interpreter is the one that is used to run the program""" |
146 """ prompt and by an indication in the window caption.</p>""" |
150 """ being debugged. This means that you can execute any""" |
147 )) |
151 """ command while the program being debugged is running.</p>""" |
|
152 """<p>You can use the cursor keys while entering commands.""" |
|
153 """ There is also a history of commands that can be recalled""" |
|
154 """ using the up and down cursor keys. Pressing the up or""" |
|
155 """ down key after some text has been entered will start an""" |
|
156 """ incremental search.</p>""" |
|
157 """<p>The shell has some special commands. 'reset' kills the""" |
|
158 """ shell and starts a new one. 'clear' clears the display""" |
|
159 """ of the shell window. 'start' is used to switch the shell""" |
|
160 """ language and must be followed by a supported language.""" |
|
161 """ Supported languages are listed by the 'languages'""" |
|
162 """ command. These commands (except 'languages') are""" |
|
163 """ available through the context menu as well.</p>""" |
|
164 """<p>Pressing the Tab key after some text has been entered""" |
|
165 """ will show a list of possible completions. The relevant""" |
|
166 """ entry may be selected from this list. If only one entry""" |
|
167 """ is available, this will be inserted automatically.</p>""" |
|
168 """<p>In passive debugging mode the shell is only available""" |
|
169 """ after the program to be debugged has connected to the""" |
|
170 """ IDE until it has finished. This is indicated by a""" |
|
171 """ different prompt and by an indication in the window""" |
|
172 """ caption.</p>""" |
|
173 )) |
148 |
174 |
149 self.userListActivated.connect(self.__completionListSelected) |
175 self.userListActivated.connect(self.__completionListSelected) |
150 self.linesChanged.connect(self.__resizeLinenoMargin) |
176 self.linesChanged.connect(self.__resizeLinenoMargin) |
151 |
177 |
152 self.__showStdOutErr = Preferences.getShell("ShowStdOutErr") |
178 if self.__windowed: |
|
179 self.__showStdOutErr = True |
|
180 else: |
|
181 self.__showStdOutErr = Preferences.getShell("ShowStdOutErr") |
153 if self.__showStdOutErr: |
182 if self.__showStdOutErr: |
154 dbs.clientProcessStdout.connect(self.__writeStdOut) |
183 dbs.clientProcessStdout.connect(self.__writeStdOut) |
155 dbs.clientProcessStderr.connect(self.__writeStdErr) |
184 dbs.clientProcessStderr.connect(self.__writeStdErr) |
156 dbs.clientOutput.connect(self.__write) |
185 dbs.clientOutput.connect(self.__write) |
157 dbs.clientStatement.connect(self.__clientStatement) |
186 dbs.clientStatement.connect(self.__clientStatement) |