##// END OF EJS Templates
qtconsole : allow copy with shortcut in pager...
Matthias BUSSONNIER -
Show More
@@ -441,7 +441,12 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
441 441 def copy(self):
442 442 """ Copy the currently selected text to the clipboard.
443 443 """
444 if self.layout().currentWidget() == self._page_control :
445 self._page_control.copy()
446 elif self.layout().currentWidget() == self._control :
444 447 self._control.copy()
448 else :
449 self.log.debug("console widget: unknown copy target")
445 450
446 451 def cut(self):
447 452 """ Copy the currently selected text to the clipboard and delete it
@@ -174,11 +174,16 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):'
174 174 def copy(self):
175 175 """ Copy the currently selected text to the clipboard, removing prompts.
176 176 """
177 if self.layout().currentWidget() == self._page_control :
178 self._page_control.copy()
179 elif self.layout().currentWidget() == self._control :
177 180 text = self._control.textCursor().selection().toPlainText()
178 181 if text:
179 182 lines = map(transform_classic_prompt, text.splitlines())
180 183 text = '\n'.join(lines)
181 184 QtGui.QApplication.clipboard().setText(text)
185 else:
186 self.log.debug("frontend widget : unknown copy target")
182 187
183 188 #---------------------------------------------------------------------------
184 189 # 'ConsoleWidget' abstract interface
@@ -267,11 +267,17 b' class IPythonWidget(FrontendWidget):'
267 267 """ Copy the currently selected text to the clipboard, removing prompts
268 268 if possible.
269 269 """
270 if self.layout().currentWidget() == self._page_control :
271 self._page_control.copy()
272 elif self.layout().currentWidget() == self._control :
270 273 text = self._control.textCursor().selection().toPlainText()
271 274 if text:
272 275 lines = map(transform_ipy_prompt, text.splitlines())
273 276 text = '\n'.join(lines)
274 277 QtGui.QApplication.clipboard().setText(text)
278 else :
279 self.log.debug("ipython_widget : unknown copy taget")
280
275 281
276 282 #---------------------------------------------------------------------------
277 283 # 'FrontendWidget' public interface
@@ -795,7 +795,6 b' class MainWindow(QtGui.QMainWindow):'
795 795
796 796 def copy_active_frontend(self):
797 797 widget = self.active_frontend
798 if widget.can_copy():
799 798 widget.copy()
800 799
801 800 def copy_raw_active_frontend(self):
General Comments 0
You need to be logged in to leave comments. Login now