def __createPythonPopupMenus(self): itemsToRemove = [ "Run unittest...", "Diagrams", "Check", "Show", "Configure..." ] self.__oldCreatePythonPopupMenus() UiHelper.removeWidgetActions(self.__sourcesBrowser.sourceMenu, itemsToRemove)
def __setupMenu(self): """ Private method that hides pro-level menus and makes the others non-detachable. """ # hide unused menus for menu in ["debug", "start", "unittest", "multiproject"]: UiHelper.hideUnusedMenu(self.__ui, menu) # make menus non-detachable for menu in [ "file", "edit", "view", "project", "extras", "settings", "window", "bookmarks", "plugins", "help", "subwindow", "toolbars", "wizards", "macros" ]: UiHelper.setMenuNonDetachable(self.__ui, menu) toRemove = { "file": ["New &Window"], "edit": [ "Clear", "C&omment", "Unco&mment", "Stream Comment", "Box Comment" ], "view": ["Zoom &in", "Zoom &out", "Zoom &reset", "&Zoom", "Preview"], "project": ["Debugger", "&Version Control"], "extras": ["&Builtin Tools"], "settings": [ "Manage SSL Certificates...", "Reload &APIs", "&View Profiles...", "Edit Message Filters..." ], "subwindow": [ "&Multiproject-Viewer", "Templ&ate-Viewer", "S&ymbols-Viewer", "&Debug-Viewer", "Co&operation-Viewer", "&IRC" ], "help": [ "&Helpviewer...", "&Eric API Documentation", "&Pymakr API Documentation", "Python &3 Documentation", "Python &2 Documentation", "Qt&4 Documentation", "Qt&5 Documentation", "PyQt&4 Documentation", "PyQt&5 Documentation", "&About Pymakr", "About &Qt" ], "plugins": ["Configure..."] } for menu, items in toRemove.iteritems(): UiHelper.removeWidgetActions(self.__ui.getMenu(menu), items) toHide = { "window": ["&Right Sidebar", "Edit Profile", "Debug Profile"], } for menu, items in toHide.iteritems(): UiHelper.hideWidgetActions(self.__ui.getMenu(menu), items) # add help entries self.__addLinksIntoHelp()
def __setupMenus(self): """ Private method that hides engineer-level menus and makes the others non-detachable. """ # hide unused menus for menu in ["view", "extras", "window", "bookmarks", "plugins"]: UiHelper.hideUnusedMenu(self.__ui, menu) toRemove = { "file": [ "Open &Bookmarked Files", "Search &File...", "Save &Copy...", "Export as", "Print Preview", "&Print" ], "edit": [ "Re&vert to last saved state", "&Indent", "U&nindent", "Toggle Comment", "Convert selection to upper case", "Convert selection to lower case", "Sort", "Complete", "&Calltip", "&Goto Line...", "Goto &Brace", "Goto Last &Edit Location", "Goto Previous Method or Class", "Goto Next Method or Class", "Select to &brace", "&Deselect all", "Shorten empty lines", "Convert &Line End Characters" ], "project": [ "Session", "Add &translation...", "&Diagrams", "Chec&k", "Sho&w", "Source &Documentation", "Pac&kagers", "&Properties...", "&User Properties...", "Filetype Associations...", "Lexer Associations..." ], "settings": [ "E&xport Preferences...", "I&mport Preferences...", "Tool&bars...", "Keyboard &Shortcuts...", "&Export Keyboard Shortcuts...", "&Import Keyboard Shortcuts...", "Show external &tools" ], "help": [ "Show &Versions", "Show &downloadable versions...", "Show Error &Log..." ] } for menu, items in toRemove.iteritems(): UiHelper.removeWidgetActions(self.__ui.getMenu(menu), items) removeFromSearch = [ "&Quicksearch", "Quicksearch &backwards", "Search current word forward", "Search current word backward", "Clear search markers", "Search in &Files...", "Replace in F&iles...", "Search in Open Files...", "Replace in Open Files..." ] for el in self.__ui.getMenu("edit").actions(): if el.text() == self.__ui.tr("&Search"): UiHelper.removeWidgetActions(el.menu(), removeFromSearch) break
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))