예제 #1
0
 def _addMenus(self):
     """
     Internal method to allow plugins to add menus to the main menu bar.
     """
     super(PeacockMainWindow, self)._addMenus()
     menubar = self.menuBar()
     debug_menu = menubar.addMenu("Debug")
     WidgetUtils.addAction(debug_menu, "Show Python Console", self._showConsole, "Ctrl+P", True)
예제 #2
0
 def _addMenus(self):
     """
     Internal method to allow plugins to add menus to the main menu bar.
     """
     super(PeacockMainWindow, self)._addMenus()
     menubar = self.menuBar()
     debug_menu = menubar.addMenu("Debug")
     WidgetUtils.addAction(debug_menu, "Show Python Console", self._showConsole, "Ctrl+P", True)
예제 #3
0
    def addToMenu(self, menu):
        """
        Adds menu entries specific to the Arguments to the menubar.
        """
        workingMenu = menu.addMenu("Recent &working dirs")
        self._recent_working_menu = RecentlyUsedMenu(
            workingMenu,
            "execute/recentWorkingDirs",
            "execute/maxRecentWorkingDirs",
            20,
        )
        self._recent_working_menu.selected.connect(self.setWorkingDir)
        self._workingDirChanged()

        exeMenu = menu.addMenu("Recent &executables")
        self._recent_exe_menu = RecentlyUsedMenu(
            exeMenu,
            "execute/recentExes",
            "execute/maxRecentExes",
            20,
        )
        self._recent_exe_menu.selected.connect(self.setExecutablePath)

        argsMenu = menu.addMenu("Recent &arguments")
        self._recent_args_menu = RecentlyUsedMenu(
            argsMenu,
            "execute/recentArgs",
            "execute/maxRecentArgs",
            20,
        )
        self._recent_args_menu.selected.connect(self._setExecutableArgs)
        self._force_reload_action = WidgetUtils.addAction(
            menu, "Reload executable syntax", self._reload_syntax)
        self._force_reload_action.setEnabled(False)
예제 #4
0
    def addToMenu(self, menu):
        """
        Adds menu entries specific to the Arguments to the menubar.
        """
        workingMenu = menu.addMenu("Recent &working dirs")
        self._recent_working_menu = RecentlyUsedMenu(workingMenu,
                "execute/recentWorkingDirs",
                "execute/maxRecentWorkingDirs",
                20,
                )
        self._recent_working_menu.selected.connect(self.setWorkingDir)
        self._workingDirChanged()

        exeMenu = menu.addMenu("Recent &executables")
        self._recent_exe_menu = RecentlyUsedMenu(exeMenu,
                "execute/recentExes",
                "execute/maxRecentExes",
                20,
                )
        self._recent_exe_menu.selected.connect(self.setExecutablePath)

        argsMenu = menu.addMenu("Recent &arguments")
        self._recent_args_menu = RecentlyUsedMenu(argsMenu,
                "execute/recentArgs",
                "execute/maxRecentArgs",
                20,
                )
        self._recent_args_menu.selected.connect(self._setExecutableArgs)
        self._force_reload_action = WidgetUtils.addAction(menu, "Reload executable syntax", self._reload_syntax)
        self._force_reload_action.setEnabled(False)
예제 #5
0
    def addToMenu(self, menu):
        """
        Register the menus specific to the InputTab.
        Input:
            menu[QMenu]: The menu to add the items to.
        """
        self._open_action = WidgetUtils.addAction(menu, "Open",
                                                  self._openInputFile,
                                                  "Ctrl+O")
        recentMenu = menu.addMenu("Recently opened")
        self._recently_used_menu = RecentlyUsedMenu(
            recentMenu,
            "input/recentlyUsed",
            "input/maxRecentlyUsed",
            20,
        )
        self._recently_used_menu.selected.connect(self.setInputFile)

        self._save_action = WidgetUtils.addAction(menu, "Save",
                                                  self._saveInputFile)
        self._save_as_action = WidgetUtils.addAction(menu, "Save As",
                                                     self._saveInputFileAs)
        self._clear_action = WidgetUtils.addAction(menu, "Clear",
                                                   self._clearInputFile)
        self._check_action = WidgetUtils.addAction(menu, "Check",
                                                   self._checkInputFile,
                                                   "Ctrl+K")
        self._view_file = WidgetUtils.addAction(menu,
                                                "View current input file",
                                                self._viewInputFile, "Ctrl+V",
                                                True)
        self._menus_initialized = True
        self._setMenuStatus()
예제 #6
0
 def _addMenus(self):
     """
     Internal method to allow plugins to add menus to the main menu bar.
     """
     menubar = self.menuBar()
     menubar.setNativeMenuBar(False)
     peacock_menu = menubar.addMenu("Peacock")
     WidgetUtils.addAction(peacock_menu, "View Log", self._showLog, "Ctrl+L", True)
     WidgetUtils.addAction(peacock_menu, "Preferences", self._showPreferences)
     WidgetUtils.addAction(peacock_menu, "E&xit", self.close, "Ctrl+Q", True)
     for name, plugin in self.tab_plugin._plugins.items():
         plugin.addToMainMenu(menubar)
 def _addMenus(self):
     """
     Internal method to allow plugins to add menus to the main menu bar.
     """
     menubar = self.menuBar()
     menubar.setNativeMenuBar(False)
     peacock_menu = menubar.addMenu("Peacock")
     WidgetUtils.addAction(peacock_menu, "View Log", self._showLog, "Ctrl+L", True)
     WidgetUtils.addAction(peacock_menu, "Preferences", self._showPreferences)
     WidgetUtils.addAction(peacock_menu, "E&xit", self.close, "Ctrl+Q", True)
     for name, plugin in self.tab_plugin._plugins.items():
         plugin.addToMainMenu(menubar)
예제 #8
0
    def addToMenu(self, menu):
        """
        Register the menus specific to the InputTab.
        Input:
            menu[QMenu]: The menu to add the items to.
        """
        self._open_action = WidgetUtils.addAction(menu, "Open", self._openInputFile, "Ctrl+O")
        recentMenu = menu.addMenu("Recently opened")
        self._recently_used_menu = RecentlyUsedMenu(recentMenu,
                "input/recentlyUsed",
                "input/maxRecentlyUsed",
                20,
                )
        self._recently_used_menu.selected.connect(self.setInputFile)

        self._save_action = WidgetUtils.addAction(menu, "Save", self._saveInputFile)
        self._save_as_action = WidgetUtils.addAction(menu, "Save As", self._saveInputFileAs)
        self._clear_action = WidgetUtils.addAction(menu, "Clear", self._clearInputFile)
        self._check_action = WidgetUtils.addAction(menu, "Check", self._checkInputFile, "Ctrl+K")
        self._view_file = WidgetUtils.addAction(menu, "View current input file", self._viewInputFile, "Ctrl+V", True)
        self._menus_initialized = True
        self._setMenuStatus()