def __setupSidebars(self): """ Private method that hides the pro-level sidebars """ allLeftTabs = { "File-Browser", "Project-Viewer", "Multiproject-Viewer", "Template-Viewer", "Symbols", "File-Browser" } allBottomTabs = { "Pycom Console", "Shell", "Task-Viewer", "Numbers", "Translator", "Local Shell", "Log-Viewer" } toHideBottom = list(allBottomTabs - bottomTabsToShow) toHideLeft = list(allLeftTabs - leftTabsToShow) UiHelper.hideItemsSidebar(self.__ui.leftSidebar, toHideLeft) if Preferences.Prefs.settings.value("UI/AdvancedBottomSidebar", False) != "true": UiHelper.hideItemsSidebar(self.__ui.bottomSidebar, toHideBottom) self.__ui.leftSidebar.setMaximumWidth(300) self.__ui.bottomSidebar.setMaximumHeight(200) self.__ui.rightSidebar.hide() self.__ui.rightSidebar.clear()
def __setupSidebars(self): """ Private method that hides the pro-level sidebars """ allLeftTabs = { "File-Browser", "Project-Viewer", "Multiproject-Viewer", "Template-Viewer", "Symbols", "File-Browser" } allBottomTabs = { "Pycom Console", "Shell", "Task-Viewer", "Numbers", "Translator", "Local Shell", "Log-Viewer" } toHideBottom = list(allBottomTabs - bottomTabsToShow) toHideLeft = list(allLeftTabs - leftTabsToShow) try: UiHelper.hideItemsSidebar(self.__ui.leftSidebar, toHideLeft) self.__ui.leftSidebar.setMaximumWidth(300) except AttributeError: # most likely the leftSidebar is not initialized, which can happen on windows sometimes pass if Preferences.Prefs.settings.value("UI/AdvancedBottomSidebar", False) != "true": UiHelper.hideItemsSidebar(self.__ui.bottomSidebar, toHideBottom) self.__ui.bottomSidebar.setMaximumHeight(200) self.__ui.rightSidebar.hide() self.__ui.rightSidebar.clear()
def modifyPreferencesDialog(dlg): if Preferences.Prefs.settings.value("UI/AdvancedBottomSidebar", False) != "true": toDeleteTxt.extend(['Log-Viewer']) configList = dlg.cw.configList UiHelper.removeTreeElements(configList, toDeleteTxt)
def __on_new_editor(self, editor): menu = editor.getMenu('Languages') for action in menu.actions(): if action.text() == self.tr("Python2"): action.trigger() else: action.setChecked(False) itemstoHide = ['Revert to last saved state', 'Check spelling...', 'Check spelling of selection...', 'Remove from dictionary', 'Shorten empty lines', 'Languages', 'Encodings', 'End-of-Line Type', 'Use Monospaced Font', 'New Document View', 'New Document View (with new split)', 'Close', 'Re-Open With Encoding', 'Save', 'Save As...', 'Save Copy...'] UiHelper.hideWidgetActions(editor.menu, itemstoHide)
def __createPythonPopupMenus(self): itemsToRemove = [ "Run unittest...", "Diagrams", "Check", "Show", "Configure..." ] self.__oldCreatePythonPopupMenus() UiHelper.removeWidgetActions(self.__sourcesBrowser.sourceMenu, itemsToRemove)
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()
def __on_new_editor(self, editor): itemstoHide = [ "Autosave enabled", "Typing aids enabled", "Automatic Completion enabled", "Complete", "Calltip", "Check", "Show", "Diagrams", "Tools", "New Document View", "New Document View (with new split)", "Close", "Re-Open With Encoding", "Save", "Save As...", "Save Copy..." ] UiHelper.hideWidgetActions(editor.menu, itemstoHide)
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))
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 __setupSidebars(self): """ Private method that hides the pro-level sidebars """ allLeftTabs = { "File-Browser", "Project-Viewer", "Multiproject-Viewer", "Template-Viewer", "Symbols", "File-Browser" } allBottomTabs = { "Pycom Console", "Shell", "Task-Viewer", "Numbers", "Translator", "Local Shell", "Log-Viewer" } toHideBottom = list(allBottomTabs - bottomTabsToShow) toHideLeft = list(allLeftTabs - leftTabsToShow) UiHelper.hideItemsSidebar(self.__ui.leftSidebar, toHideLeft) UiHelper.hideItemsSidebar(self.__ui.bottomSidebar, toHideBottom)
def __setupSidebars(self): """ Private method that hides the pro-level sidebars """ allLeftTabs = { "File-Browser", "Project-Viewer", "Multiproject-Viewer", "Template-Viewer", "Symbols", "File-Browser" } allBottomTabs = { "Pycom Console", "Shell", "Task-Viewer", "Numbers", "Translator", "Local Shell", "Log-Viewer" } toHideBottom = list(allBottomTabs - bottomTabsToShow) toHideLeft = list(allLeftTabs - leftTabsToShow) try: UiHelper.hideItemsSidebar(self.__ui.leftSidebar, toHideLeft) except AttributeError: # most likely the leftSidebar is not initialized, which can happen on windows sometimes pass UiHelper.hideItemsSidebar(self.__ui.bottomSidebar, toHideBottom)
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