Use environment variable else fallback to system app path. This enables runtime
switching between styles without modifying Electrum, and avoids potential conflicts from implicit detection of a data/ subdirectory.
This commit is contained in:
parent
80d6c3ccb8
commit
b0b24ae9dd
|
@ -36,15 +36,19 @@ def resize_line_edit_width(line_edit, text_input):
|
|||
text_input += "A"
|
||||
line_edit.setMinimumWidth(metrics.width(text_input))
|
||||
|
||||
def cd_data_dir():
|
||||
try:
|
||||
data_dir = os.environ["ELECTRUM_DATA_PATH"]
|
||||
except KeyError:
|
||||
data_dir = appdata_dir()
|
||||
QDir.setCurrent(data_dir)
|
||||
|
||||
class ElectrumGui:
|
||||
|
||||
def __init__(self, wallet):
|
||||
self.wallet = wallet
|
||||
self.app = QApplication(sys.argv)
|
||||
if os.path.exists("data"):
|
||||
QDir.setCurrent("data")
|
||||
else:
|
||||
QDir.setCurrent(appdata_dir())
|
||||
cd_data_dir()
|
||||
with open(rsrc("style.css")) as style_file:
|
||||
self.app.setStyleSheet(style_file.read())
|
||||
|
||||
|
|
Loading…
Reference in New Issue