Show More
@@ -620,8 +620,7 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):' | |||
|
620 | 620 | |
|
621 | 621 | # Remove any trailing newline, which confuses the GUI and forces the |
|
622 | 622 | # user to backspace. |
|
623 | if not text: | |
|
624 | text = QtGui.QApplication.clipboard().text(mode).rstrip() | |
|
623 | text = QtGui.QApplication.clipboard().text(mode).rstrip() | |
|
625 | 624 | self._insert_plain_text_into_buffer(cursor, dedent(text)) |
|
626 | 625 | |
|
627 | 626 | def print_(self, printer = None): |
@@ -872,17 +871,17 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):' | |||
|
872 | 871 | """ |
|
873 | 872 | menu = QtGui.QMenu(self) |
|
874 | 873 | |
|
875 | cut_action = menu.addAction('Cut', self.cut) | |
|
876 | cut_action.setEnabled(self.can_cut()) | |
|
877 | cut_action.setShortcut(QtGui.QKeySequence.Cut) | |
|
874 | self.cut_action = menu.addAction('Cut', self.cut) | |
|
875 | self.cut_action.setEnabled(self.can_cut()) | |
|
876 | self.cut_action.setShortcut(QtGui.QKeySequence.Cut) | |
|
878 | 877 | |
|
879 | copy_action = menu.addAction('Copy', self.copy) | |
|
880 | copy_action.setEnabled(self.can_copy()) | |
|
881 | copy_action.setShortcut(QtGui.QKeySequence.Copy) | |
|
878 | self.copy_action = menu.addAction('Copy', self.copy) | |
|
879 | self.copy_action.setEnabled(self.can_copy()) | |
|
880 | self.copy_action.setShortcut(QtGui.QKeySequence.Copy) | |
|
882 | 881 | |
|
883 | paste_action = menu.addAction('Paste', self.paste) | |
|
884 | paste_action.setEnabled(self.can_paste()) | |
|
885 | paste_action.setShortcut(QtGui.QKeySequence.Paste) | |
|
882 | self.paste_action = menu.addAction('Paste', self.paste) | |
|
883 | self.paste_action.setEnabled(self.can_paste()) | |
|
884 | self.paste_action.setShortcut(QtGui.QKeySequence.Paste) | |
|
886 | 885 | |
|
887 | 886 | menu.addSeparator() |
|
888 | 887 | menu.addAction(self.select_all_action) |
@@ -204,9 +204,6 b' class HistoryConsoleWidget(ConsoleWidget):' | |||
|
204 | 204 | """ |
|
205 | 205 | return self._history[-n:] |
|
206 | 206 | |
|
207 | def history_magic(self): | |
|
208 | self.execute("%history") | |
|
209 | ||
|
210 | 207 | def _request_update_session_history_length(self): |
|
211 | 208 | msg_id = self.kernel_manager.shell_channel.execute('', |
|
212 | 209 | silent=True, |
@@ -326,7 +326,6 b' class MainWindow(QtGui.QMainWindow):' | |||
|
326 | 326 | #create menu in the order they should appear in the menu bar |
|
327 | 327 | self.file_menu = self.menuBar().addMenu("&File") |
|
328 | 328 | self.edit_menu = self.menuBar().addMenu("&Edit") |
|
329 | self.font_menu = self.menuBar().addMenu("F&ont") | |
|
330 | 329 | self.window_menu = self.menuBar().addMenu("&Window") |
|
331 | 330 | self.magic_menu = self.menuBar().addMenu("&Magic") |
|
332 | 331 | self.all_magic_menu = self.magic_menu.addMenu("&All Magic") |
@@ -362,6 +361,29 b' class MainWindow(QtGui.QMainWindow):' | |||
|
362 | 361 | ) |
|
363 | 362 | self.file_menu.addAction(self.select_all_action) |
|
364 | 363 | |
|
364 | self.paste_action = QtGui.QAction("&Paste", | |
|
365 | self, | |
|
366 | shortcut=QtGui.QKeySequence.Paste, | |
|
367 | triggered=self.paste_active_frontend | |
|
368 | ) | |
|
369 | self.edit_menu.addAction(self.paste_action) | |
|
370 | ||
|
371 | self.copy_action = QtGui.QAction("&Copy", | |
|
372 | self, | |
|
373 | shortcut=QtGui.QKeySequence.Copy, | |
|
374 | triggered=self.copy_active_frontend | |
|
375 | ) | |
|
376 | self.edit_menu.addAction(self.copy_action) | |
|
377 | ||
|
378 | self.cut_action = QtGui.QAction("&Cut", | |
|
379 | self, | |
|
380 | shortcut=QtGui.QKeySequence.Cut, | |
|
381 | triggered=self.cut_active_frontend | |
|
382 | ) | |
|
383 | self.edit_menu.addAction(self.cut_action) | |
|
384 | ||
|
385 | self.edit_menu.addSeparator() | |
|
386 | ||
|
365 | 387 | self.undo_action = QtGui.QAction("&Undo", |
|
366 | 388 | self, |
|
367 | 389 | shortcut="Ctrl+Z", |
@@ -377,26 +399,30 b' class MainWindow(QtGui.QMainWindow):' | |||
|
377 | 399 | triggered=self.redo_active_frontend) |
|
378 | 400 | self.edit_menu.addAction(self.redo_action) |
|
379 | 401 | |
|
402 | self.window_menu.addSeparator() | |
|
403 | ||
|
380 | 404 | self.increase_font_size = QtGui.QAction("&Increase Font Size", |
|
381 | 405 | self, |
|
382 | 406 | shortcut="Ctrl++", |
|
383 | 407 | triggered=self.increase_font_size_active_frontend |
|
384 | 408 | ) |
|
385 |
self. |
|
|
409 | self.window_menu.addAction(self.increase_font_size) | |
|
386 | 410 | |
|
387 | 411 | self.decrease_font_size = QtGui.QAction("&Decrease Font Size", |
|
388 | 412 | self, |
|
389 | 413 | shortcut="Ctrl+-", |
|
390 | 414 | triggered=self.decrease_font_size_active_frontend |
|
391 | 415 | ) |
|
392 |
self. |
|
|
416 | self.window_menu.addAction(self.decrease_font_size) | |
|
393 | 417 | |
|
394 | 418 | self.reset_font_size = QtGui.QAction("&Reset Font Size", |
|
395 | 419 | self, |
|
396 | 420 | shortcut="Ctrl+0", |
|
397 | 421 | triggered=self.reset_font_size_active_frontend |
|
398 | 422 | ) |
|
399 |
self. |
|
|
423 | self.window_menu.addAction(self.reset_font_size) | |
|
424 | ||
|
425 | self.window_menu.addSeparator() | |
|
400 | 426 | |
|
401 | 427 | self.reset_action = QtGui.QAction("&Reset", |
|
402 | 428 | self, |
@@ -416,11 +442,12 b' class MainWindow(QtGui.QMainWindow):' | |||
|
416 | 442 | triggered=self.save_magic_active_frontend) |
|
417 | 443 | self.magic_menu.addAction(self.save_action) |
|
418 | 444 | |
|
419 | self.clear_action = QtGui.QAction("&Clear", | |
|
445 | self.clear_action = QtGui.QAction("&Clear Screen", | |
|
420 | 446 | self, |
|
447 | shortcut='Ctrl+L', | |
|
421 | 448 | statusTip="Clear the console", |
|
422 | 449 | triggered=self.clear_magic_active_frontend) |
|
423 |
self. |
|
|
450 | self.window_menu.addAction(self.clear_action) | |
|
424 | 451 | |
|
425 | 452 | self.who_action = QtGui.QAction("&Who", |
|
426 | 453 | self, |
@@ -482,6 +509,14 b' class MainWindow(QtGui.QMainWindow):' | |||
|
482 | 509 | ) |
|
483 | 510 | self.all_magic_menu.addAction(xaction) |
|
484 | 511 | |
|
512 | def cut_active_frontend(self): | |
|
513 | self.active_frontend.cut_action.trigger() | |
|
514 | ||
|
515 | def copy_active_frontend(self): | |
|
516 | self.active_frontend.copy_action.trigger() | |
|
517 | ||
|
518 | def paste_active_frontend(self): | |
|
519 | self.active_frontend.paste_action.trigger() | |
|
485 | 520 | |
|
486 | 521 | def undo_active_frontend(self): |
|
487 | 522 | self.active_frontend.undo() |
@@ -493,7 +528,7 b' class MainWindow(QtGui.QMainWindow):' | |||
|
493 | 528 | self.active_frontend.execute("%reset") |
|
494 | 529 | |
|
495 | 530 | def history_magic_active_frontend(self): |
|
496 |
self.active_frontend. |
|
|
531 | self.active_frontend.execute("%history") | |
|
497 | 532 | |
|
498 | 533 | def save_magic_active_frontend(self): |
|
499 | 534 | self.active_frontend.save_magic() |
@@ -608,7 +643,7 b' aliases.update(qt_aliases)' | |||
|
608 | 643 | class IPythonQtConsoleApp(BaseIPythonApplication): |
|
609 | 644 | name = 'ipython-qtconsole' |
|
610 | 645 | default_config_file_name='ipython_config.py' |
|
611 | ||
|
646 | ||
|
612 | 647 | description = """ |
|
613 | 648 | The IPython QtConsole. |
|
614 | 649 | |
@@ -1012,11 +1047,14 b' class IPythonQtConsoleApp(BaseIPythonApplication):' | |||
|
1012 | 1047 | statusTip="Toggle between Fullscreen and Normal Size", |
|
1013 | 1048 | triggered=self.toggleFullScreen) |
|
1014 | 1049 | |
|
1050 | ||
|
1051 | ||
|
1015 | 1052 | self.tabAndNewKernelAct =QtGui.QAction("Tab with &New kernel", |
|
1016 | 1053 | self.window, |
|
1017 | 1054 | shortcut="Ctrl+T", |
|
1018 | 1055 | triggered=self.create_tab_with_new_frontend) |
|
1019 | 1056 | self.window.window_menu.addAction(self.tabAndNewKernelAct) |
|
1057 | ||
|
1020 | 1058 | self.tabSameKernalAct =QtGui.QAction("Tab with Sa&me kernel", |
|
1021 | 1059 | self.window, |
|
1022 | 1060 | shortcut="Ctrl+Shift+T", |
@@ -1059,6 +1097,22 b' class IPythonQtConsoleApp(BaseIPythonApplication):' | |||
|
1059 | 1097 | # that it can still be triggerd by shortcut |
|
1060 | 1098 | self.window.addAction(self.fullScreenAct) |
|
1061 | 1099 | |
|
1100 | # Don't activate toggleMenubar on mac, doen't work, | |
|
1101 | # as toolbar always here | |
|
1102 | self.toggle_menu_bar_act = QtGui.QAction("&Toggle Menu Bar", | |
|
1103 | self.window, | |
|
1104 | shortcut="Ctrl+Meta+H", | |
|
1105 | statusTip="Toggle menubar betwin visible and not", | |
|
1106 | triggered=self.toggle_menu_bar) | |
|
1107 | self.window_menu.addAction(self.toggle_menu_bar_act) | |
|
1108 | ||
|
1109 | def toggle_menu_bar(self): | |
|
1110 | menu_bar = self.window.menuBar(); | |
|
1111 | if not menu_bar.isVisible(): | |
|
1112 | menu_bar.setVisible(False) | |
|
1113 | else: | |
|
1114 | menu_bar.setVisible(True) | |
|
1115 | ||
|
1062 | 1116 | def toggleMinimized(self): |
|
1063 | 1117 | if not self.window.isMinimized(): |
|
1064 | 1118 | self.window.showMinimized() |
General Comments 0
You need to be logged in to leave comments.
Login now