##// END OF EJS Templates
Revert "Temporary fix to work around #1057."...
Matthias BUSSONNIER -
Show More
@@ -626,17 +626,9 b' class MainWindow(QtGui.QMainWindow):'
626 # is updated at first kernel response. Though, it is necessary when
626 # is updated at first kernel response. Though, it is necessary when
627 # connecting through X-forwarding, as in this case, the menu is not
627 # connecting through X-forwarding, as in this case, the menu is not
628 # auto updated, SO DO NOT DELETE.
628 # auto updated, SO DO NOT DELETE.
629
629 self.pop = QtGui.QAction("&Update All Magic Menu ",
630 ########################################################################
630 self, triggered=self.update_all_magic_menu)
631 ## TEMPORARILY DISABLED - see #1057 for details. Uncomment this
631 self.add_menu_action(self.all_magic_menu, self.pop)
632 ## section when a proper fix is found
633
634 ## self.pop = QtGui.QAction("&Update All Magic Menu ",
635 ## self, triggered=self.update_all_magic_menu)
636 ## self.add_menu_action(self.all_magic_menu, self.pop)
637
638 ## END TEMPORARY FIX
639 ########################################################################
640
632
641 self.reset_action = QtGui.QAction("&Reset",
633 self.reset_action = QtGui.QAction("&Reset",
642 self,
634 self,
@@ -674,49 +666,6 b' class MainWindow(QtGui.QMainWindow):'
674 triggered=self.whos_magic_active_frontend)
666 triggered=self.whos_magic_active_frontend)
675 self.add_menu_action(self.magic_menu, self.whos_action)
667 self.add_menu_action(self.magic_menu, self.whos_action)
676
668
677
678 ########################################################################
679 ## TEMPORARILY ADDED BACK - see #1057 for details. The magic menu is
680 ## supposed to be dynamic, but the mechanism merged in #1057 has a race
681 ## condition that locks up the console very often. We're putting back
682 ## the static list temporarily/ Remove this code when a proper fix is
683 ## found.
684
685 # allmagics submenu.
686
687 # for now this is just a copy and paste, but we should get this
688 # dynamically
689 magiclist = ["%alias", "%autocall", "%automagic", "%bookmark", "%cd",
690 "%clear", "%colors", "%debug", "%dhist", "%dirs", "%doctest_mode",
691 "%ed", "%edit", "%env", "%gui", "%guiref", "%hist", "%history",
692 "%install_default_config", "%install_profiles", "%less", "%load_ext",
693 "%loadpy", "%logoff", "%logon", "%logstart", "%logstate", "%logstop",
694 "%lsmagic", "%macro", "%magic", "%man", "%more", "%notebook", "%page",
695 "%pastebin", "%pdb", "%pdef", "%pdoc", "%pfile", "%pinfo", "%pinfo2",
696 "%popd", "%pprint", "%precision", "%profile", "%prun", "%psearch",
697 "%psource", "%pushd", "%pwd", "%pycat", "%pylab", "%quickref",
698 "%recall", "%rehashx", "%reload_ext", "%rep", "%rerun", "%reset",
699 "%reset_selective", "%run", "%save", "%sc", "%sx", "%tb", "%time",
700 "%timeit", "%unalias", "%unload_ext", "%who", "%who_ls", "%whos",
701 "%xdel", "%xmode"]
702
703 def make_dynamic_magic(i):
704 def inner_dynamic_magic():
705 self.active_frontend.execute(i)
706 inner_dynamic_magic.__name__ = "dynamics_magic_%s" % i
707 return inner_dynamic_magic
708
709 for magic in magiclist:
710 xaction = QtGui.QAction(magic,
711 self,
712 triggered=make_dynamic_magic(magic)
713 )
714 self.all_magic_menu.addAction(xaction)
715
716 ## END TEMPORARY FIX
717 ########################################################################
718
719
720 def init_window_menu(self):
669 def init_window_menu(self):
721 self.window_menu = self.menuBar().addMenu("&Window")
670 self.window_menu = self.menuBar().addMenu("&Window")
722 if sys.platform == 'darwin':
671 if sys.platform == 'darwin':
@@ -452,15 +452,8 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
452 self.window.add_tab_with_frontend(self.widget)
452 self.window.add_tab_with_frontend(self.widget)
453 self.window.init_menu_bar()
453 self.window.init_menu_bar()
454
454
455 # we need to populate the 'Magic Menu' once the kernel has answer at
455 # we need to populate the 'Magic Menu' once the kernel has answer at least once
456 # least once
456 self.kernel_manager.shell_channel.first_reply.connect(self.window.pop.trigger)
457
458 ########################################################################
459 ## TEMPORARILY DISABLED - see #1057 for details, uncomment the next
460 ## line when a proper fix is found:
461 ## self.kernel_manager.shell_channel.first_reply.connect(self.window.pop.trigger)
462 ## END TEMPORARY FIX
463 ########################################################################
464
457
465 self.window.setWindowTitle('Python' if self.pure else 'IPython')
458 self.window.setWindowTitle('Python' if self.pure else 'IPython')
466
459
General Comments 0
You need to be logged in to leave comments. Login now