eric6/Preferences/__init__.py

changeset 8234
fcb6b4b96274
parent 8228
772103b14c18
child 8243
cc717c2ae956
equal deleted inserted replaced
8233:bad78a592cc2 8234:fcb6b4b96274
2195 2195
2196 @param key the key of the colour to be set 2196 @param key the key of the colour to be set
2197 @param value the colour to be set 2197 @param value the colour to be set
2198 @param prefClass preferences class used as the storage area 2198 @param prefClass preferences class used as the storage area
2199 """ 2199 """
2200 if value.alpha() < 255: 2200 val = ("#{0:8x}".format(value.rgba()) if value.alpha() < 255
2201 val = "#{0:8x}".format(value.rgba()) 2201 else value.name())
2202 else:
2203 val = value.name()
2204 prefClass.settings.setValue("Editor/Colour/" + key, val) 2202 prefClass.settings.setValue("Editor/Colour/" + key, val)
2205 2203
2206 2204
2207 def getEditorOtherFonts(key, prefClass=Prefs): 2205 def getEditorOtherFonts(key, prefClass=Prefs):
2208 """ 2206 """
2241 @param prefClass preferences class used as the storage area 2239 @param prefClass preferences class used as the storage area
2242 @type Prefs 2240 @type Prefs
2243 @return requested list of API files 2241 @return requested list of API files
2244 @rtype list of str 2242 @rtype list of str
2245 """ 2243 """
2246 if projectType: 2244 key = "{0}_{1}".format(language, projectType) if projectType else language
2247 key = "{0}_{1}".format(language, projectType)
2248 else:
2249 key = language
2250 apis = prefClass.settings.value("Editor/APIs/" + key) 2245 apis = prefClass.settings.value("Editor/APIs/" + key)
2251 if apis is not None: 2246 if apis is not None:
2252 if len(apis) and apis[0] == "": 2247 if len(apis) and apis[0] == "":
2253 return [] 2248 return []
2254 else: 2249 else:
2272 @param apilist list of API files 2267 @param apilist list of API files
2273 @type list of str 2268 @type list of str
2274 @param prefClass preferences class used as the storage area 2269 @param prefClass preferences class used as the storage area
2275 @type Prefs 2270 @type Prefs
2276 """ 2271 """
2277 if projectType: 2272 key = "{0}_{1}".format(language, projectType) if projectType else language
2278 key = "{0}_{1}".format(language, projectType)
2279 else:
2280 key = language
2281 prefClass.settings.setValue("Editor/APIs/" + key, apilist) 2273 prefClass.settings.setValue("Editor/APIs/" + key, apilist)
2282 2274
2283 2275
2284 def getEditorKeywords(key, prefClass=Prefs): 2276 def getEditorKeywords(key, prefClass=Prefs):
2285 """ 2277 """
3471 3463
3472 @param key the key of the colour to be set 3464 @param key the key of the colour to be set
3473 @param value the colour to be set 3465 @param value the colour to be set
3474 @param prefClass preferences class used as the storage area 3466 @param prefClass preferences class used as the storage area
3475 """ 3467 """
3476 if value.alpha() < 255: 3468 val = ("#{0:8x}".format(value.rgba())
3477 val = "#{0:8x}".format(value.rgba()) 3469 if value.alpha() < 255 else value.name())
3478 else:
3479 val = value.name()
3480 prefClass.settings.setValue("Diff/" + key, val) 3470 prefClass.settings.setValue("Diff/" + key, val)
3481 3471
3482 3472
3483 def getDocuViewer(key, prefClass=Prefs): 3473 def getDocuViewer(key, prefClass=Prefs):
3484 """ 3474 """

eric ide

mercurial