Browse Source

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.
283
Amir Taaki 13 years ago
parent
commit
b0b24ae9dd
  1. 12
      lib/gui_lite.py

12
lib/gui_lite.py

@ -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…
Cancel
Save