Rewrap self.tr and fix a few bugs
This commit is contained in:
+9
-4
@@ -31,8 +31,9 @@ import configparser
|
||||
import os
|
||||
|
||||
from math import ceil
|
||||
from functools import partial
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import QCoreApplication, Qt
|
||||
from PyQt5.QtWidgets import QStyle, qApp
|
||||
from PyQt5.QtGui import (
|
||||
QPalette, QColor, QIcon, QFont, QFontMetrics, QFontDatabase, QPixmap
|
||||
@@ -157,6 +158,10 @@ class GuiTheme:
|
||||
logger.verbose("Text 'N' Height: %d" % self.textNHeight)
|
||||
logger.verbose("Text 'N' Width: %d" % self.textNWidth)
|
||||
|
||||
# Internal Mapping
|
||||
self.makeAlert = self.theParent.makeAlert
|
||||
self.tr = partial(QCoreApplication.translate, "GuiTheme")
|
||||
|
||||
return
|
||||
|
||||
##
|
||||
@@ -392,7 +397,7 @@ class GuiTheme:
|
||||
with open(themeConf, mode="r", encoding="utf8") as inFile:
|
||||
confParser.read_file(inFile)
|
||||
except Exception as e:
|
||||
self.theParent.makeAlert(
|
||||
self.makeAlert(
|
||||
[self.tr("Could not load theme config file."), str(e)], nwAlert.ERROR
|
||||
)
|
||||
continue
|
||||
@@ -425,7 +430,7 @@ class GuiTheme:
|
||||
with open(syntaxPath, mode="r", encoding="utf8") as inFile:
|
||||
confParser.read_file(inFile)
|
||||
except Exception as e:
|
||||
self.theParent.makeAlert(
|
||||
self.makeAlert(
|
||||
[self.tr("Could not load syntax file."), str(e)], nwAlert.ERROR
|
||||
)
|
||||
return []
|
||||
@@ -740,7 +745,7 @@ class GuiIcons:
|
||||
with open(themeConf, mode="r", encoding="utf8") as inFile:
|
||||
confParser.read_file(inFile)
|
||||
except Exception as e:
|
||||
self.theParent.makeAlert(
|
||||
self.makeAlert(
|
||||
[self.tr("Could not load theme config file."), str(e)], nwAlert.ERROR
|
||||
)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user