10 import os |
10 import os |
11 |
11 |
12 from PyQt6.QtCore import QCoreApplication |
12 from PyQt6.QtCore import QCoreApplication |
13 from PyQt6.QtGui import QIcon |
13 from PyQt6.QtGui import QIcon |
14 |
14 |
15 from EricWidgets.EricApplication import ericApp |
15 from eric7.EricWidgets.EricApplication import ericApp |
16 |
16 |
17 import UI.PixmapCache |
17 from eric7.EricGui import EricPixmapCache |
18 |
18 |
19 |
19 |
20 def supportedEngineNames(): |
20 def supportedEngineNames(): |
21 """ |
21 """ |
22 Module function to get the list of supported translation engines. |
22 Module function to get the list of supported translation engines. |
115 @return engine icon |
115 @return engine icon |
116 @rtype QIcon |
116 @rtype QIcon |
117 """ |
117 """ |
118 iconSuffix = "dark" if ericApp().usesDarkPalette() else "light" |
118 iconSuffix = "dark" if ericApp().usesDarkPalette() else "light" |
119 if name in supportedEngineNames(): |
119 if name in supportedEngineNames(): |
120 icon = UI.PixmapCache.getIcon( |
120 icon = EricPixmapCache.getIcon( |
121 os.path.join( |
121 os.path.join( |
122 os.path.dirname(__file__), |
122 os.path.dirname(__file__), |
123 "..", |
123 "..", |
124 "icons", |
124 "icons", |
125 "engines", |
125 "engines", |
126 "{0}-{1}".format(name, iconSuffix), |
126 "{0}-{1}".format(name, iconSuffix), |
127 ) |
127 ) |
128 ) |
128 ) |
129 if icon.isNull(): |
129 if icon.isNull(): |
130 # try variant without suffix |
130 # try variant without suffix |
131 icon = UI.PixmapCache.getIcon( |
131 icon = EricPixmapCache.getIcon( |
132 os.path.join( |
132 os.path.join( |
133 os.path.dirname(__file__), |
133 os.path.dirname(__file__), |
134 "..", |
134 "..", |
135 "icons", |
135 "icons", |
136 "engines", |
136 "engines", |