diff -r 45e7bb09c120 -r 80c06d472826 src/eric7/QScintilla/MiniEditor.py --- a/src/eric7/QScintilla/MiniEditor.py Tue Oct 18 16:05:20 2022 +0200 +++ b/src/eric7/QScintilla/MiniEditor.py Tue Oct 18 16:06:21 2022 +0200 @@ -39,22 +39,21 @@ from PyQt6.QtPrintSupport import QPrinter, QPrintDialog, QAbstractPrintDialog from PyQt6.Qsci import QsciScintilla -from EricGui.EricAction import EricAction, createActionGroup -from EricWidgets import EricMessageBox, EricFileDialog -from EricWidgets.EricMainWindow import EricMainWindow -from EricWidgets.EricClickableLabel import EricClickableLabel -from EricWidgets.EricZoomWidget import EricZoomWidget -from EricGui.EricOverrideCursor import EricOverrideCursor +from eric7.EricGui.EricAction import EricAction, createActionGroup +from eric7.EricWidgets import EricMessageBox, EricFileDialog +from eric7.EricWidgets.EricMainWindow import EricMainWindow +from eric7.EricWidgets.EricClickableLabel import EricClickableLabel +from eric7.EricWidgets.EricZoomWidget import EricZoomWidget +from eric7.EricGui.EricOverrideCursor import EricOverrideCursor from .QsciScintillaCompat import QsciScintillaCompat -import UI.PixmapCache -import UI.Config - -from Globals import isMacPlatform - -import Utilities -import Preferences +from eric7.EricGui import EricPixmapCache +from eric7.UI import Config + +from eric7.Globals import isMacPlatform + +from eric7 import Preferences, Utilities class MiniScintilla(QsciScintillaCompat): @@ -273,7 +272,7 @@ super().__init__(parent) if name is not None: self.setObjectName(name) - self.setWindowIcon(UI.PixmapCache.getIcon("editor")) + self.setWindowIcon(EricPixmapCache.getIcon("editor")) self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) @@ -540,11 +539,11 @@ if language is None: pixmap = QPixmap() elif language == "": - pixmap = UI.PixmapCache.getPixmap("fileText") + pixmap = EricPixmapCache.getPixmap("fileText") else: - import QScintilla.Lexers - - pixmap = QScintilla.Lexers.getLanguageIcon(language, True) + from eric7.QScintilla import Lexers + + pixmap = Lexers.getLanguageIcon(language, True) self.sbLanguage.setPixmap(pixmap) if pixmap.isNull(): self.sbLanguage.setText(language) @@ -614,7 +613,7 @@ """ self.newAct = EricAction( self.tr("New"), - UI.PixmapCache.getIcon("new"), + EricPixmapCache.getIcon("new"), self.tr("&New"), QKeySequence(self.tr("Ctrl+N", "File|New")), 0, @@ -632,7 +631,7 @@ self.openAct = EricAction( self.tr("Open"), - UI.PixmapCache.getIcon("open"), + EricPixmapCache.getIcon("open"), self.tr("&Open..."), QKeySequence(self.tr("Ctrl+O", "File|Open")), 0, @@ -651,7 +650,7 @@ self.saveAct = EricAction( self.tr("Save"), - UI.PixmapCache.getIcon("fileSave"), + EricPixmapCache.getIcon("fileSave"), self.tr("&Save"), QKeySequence(self.tr("Ctrl+S", "File|Save")), 0, @@ -670,7 +669,7 @@ self.saveAsAct = EricAction( self.tr("Save as"), - UI.PixmapCache.getIcon("fileSaveAs"), + EricPixmapCache.getIcon("fileSaveAs"), self.tr("Save &as..."), QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")), 0, @@ -690,7 +689,7 @@ self.saveCopyAct = EricAction( self.tr("Save Copy"), - UI.PixmapCache.getIcon("fileSaveCopy"), + EricPixmapCache.getIcon("fileSaveCopy"), self.tr("Save &Copy..."), 0, 0, @@ -710,7 +709,7 @@ self.closeAct = EricAction( self.tr("Close"), - UI.PixmapCache.getIcon("close"), + EricPixmapCache.getIcon("close"), self.tr("&Close"), QKeySequence(self.tr("Ctrl+W", "File|Close")), 0, @@ -726,7 +725,7 @@ self.printAct = EricAction( self.tr("Print"), - UI.PixmapCache.getIcon("print"), + EricPixmapCache.getIcon("print"), self.tr("&Print"), QKeySequence(self.tr("Ctrl+P", "File|Print")), 0, @@ -745,7 +744,7 @@ self.printPreviewAct = EricAction( self.tr("Print Preview"), - UI.PixmapCache.getIcon("printPreview"), + EricPixmapCache.getIcon("printPreview"), QCoreApplication.translate("ViewManager", "Print Preview"), 0, 0, @@ -768,7 +767,7 @@ """ self.undoAct = EricAction( self.tr("Undo"), - UI.PixmapCache.getIcon("editUndo"), + EricPixmapCache.getIcon("editUndo"), self.tr("&Undo"), QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")), QKeySequence(self.tr("Alt+Backspace", "Edit|Undo")), @@ -787,7 +786,7 @@ self.redoAct = EricAction( self.tr("Redo"), - UI.PixmapCache.getIcon("editRedo"), + EricPixmapCache.getIcon("editRedo"), self.tr("&Redo"), QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")), 0, @@ -806,7 +805,7 @@ self.cutAct = EricAction( self.tr("Cut"), - UI.PixmapCache.getIcon("editCut"), + EricPixmapCache.getIcon("editCut"), self.tr("Cu&t"), QKeySequence(self.tr("Ctrl+X", "Edit|Cut")), QKeySequence(self.tr("Shift+Del", "Edit|Cut")), @@ -826,7 +825,7 @@ self.copyAct = EricAction( self.tr("Copy"), - UI.PixmapCache.getIcon("editCopy"), + EricPixmapCache.getIcon("editCopy"), self.tr("&Copy"), QKeySequence(self.tr("Ctrl+C", "Edit|Copy")), QKeySequence(self.tr("Ctrl+Ins", "Edit|Copy")), @@ -846,7 +845,7 @@ self.pasteAct = EricAction( self.tr("Paste"), - UI.PixmapCache.getIcon("editPaste"), + EricPixmapCache.getIcon("editPaste"), self.tr("&Paste"), QKeySequence(self.tr("Ctrl+V", "Edit|Paste")), QKeySequence(self.tr("Shift+Ins", "Edit|Paste")), @@ -866,7 +865,7 @@ self.deleteAct = EricAction( self.tr("Clear"), - UI.PixmapCache.getIcon("editDelete"), + EricPixmapCache.getIcon("editDelete"), self.tr("Cl&ear"), QKeySequence(self.tr("Alt+Shift+C", "Edit|Clear")), 0, @@ -2541,7 +2540,7 @@ """ self.searchAct = EricAction( QCoreApplication.translate("ViewManager", "Search"), - UI.PixmapCache.getIcon("find"), + EricPixmapCache.getIcon("find"), QCoreApplication.translate("ViewManager", "&Search..."), QKeySequence( QCoreApplication.translate("ViewManager", "Ctrl+F", "Search|Search") @@ -2567,7 +2566,7 @@ self.searchNextAct = EricAction( QCoreApplication.translate("ViewManager", "Search next"), - UI.PixmapCache.getIcon("findNext"), + EricPixmapCache.getIcon("findNext"), QCoreApplication.translate("ViewManager", "Search &next"), QKeySequence( QCoreApplication.translate("ViewManager", "F3", "Search|Search next") @@ -2593,7 +2592,7 @@ self.searchPrevAct = EricAction( QCoreApplication.translate("ViewManager", "Search previous"), - UI.PixmapCache.getIcon("findPrev"), + EricPixmapCache.getIcon("findPrev"), QCoreApplication.translate("ViewManager", "Search &previous"), QKeySequence( QCoreApplication.translate( @@ -2623,7 +2622,7 @@ self.searchClearMarkersAct = EricAction( QCoreApplication.translate("ViewManager", "Clear search markers"), - UI.PixmapCache.getIcon("findClear"), + EricPixmapCache.getIcon("findClear"), QCoreApplication.translate("ViewManager", "Clear search markers"), QKeySequence( QCoreApplication.translate( @@ -2676,7 +2675,7 @@ self.replaceAndSearchAct = EricAction( QCoreApplication.translate("ViewManager", "Replace and Search"), - UI.PixmapCache.getIcon("editReplaceSearch"), + EricPixmapCache.getIcon("editReplaceSearch"), QCoreApplication.translate("ViewManager", "Replace and Search"), QKeySequence( QCoreApplication.translate( @@ -2706,7 +2705,7 @@ self.replaceSelectionAct = EricAction( QCoreApplication.translate("ViewManager", "Replace Occurrence"), - UI.PixmapCache.getIcon("editReplace"), + EricPixmapCache.getIcon("editReplace"), QCoreApplication.translate("ViewManager", "Replace Occurrence"), QKeySequence( QCoreApplication.translate( @@ -2733,7 +2732,7 @@ self.replaceAllAct = EricAction( QCoreApplication.translate("ViewManager", "Replace All"), - UI.PixmapCache.getIcon("editReplaceAll"), + EricPixmapCache.getIcon("editReplaceAll"), QCoreApplication.translate("ViewManager", "Replace All"), QKeySequence( QCoreApplication.translate( @@ -2764,7 +2763,7 @@ """ self.zoomInAct = EricAction( QCoreApplication.translate("ViewManager", "Zoom in"), - UI.PixmapCache.getIcon("zoomIn"), + EricPixmapCache.getIcon("zoomIn"), QCoreApplication.translate("ViewManager", "Zoom &in"), QKeySequence( QCoreApplication.translate("ViewManager", "Ctrl++", "View|Zoom in") @@ -2790,7 +2789,7 @@ self.zoomOutAct = EricAction( QCoreApplication.translate("ViewManager", "Zoom out"), - UI.PixmapCache.getIcon("zoomOut"), + EricPixmapCache.getIcon("zoomOut"), QCoreApplication.translate("ViewManager", "Zoom &out"), QKeySequence( QCoreApplication.translate("ViewManager", "Ctrl+-", "View|Zoom out") @@ -2816,7 +2815,7 @@ self.zoomResetAct = EricAction( QCoreApplication.translate("ViewManager", "Zoom reset"), - UI.PixmapCache.getIcon("zoomReset"), + EricPixmapCache.getIcon("zoomReset"), QCoreApplication.translate("ViewManager", "Zoom &reset"), QKeySequence( QCoreApplication.translate("ViewManager", "Ctrl+0", "View|Zoom reset") @@ -2841,7 +2840,7 @@ self.zoomToAct = EricAction( QCoreApplication.translate("ViewManager", "Zoom"), - UI.PixmapCache.getIcon("zoomTo"), + EricPixmapCache.getIcon("zoomTo"), QCoreApplication.translate("ViewManager", "&Zoom"), 0, 0, @@ -2896,7 +2895,7 @@ self.whatsThisAct = EricAction( self.tr("What's This?"), - UI.PixmapCache.getIcon("whatsThis"), + EricPixmapCache.getIcon("whatsThis"), self.tr("&What's This?"), QKeySequence(self.tr("Shift+F1", "Help|What's This?'")), 0, @@ -2924,7 +2923,7 @@ """ self.prefAct = EricAction( self.tr("Preferences"), - UI.PixmapCache.getIcon("configure"), + EricPixmapCache.getIcon("configure"), self.tr("&Preferences..."), 0, 0, @@ -3003,7 +3002,7 @@ Private method to create the various toolbars. """ filetb = self.addToolBar(self.tr("File")) - filetb.setIconSize(UI.Config.ToolBarIconSize) + filetb.setIconSize(Config.ToolBarIconSize) filetb.addAction(self.newAct) filetb.addAction(self.openAct) filetb.addAction(self.saveAct) @@ -3016,7 +3015,7 @@ filetb.addAction(self.closeAct) edittb = self.addToolBar(self.tr("Edit")) - edittb.setIconSize(UI.Config.ToolBarIconSize) + edittb.setIconSize(Config.ToolBarIconSize) edittb.addAction(self.undoAct) edittb.addAction(self.redoAct) edittb.addSeparator() @@ -3026,25 +3025,25 @@ edittb.addAction(self.deleteAct) findtb = self.addToolBar(self.tr("Search")) - findtb.setIconSize(UI.Config.ToolBarIconSize) + findtb.setIconSize(Config.ToolBarIconSize) findtb.addAction(self.searchAct) findtb.addAction(self.searchNextAct) findtb.addAction(self.searchPrevAct) findtb.addAction(self.searchClearMarkersAct) viewtb = self.addToolBar(self.tr("View")) - viewtb.setIconSize(UI.Config.ToolBarIconSize) + viewtb.setIconSize(Config.ToolBarIconSize) viewtb.addAction(self.zoomInAct) viewtb.addAction(self.zoomOutAct) viewtb.addAction(self.zoomResetAct) viewtb.addAction(self.zoomToAct) settingstb = self.addToolBar(self.tr("Settings")) - settingstb.setIconSize(UI.Config.ToolBarIconSize) + settingstb.setIconSize(Config.ToolBarIconSize) settingstb.addAction(self.prefAct) helptb = self.addToolBar(self.tr("Help")) - helptb.setIconSize(UI.Config.ToolBarIconSize) + helptb.setIconSize(Config.ToolBarIconSize) helptb.addAction(self.whatsThisAct) def __createStatusBar(self): @@ -3092,9 +3091,9 @@ ) self.sbZoom = EricZoomWidget( - UI.PixmapCache.getPixmap("zoomOut"), - UI.PixmapCache.getPixmap("zoomIn"), - UI.PixmapCache.getPixmap("zoomReset"), + EricPixmapCache.getPixmap("zoomOut"), + EricPixmapCache.getPixmap("zoomIn"), + EricPixmapCache.getPixmap("zoomReset"), self.__statusBar, ) self.__statusBar.addPermanentWidget(self.sbZoom) @@ -3112,7 +3111,7 @@ """ Private slot to set the preferences. """ - from Preferences.ConfigurationDialog import ( + from eric7.Preferences.ConfigurationDialog import ( ConfigurationDialog, ConfigurationMode, ) @@ -3762,7 +3761,7 @@ if language != "Guessed": self.supportedLanguages[language] = supportedLanguages[language][:2] act = menu.addAction( - UI.PixmapCache.getIcon(supportedLanguages[language][2]), + EricPixmapCache.getIcon(supportedLanguages[language][2]), self.supportedLanguages[language][0], ) act.setCheckable(True) @@ -4483,7 +4482,7 @@ """ Private method to handle the zoom action. """ - from QScintilla.ZoomDialog import ZoomDialog + from eric7.QScintilla.ZoomDialog import ZoomDialog dlg = ZoomDialog(self.getZoom(), self, None, True) if dlg.exec() == QDialog.DialogCode.Accepted: