qtVersion = qVersion()
if not(int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7):
app = QApplication(sys.argv)
- QMessageBox.warning(None,"Could not start Lite GUI.", "Electrum was unable to load the 'Lite GUI' because it needs Qt version >= 4.7.\nElectrum was set to use the 'Qt' GUI")
- from simple_config import SimpleConfig
- cfg = SimpleConfig()
- cfg.set_key("gui", "qt",True)
+ QMessageBox.warning(None,"Could not start Lite GUI.", "Electrum was unable to load the 'Lite GUI' because it needs Qt version >= 4.7.\nPlease use the 'Qt' GUI")
sys.exit(0)
from decimal import Decimal as D
from interface import DEFAULT_SERVERS
-from simple_config import SimpleConfig
from util import get_resource_path as rsrc
from i18n import _
import decimal
class ElectrumGui(QObject):
- def __init__(self, wallet):
+ def __init__(self, wallet, config):
super(QObject, self).__init__()
self.wallet = wallet
+ self.config = config
self.app = QApplication(sys.argv)
def main(self, url):
old_path = QDir.currentPath()
actuator.load_theme()
- self.mini = MiniWindow(actuator, self.expand)
+ self.mini = MiniWindow(actuator, self.expand, self.config)
driver = MiniDriver(self.wallet, self.mini)
# Reset path back to original value now that loading the GUI
timer = Timer()
timer.start()
- self.expert = gui_qt.ElectrumWindow(self.wallet)
+ self.expert = gui_qt.ElectrumWindow(self.wallet, self.config)
self.expert.app = self.app
self.expert.connect_slots(timer)
self.expert.update_wallet()
-
-
self.app.exec_()
def server_list_changed(self):
class MiniWindow(QDialog):
- def __init__(self, actuator, expand_callback):
+ def __init__(self, actuator, expand_callback, config):
super(MiniWindow, self).__init__()
self.actuator = actuator
+ self.config = config
self.btc_balance = None
self.quote_currencies = ["EUR", "USD", "GBP"]
close_shortcut = QShortcut(QKeySequence("Ctrl+W"), self)
close_shortcut.activated.connect(self.close)
- self.cfg = SimpleConfig()
- g = self.cfg.config["winpos-lite"]
+ g = self.config.get("winpos-lite",[4, 25, 351, 149])
self.setGeometry(g[0], g[1], g[2], g[3])
- show_history.setChecked(self.cfg.config["history"])
- self.show_history(self.cfg.config["history"])
+
+ show_hist = self.config.get("gui_show_history",False)
+ show_history.setChecked(show_hist)
+ self.show_history(show_hist)
self.setWindowIcon(QIcon(":electrum.png"))
self.setWindowTitle("Electrum")
def closeEvent(self, event):
g = self.geometry()
- self.cfg.set_key("winpos-lite", [g.left(),g.top(),g.width(),g.height()])
- self.cfg.set_key("history", self.history_list.isVisible())
- self.cfg.save_config()
+ self.config.set_key("winpos-lite", [g.left(),g.top(),g.width(),g.height()],True)
+ self.config.set_key("history", self.history_list.isVisible(),True)
super(MiniWindow, self).closeEvent(event)
qApp.quit()
def __init__(self, wallet):
"""Retrieve the gui theme used in previous session."""
self.wallet = wallet
- self.theme_name = self.wallet.theme
+ self.theme_name = self.wallet.config.get('litegui_theme','Cleanlook')
self.themes = util.load_theme_paths()
def load_theme(self):
def change_theme(self, theme_name):
"""Change theme."""
- self.wallet.theme = self.theme_name = theme_name
+ self.theme_name = theme_name
+ self.wallet.config.set_key('litegui_theme',theme_name)
self.load_theme()
def set_configured_currency(self, set_quote_currency):
"""Set the inital fiat currency conversion country (USD/EUR/GBP) in
the GUI to what it was set to in the wallet."""
- currency = self.wallet.conversion_currency
+ currency = self.wallet.config.get('conversion_currency')
# currency can be none when Electrum is used for the first
# time and no setting has been created yet.
if currency is not None:
def set_config_currency(self, conversion_currency):
"""Change the wallet fiat currency country."""
- self.wallet.conversion_currency = conversion_currency
+ self.wallet.config.set_key('conversion_currency',conversion_currency,True)
def set_servers_gui_stuff(self, servers_menu, servers_group):
self.servers_menu = servers_menu
print "Servers loaded."
self.servers_list = interface.servers
server_names = [details[0] for details in self.servers_list]
- current_server = self.wallet.server.split(":")[0]
+ current_server = interface.server.split(":")[0]
for server_name in server_names:
server_action = self.servers_menu.addAction(server_name)
server_action.setCheckable(True)
server_line = "%s:%s:%s" % (server_name, port, protocol)
# Should this have exception handling?
- self.cfg = SimpleConfig()
- self.wallet.set_server(server_line, self.cfg.config["proxy"])
+ self.wallet.set_server(server_line, self.config.get(["proxy"]))
def copy_address(self, receive_popup):
"""Copy the wallet addresses into the client."""