mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 07:23:25 +00:00
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
1 changed files with 8 additions and 4 deletions
|
@ -36,15 +36,19 @@ def resize_line_edit_width(line_edit, text_input):
|
||||||
text_input += "A"
|
text_input += "A"
|
||||||
line_edit.setMinimumWidth(metrics.width(text_input))
|
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:
|
class ElectrumGui:
|
||||||
|
|
||||||
def __init__(self, wallet):
|
def __init__(self, wallet):
|
||||||
self.wallet = wallet
|
self.wallet = wallet
|
||||||
self.app = QApplication(sys.argv)
|
self.app = QApplication(sys.argv)
|
||||||
if os.path.exists("data"):
|
cd_data_dir()
|
||||||
QDir.setCurrent("data")
|
|
||||||
else:
|
|
||||||
QDir.setCurrent(appdata_dir())
|
|
||||||
with open(rsrc("style.css")) as style_file:
|
with open(rsrc("style.css")) as style_file:
|
||||||
self.app.setStyleSheet(style_file.read())
|
self.app.setStyleSheet(style_file.read())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue