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