--- a/src/eric7/Plugins/ViewManagerPlugins/Tabview/Tabview.py Tue Oct 18 16:05:20 2022 +0200 +++ b/src/eric7/Plugins/ViewManagerPlugins/Tabview/Tabview.py Tue Oct 18 16:06:21 2022 +0200 @@ -31,21 +31,20 @@ QLabel, ) -from EricWidgets.EricApplication import ericApp - -from ViewManager.ViewManager import ViewManager +from eric7.EricWidgets.EricApplication import ericApp -import QScintilla.Editor -from QScintilla.Editor import Editor -from QScintilla.EditorAssembly import EditorAssembly +from eric7.ViewManager.ViewManager import ViewManager + +from eric7.QScintilla.Editor import Editor +from eric7.QScintilla.EditorAssembly import EditorAssembly -import UI.PixmapCache +from eric7.EricGui import EricPixmapCache -from EricWidgets.EricTabWidget import EricTabWidget, EricWheelTabBar -from EricWidgets.EricLed import EricLed +from eric7.EricWidgets.EricTabWidget import EricTabWidget, EricWheelTabBar +from eric7.EricWidgets.EricLed import EricLed -import Preferences -from Globals import isMacPlatform +from eric7 import Preferences +from eric7.Globals import isMacPlatform from eric7config import getConfig @@ -220,7 +219,7 @@ self.__navigationMenu.triggered.connect(self.__navigationMenuTriggered) self.navigationButton = QToolButton(self) - self.navigationButton.setIcon(UI.PixmapCache.getIcon("1downarrow")) + self.navigationButton.setIcon(EricPixmapCache.getIcon("1downarrow")) self.navigationButton.setToolTip(self.tr("Show a navigation menu")) self.navigationButton.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup) self.navigationButton.setMenu(self.__navigationMenu) @@ -244,7 +243,7 @@ self.emptyLabel.setAlignment( Qt.AlignmentFlag.AlignVCenter | Qt.AlignmentFlag.AlignHCenter ) - super().addTab(self.emptyLabel, UI.PixmapCache.getIcon("empty"), "") + super().addTab(self.emptyLabel, EricPixmapCache.getIcon("empty"), "") def __initMenu(self): """ @@ -252,70 +251,70 @@ """ self.__startMenu = QMenu(self.tr("Start"), self) self.__startMenu.addAction( - UI.PixmapCache.getIcon("runScript"), + EricPixmapCache.getIcon("runScript"), self.tr("Run Script..."), self.__contextMenuRunScript, ) self.__startMenu.addAction( - UI.PixmapCache.getIcon("debugScript"), + EricPixmapCache.getIcon("debugScript"), self.tr("Debug Script..."), self.__contextMenuDebugScript, ) self.__startMenu.addAction( - UI.PixmapCache.getIcon("profileScript"), + EricPixmapCache.getIcon("profileScript"), self.tr("Profile Script..."), self.__contextMenuProfileScript, ) self.__startMenu.addAction( - UI.PixmapCache.getIcon("coverageScript"), + EricPixmapCache.getIcon("coverageScript"), self.tr("Coverage run of Script..."), self.__contextMenuCoverageScript, ) self.__menu = QMenu(self) self.leftMenuAct = self.__menu.addAction( - UI.PixmapCache.getIcon("1leftarrow"), + EricPixmapCache.getIcon("1leftarrow"), self.tr("Move Left"), self.__contextMenuMoveLeft, ) self.rightMenuAct = self.__menu.addAction( - UI.PixmapCache.getIcon("1rightarrow"), + EricPixmapCache.getIcon("1rightarrow"), self.tr("Move Right"), self.__contextMenuMoveRight, ) self.firstMenuAct = self.__menu.addAction( - UI.PixmapCache.getIcon("2leftarrow"), + EricPixmapCache.getIcon("2leftarrow"), self.tr("Move First"), self.__contextMenuMoveFirst, ) self.lastMenuAct = self.__menu.addAction( - UI.PixmapCache.getIcon("2rightarrow"), + EricPixmapCache.getIcon("2rightarrow"), self.tr("Move Last"), self.__contextMenuMoveLast, ) self.__menu.addSeparator() self.__menu.addAction( - UI.PixmapCache.getIcon("tabClose"), + EricPixmapCache.getIcon("tabClose"), self.tr("Close"), self.__contextMenuClose, ) self.closeOthersMenuAct = self.__menu.addAction( - UI.PixmapCache.getIcon("tabCloseOther"), + EricPixmapCache.getIcon("tabCloseOther"), self.tr("Close Others"), self.__contextMenuCloseOthers, ) self.__menu.addAction(self.tr("Close All"), self.__contextMenuCloseAll) self.__menu.addSeparator() self.saveMenuAct = self.__menu.addAction( - UI.PixmapCache.getIcon("fileSave"), self.tr("Save"), self.__contextMenuSave + EricPixmapCache.getIcon("fileSave"), self.tr("Save"), self.__contextMenuSave ) self.__menu.addAction( - UI.PixmapCache.getIcon("fileSaveAs"), + EricPixmapCache.getIcon("fileSaveAs"), self.tr("Save As..."), self.__contextMenuSaveAs, ) self.__menu.addAction( - UI.PixmapCache.getIcon("fileSaveAll"), + EricPixmapCache.getIcon("fileSaveAll"), self.tr("Save All"), self.__contextMenuSaveAll, ) @@ -327,12 +326,12 @@ self.__startAct = self.__menu.addMenu(self.__startMenu) self.__menu.addSeparator() self.__menu.addAction( - UI.PixmapCache.getIcon("printPreview"), + EricPixmapCache.getIcon("printPreview"), self.tr("Print Preview"), self.__contextMenuPrintPreviewFile, ) self.__menu.addAction( - UI.PixmapCache.getIcon("print"), + EricPixmapCache.getIcon("print"), self.tr("Print"), self.__contextMenuPrintFile, ) @@ -426,7 +425,7 @@ @type str """ editor = assembly.getEditor() - super().addTab(assembly, UI.PixmapCache.getIcon("empty"), title) + super().addTab(assembly, EricPixmapCache.getIcon("empty"), title) self.setTabsClosable(True) self.navigationButton.setEnabled(True) @@ -456,7 +455,7 @@ """ editor = assembly.getEditor() newIndex = super().insertTab( - index, assembly, UI.PixmapCache.getIcon("empty"), title + index, assembly, EricPixmapCache.getIcon("empty"), title ) self.setTabsClosable(True) self.navigationButton.setEnabled(True) @@ -513,7 +512,7 @@ @param editor reference to the editor @type Editor """ - if editor and isinstance(editor, QScintilla.Editor.Editor): + if editor and isinstance(editor, Editor): fn = editor.getFileName() if fn: self.vm.editorLineChanged.emit(fn, lineno + 1) @@ -526,7 +525,7 @@ @param widget widget to be removed @type QWidget """ - if isinstance(widget, QScintilla.Editor.Editor): + if isinstance(widget, Editor): widget.cursorLineChanged.disconnect() widget.captionChanged.disconnect() self.editors.remove(widget) @@ -537,7 +536,7 @@ self.removeTab(index) if not self.editors: - super().addTab(self.emptyLabel, UI.PixmapCache.getIcon("empty"), "") + super().addTab(self.emptyLabel, EricPixmapCache.getIcon("empty"), "") self.emptyLabel.show() self.setTabsClosable(False) self.navigationButton.setEnabled(False) @@ -642,7 +641,7 @@ @return tab index of the editor @rtype int """ - if isinstance(widget, QScintilla.Editor.Editor): + if isinstance(widget, Editor): widget = widget.parent() return super().indexOf(widget) @@ -1224,7 +1223,7 @@ keys.append("warning22") if not keys: keys.append("empty") - tw.setTabIcon(index, UI.PixmapCache.getCombinedIcon(keys)) + tw.setTabIcon(index, EricPixmapCache.getCombinedIcon(keys)) self._checkActions(editor) def _syntaxErrorToggled(self, editor): @@ -1247,7 +1246,7 @@ keys.append("warning22") if not keys: keys.append("empty") - tw.setTabIcon(index, UI.PixmapCache.getCombinedIcon(keys)) + tw.setTabIcon(index, EricPixmapCache.getCombinedIcon(keys)) ViewManager._syntaxErrorToggled(self, editor) @@ -1460,7 +1459,7 @@ switched = ( self.currentTabWidget.widget(index) is self.activeWindow() ) - elif isinstance(watched, QScintilla.Editor.Editor): + elif isinstance(watched, Editor): for tw in self.tabWidgets: if tw.hasEditor(watched): switched = tw is not self.currentTabWidget @@ -1496,7 +1495,7 @@ for tabWidget in self.tabWidgets: for index in range(tabWidget.count()): editor = tabWidget.widget(index) - if isinstance(editor, QScintilla.Editor.Editor): + if isinstance(editor, Editor): fn = editor.getFileName() if fn: if self.filenameOnly: