Пример #1
0
    def __setupToolbars(self):
        self.__initLiteToolbar(self.__ui, self.__toolbars)

        for toolbar in [
                "project", "edit", "file", "quicksearch", "search", "spelling"
        ]:
            UiHelper.hideToolbar(self.__ui, toolbar)

        self.__fixToolbars()
Пример #2
0
    def __setupToolbars(self):
        """
        Private method that hides the unused toolbars
        """

        for toolbar in [
                "vcs", "start", "debug", "multiproject", "help", "unittest",
                "tools", "settings", "view_profiles", "subversion", "pysvn",
                "mercurial", "plugins", "view", "bookmarks"
        ]:
            UiHelper.hideToolbar(self.__ui, toolbar)

        toRemove = {
            "file": ["New &Window", "&Close", "Save &Copy...", "&Quit"],
            "edit": ["Clear", "C&omment", "Unco&mment"]
        }

        for toolbar, items in toRemove.iteritems():
            try:
                UiHelper.removeWidgetActions(
                    self.__ui.getToolbar(toolbar)[1], items)
            except:
                pass

        # remove separators before
        separatorsToHide = {"file": ["&New"]}

        for toolbar, items in separatorsToHide.iteritems():
            try:
                UiHelper.hideWidgetSeparator(
                    self.__ui.getToolbar(toolbar)[1], items, "before")
            except:
                pass

        # remove separators after
        separatorsToHide = {
            "file": ["New &Window", "&Open...", "&Close", "Save a&ll"],
            "edit": ["&Redo", "Clear", "&Paste"],
            "project": ["&Close"]
        }
        for toolbar, items in separatorsToHide.iteritems():
            try:
                UiHelper.hideWidgetSeparator(
                    self.__ui.getToolbar(toolbar)[1], items)
            except:
                pass

        # set toolbars size
        toResize = [
            "file", "edit", "project", "bookmarks", "quicksearch", "search",
            "spelling"
        ]
        for toolbar in toResize:
            UiHelper.setToolbarSize(self.__ui, toolbar, QSize(32, 32))