1
0

Remove redundant config argument.

Also don't default path for clarity.
This commit is contained in:
Neil Booth
2015-09-03 16:40:48 +09:00
parent f565d79c11
commit 14cc260092

View File

@@ -199,15 +199,13 @@ class ElectrumGui:
return return
wallet = wizard.run(action, wallet_type) wallet = wizard.run(action, wallet_type)
if wallet: if wallet:
self.start_new_window(self.config, full_path) self.start_new_window(full_path)
def new_window(self, path): def new_window(self, path):
# Use a signal as can be called from daemon thread # Use a signal as can be called from daemon thread
self.app.emit(SIGNAL('new_window'), self.config, path) self.app.emit(SIGNAL('new_window'), path)
def start_new_window(self, config, path=None): def start_new_window(self, path):
if path is None:
path = config.get_wallet_path()
for w in self.windows: for w in self.windows:
if w.wallet.storage.path == path: if w.wallet.storage.path == path:
w.bring_to_top() w.bring_to_top()
@@ -216,7 +214,7 @@ class ElectrumGui:
wallet = self.load_wallet_file(path) wallet = self.load_wallet_file(path)
if not wallet: if not wallet:
return return
w = ElectrumWindow(config, self.network, self) w = ElectrumWindow(self.config, self.network, self)
w.connect_slots(self.timer) w.connect_slots(self.timer)
# load new wallet in gui # load new wallet in gui
@@ -230,7 +228,7 @@ class ElectrumGui:
self.windows.append(w) self.windows.append(w)
self.build_tray_menu() self.build_tray_menu()
url = config.get('url') url = self.config.get('url')
if url: if url:
w.pay_to_URI(url) w.pay_to_URI(url)
return w return w
@@ -248,7 +246,7 @@ class ElectrumGui:
self.config.cmdline_options['default_wallet_path'] = last_wallet self.config.cmdline_options['default_wallet_path'] = last_wallet
# main window # main window
self.main_window = self.start_new_window(self.config) self.main_window = self.start_new_window(self.config.get_wallet_path())
if not self.main_window: if not self.main_window:
return return