|
16 | 16 | import platform |
17 | 17 |
|
18 | 18 | from spyderlib.qt.QtGui import (QApplication, QMainWindow, QWidget, QLineEdit, |
19 | | - QHBoxLayout, QDockWidget, QFont, QVBoxLayout, |
20 | | - QColor, QAbstractItemView, QProgressDialog, |
21 | | - QTableView, QMessageBox, QPushButton, QLabel, |
22 | | - QTabWidget, QToolTip, QDesktopServices) |
| 19 | + QHBoxLayout, QVBoxLayout, QColor, QMessageBox, |
| 20 | + QAbstractItemView, QProgressDialog, QTableView, |
| 21 | + QPushButton, QLabel, QTabWidget, QToolTip, |
| 22 | + QDesktopServices) |
23 | 23 | from spyderlib.qt.QtCore import (Qt, QAbstractTableModel, QModelIndex, SIGNAL, |
24 | 24 | QThread, QTimer, QUrl) |
25 | 25 | from spyderlib.qt.compat import (to_qvariant, getopenfilenames, |
26 | 26 | getexistingdirectory) |
27 | 27 | import spyderlib.qt |
28 | 28 |
|
29 | | -from spyderlib.widgets.internalshell import InternalShell |
30 | 29 | from spyderlib.utils.qthelpers import (add_actions, create_action, keybinding, |
31 | 30 | get_std_icon, action2button, |
32 | 31 | mimedata2url) |
33 | | -from spyderlib.utils.windows import set_attached_console_visible |
34 | 32 | from spyderlib.utils import encoding |
35 | 33 |
|
36 | 34 | # Local imports |
@@ -277,7 +275,6 @@ def __init__(self, parent): |
277 | 275 | self.browse_btn = None |
278 | 276 | self.label = None |
279 | 277 | self.line_edit = None |
280 | | - self.console = None |
281 | 278 | self.setup_widget() |
282 | 279 |
|
283 | 280 | def set_distribution(self, path): |
@@ -308,9 +305,7 @@ def select_directory(self): |
308 | 305 | if not osp.isdir(basedir): |
309 | 306 | basedir = getcwd() |
310 | 307 | while True: |
311 | | - self.console.emit(SIGNAL('redirect_stdio(bool)'), False) |
312 | 308 | directory = getexistingdirectory(self, self.TITLE, basedir) |
313 | | - self.console.emit(SIGNAL('redirect_stdio(bool)'), True) |
314 | 309 | if not directory: |
315 | 310 | break |
316 | 311 | if not utils.is_python_distribution(directory): |
@@ -361,7 +356,6 @@ def __init__(self): |
361 | 356 | self.selector = None |
362 | 357 | self.table = None |
363 | 358 | self.untable = None |
364 | | - self.console = None |
365 | 359 |
|
366 | 360 | self.basedir = None |
367 | 361 |
|
@@ -420,27 +414,6 @@ def setup_window(self): |
420 | 414 | vlayout.addWidget(self.tabwidget) |
421 | 415 | central_widget.setLayout(vlayout) |
422 | 416 | self.setCentralWidget(central_widget) |
423 | | - |
424 | | - # Create the console widget |
425 | | - font = QFont("Courier new") |
426 | | - font.setPointSize(8) |
427 | | - self.console = self.selector.console = cons = InternalShell(self) |
428 | | - #self.console.interpreter.restore_stds() |
429 | | - |
430 | | - # Setup the console widget |
431 | | - cons.set_font(font) |
432 | | - cons.set_codecompletion_auto(True) |
433 | | - cons.set_calltips(True) |
434 | | - cons.setup_calltips(size=600, font=font) |
435 | | - cons.setup_completion(size=(300, 180), font=font) |
436 | | - console_dock = QDockWidget("Console", self) |
437 | | - console_dock.setWidget(cons) |
438 | | - console_dock.hide() |
439 | | - self.connect(cons, SIGNAL('traceback_available()'), |
440 | | - console_dock.show) |
441 | | - |
442 | | - # Add the console widget to window as a dockwidget |
443 | | - self.addDockWidget(Qt.BottomDockWidgetArea, console_dock) |
444 | 417 |
|
445 | 418 | # Install tab |
446 | 419 | add_action = create_action(self, "&Add packages...", |
@@ -491,9 +464,9 @@ def setup_window(self): |
491 | 464 | add_actions(option_menu, (register_action,)) |
492 | 465 |
|
493 | 466 | # View menu |
494 | | - view_menu = self.menuBar().addMenu("&View") |
495 | | - popmenu = self.createPopupMenu() |
496 | | - add_actions(view_menu, popmenu.actions()) |
| 467 | +# view_menu = self.menuBar().addMenu("&View") |
| 468 | +# popmenu = self.createPopupMenu() |
| 469 | +# add_actions(view_menu, popmenu.actions()) |
497 | 470 |
|
498 | 471 | # Help menu |
499 | 472 | about_action = create_action(self, "About %s..." % self.NAME, |
@@ -717,14 +690,9 @@ def about(self): |
717 | 690 | python_distribution_infos(), |
718 | 691 | platform.python_version(), spyderlib.qt.QtCore.__version__, |
719 | 692 | spyderlib.qt.API_NAME, spyderlib.qt.__version__,) ) |
720 | | - |
721 | | - def closeEvent(self, event): |
722 | | - self.console.exit_interpreter() |
723 | | - event.accept() |
724 | 693 |
|
725 | 694 |
|
726 | 695 | def main(test=False): |
727 | | - set_attached_console_visible(False) |
728 | 696 | app = QApplication([]) |
729 | 697 | win = PMWindow() |
730 | 698 | win.show() |
|
0 commit comments