def main(self): self.config.open_last_wallet() w = ElectrumWindow(config=self.config, network=self.network, plugins = self.plugins, gui_object=self) w.run() self.config.save_last_wallet(w.wallet)
def main(self): self.config.open_last_wallet() w = ElectrumWindow(config=self.config, network=self.network, plugins=self.plugins, gui_object=self) w.run() self.config.save_last_wallet(w.wallet)
def main(self, url): storage = WalletStorage(self.config) if not storage.file_exists: import installwizard wizard = installwizard.InstallWizard(self.config, self.network, storage) wallet = wizard.run() if not wallet: exit() else: wallet = Wallet(storage) wallet.start_threads(self.network) self.main_window = w = ElectrumWindow(self.config, self.network) # plugins that need to change the GUI do it here run_hook('init') w.load_wallet(wallet) s = Timer() s.start() self.windows.append(w) if url: w.set_url(url) w.app = self.app w.connect_slots(s) w.update_wallet() self.app.exec_() wallet.stop_threads()
def create_window_for_wallet(self, wallet): w = ElectrumWindow(self, wallet) self.windows.append(w) self.build_tray_menu() # FIXME: Remove in favour of the load_wallet hook run_hook('on_new_window', w) return w
def main(self, url): storage = WalletStorage(self.config) if not storage.file_exists: import installwizard wizard = installwizard.InstallWizard(self.config, self.network, storage) wallet = wizard.run() if not wallet: exit() elif storage.get('wallet_type') in ['2of3' ] and storage.get('seed') is None: import installwizard wizard = installwizard.InstallWizard(self.config, self.network, storage) wallet = wizard.run(action='create2of3') if not wallet: exit() else: wallet = Wallet(storage) wallet.start_threads(self.network) # init tray self.dark_icon = self.config.get("dark_icon", False) icon = QIcon( ":icons/electrum_dark_icon.png") if self.dark_icon else QIcon( ':icons/electrum_light_icon.png') self.tray = QSystemTrayIcon(icon, None) self.tray.setToolTip('Electrum-LTC') self.tray.activated.connect(self.tray_activated) self.build_tray_menu() self.tray.show() # main window self.main_window = w = ElectrumWindow(self.config, self.network, self) self.current_window = self.main_window #lite window self.init_lite() # plugins that need to change the GUI do it here run_hook('init') w.load_wallet(wallet) s = Timer() s.start() self.windows.append(w) if url: w.set_url(url) w.app = self.app w.connect_slots(s) w.update_wallet() self.app.exec_() wallet.stop_threads()
def main(self, url): storage = WalletStorage(self.config) if storage.file_exists: wallet = Wallet(storage) action = wallet.get_action() else: action = 'new' if action is not None: import installwizard wizard = installwizard.InstallWizard(self.config, self.network, storage) wallet = wizard.run(action) if not wallet: exit() else: wallet.start_threads(self.network) # init tray self.dark_icon = self.config.get("dark_icon", False) icon = QIcon(":icons/electrum_dark_icon.png") if self.dark_icon else QIcon(':icons/electrum_light_icon.png') self.tray = QSystemTrayIcon(icon, None) self.tray.setToolTip('Electrum') self.tray.activated.connect(self.tray_activated) self.build_tray_menu() self.tray.show() # main window self.main_window = w = ElectrumWindow(self.config, self.network, self) self.current_window = self.main_window #lite window self.init_lite() # plugins that need to change the GUI do it here run_hook('init') w.load_wallet(wallet) s = Timer() s.start() self.windows.append(w) if url: self.set_url(url) w.app = self.app w.connect_slots(s) w.update_wallet() self.app.exec_() # clipboard persistence # see http://www.mail-archive.com/[email protected]/msg17328.html event = QtCore.QEvent(QtCore.QEvent.Clipboard) self.app.sendEvent(self.app.clipboard(), event) wallet.stop_threads()
def start_new_window(self, config): path = config.get_wallet_path() if path not in self.windows: w = ElectrumWindow(config, self.network, self) w.connect_slots(self.timer) w.load_wallet_file(path) w.show() self.windows[path] = w w = self.windows[path] url = config.get('url') if url: w.pay_to_URI(url) return w
def create_window_for_wallet(self, wallet, task): w = ElectrumWindow(self, wallet) self.windows.append(w) self.build_tray_menu() if task: WaitingDialog(w, task[0], task[1]) # FIXME: Remove in favour of the load_wallet hook run_hook('on_new_window', w) return w
def main(self): ''' The main entry point of the kivy ux :param url: 'bitcoin:' uri as mentioned in bip0021 :type url: str :ref: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki ''' self.main_window = w = ElectrumWindow(config=self.config, network=self.network, gui_object=self) w.run()
def start_new_window(self, config, path=None): if path is None: path = config.get_wallet_path() for w in self.windows: if w.config.get_wallet_path() == path: w.bring_to_top() break else: w = ElectrumWindow(config, self.network, self) w.connect_slots(self.timer) w.load_wallet_file(path) w.show() self.windows.append(w) url = config.get('url') if url: w.pay_to_URI(url) return w
def main(self, url): last_wallet = self.config.get('gui_last_wallet') if last_wallet is not None and self.config.get('wallet_path') is None: if os.path.exists(last_wallet): self.config.cmdline_options[ 'default_wallet_path'] = last_wallet # init tray self.dark_icon = self.config.get("dark_icon", False) icon = QIcon( ":icons/electrum_dark_icon.png") if self.dark_icon else QIcon( ':icons/electrum_light_icon.png') self.tray = QSystemTrayIcon(icon, None) self.tray.setToolTip('Electrum') self.tray.activated.connect(self.tray_activated) self.build_tray_menu() self.tray.show() # main window self.main_window = w = ElectrumWindow(self.config, self.network, self) self.current_window = self.main_window w.show() #lite window self.init_lite() w.load_wallet_file(self.config.get_wallet_path()) # plugins interact with main window run_hook('init_qt', self) # initial configuration if self.config.get('hide_gui') is True and self.tray.isVisible(): self.main_window.hide() self.lite_window.hide() else: if self.config.get('lite_mode') is True: self.go_lite() else: self.go_full() s = Timer() s.start() self.windows.append(w) if url: self.set_url(url) w.connect_slots(s) signal.signal(signal.SIGINT, lambda *args: self.app.quit()) self.app.exec_() if self.tray: self.tray.hide() # clipboard persistence # see http://www.mail-archive.com/[email protected]/msg17328.html event = QtCore.QEvent(QtCore.QEvent.Clipboard) self.app.sendEvent(self.app.clipboard(), event) w.close_wallet()
def start_new_window(self, path, uri): for w in self.windows: if w.wallet.storage.path == path: w.bring_to_top() break else: wallet = self.load_wallet_file(path) if not wallet: return w = ElectrumWindow(self.config, self.network, self) w.connect_slots(self.timer) # load new wallet in gui w.load_wallet(wallet) # save path if self.config.get('wallet_path') is None: self.config.set_key('gui_last_wallet', path) # add to recently visited w.update_recently_visited(path) # initial configuration if self.config.get('hide_gui') is True and self.tray.isVisible(): w.hide() else: w.show() self.windows.append(w) self.build_tray_menu() self.plugins.on_new_window(w) if uri: w.pay_to_URI(uri) return w
def main(self, url): last_wallet = self.config.get('gui_last_wallet') if last_wallet is not None and self.config.get('wallet_path') is None: if os.path.exists(last_wallet): self.config.cmdline_options[ 'default_wallet_path'] = last_wallet try: storage = WalletStorage(self.config.get_wallet_path()) except BaseException as e: QMessageBox.warning(None, _('Warning'), str(e), _('OK')) self.config.set_key('gui_last_wallet', None) return if storage.file_exists: try: wallet = Wallet(storage) except BaseException as e: QMessageBox.warning(None, _('Warning'), str(e), _('OK')) return action = wallet.get_action() else: action = 'new' if action is not None: wallet = self.run_wizard(storage, action) if not wallet: return else: wallet.start_threads(self.network) # init tray self.dark_icon = self.config.get("dark_icon", False) icon = QIcon( ":icons/electrum_dark_icon.png") if self.dark_icon else QIcon( ':icons/electrum_light_icon.png') self.tray = QSystemTrayIcon(icon, None) self.tray.setToolTip('Unobtainum Electrum') self.tray.activated.connect(self.tray_activated) self.build_tray_menu() self.tray.show() # main window self.main_window = w = ElectrumWindow(self.config, self.network, self) self.current_window = self.main_window #lite window self.init_lite() # plugins interact with main window run_hook('init_qt', self) w.load_wallet(wallet) # initial configuration if self.config.get('hide_gui') is True and self.tray.isVisible(): self.main_window.hide() self.lite_window.hide() else: if self.config.get('lite_mode') is True: self.go_lite() else: self.go_full() s = Timer() s.start() self.windows.append(w) if url: self.set_url(url) w.connect_slots(s) signal.signal(signal.SIGINT, lambda *args: self.app.quit()) self.app.exec_() if self.tray: self.tray.hide() # clipboard persistence # see http://www.mail-archive.com/[email protected]/msg17328.html event = QtCore.QEvent(QtCore.QEvent.Clipboard) self.app.sendEvent(self.app.clipboard(), event) w.close_wallet()
def main(self): w = ElectrumWindow(config=self.config, network=self.network, plugins = self.plugins, gui_object=self) w.run()
def show_seed_dialog(self): ElectrumWindow.show_seed_dialog(self.wallet)
def main(self, url): storage = WalletStorage(self.config) if storage.file_exists: wallet = Wallet(storage) action = wallet.get_action() else: action = 'new' if action is not None: import installwizard wizard = installwizard.InstallWizard(self.config, self.network, storage) wallet = wizard.run(action) if not wallet: return else: wallet.start_threads(self.network) # init tray if 1: self.dark_icon = self.config.get("dark_icon", False) icon = QIcon( ":icons/electrum_dark_icon.png") if self.dark_icon else QIcon( ':icons/electrum_light_icon.png') self.tray = QSystemTrayIcon(icon, None) self.tray.setToolTip('Tate') self.tray.activated.connect(self.tray_activated) self.build_tray_menu() self.tray.show() else: self.tray = None # main window self.main_window = w = ElectrumWindow(self.config, self.network, self) self.current_window = self.main_window #lite window self.init_lite() # initial configuration if self.config.get('hide_gui') is True and self.tray.isVisible(): self.main_window.hide() self.lite_window.hide() else: if self.config.get('lite_mode') is True: self.go_lite() else: self.go_full() # plugins that need to change the GUI do it here run_hook('init_qt', self) w.load_wallet(wallet) s = Timer() s.start() self.windows.append(w) if url: self.set_url(url) w.app = self.app w.connect_slots(s) w.update_wallet() signal.signal(signal.SIGINT, lambda *args: self.app.quit()) self.app.exec_() if self.tray: self.tray.hide() # clipboard persistence # see http://www.mail-archive.com/[email protected]/msg17328.html event = QtCore.QEvent(QtCore.QEvent.Clipboard) self.app.sendEvent(self.app.clipboard(), event) w.close_wallet()
def start_new_window(self, path, uri): for w in self.windows: if w.wallet.storage.path == path: w.bring_to_top() break else: wallet = self.load_wallet_file(path) if not wallet: return w = ElectrumWindow(self, wallet) w.connect_slots(self.timer) # add to recently visited w.update_recently_visited(path) # initial configuration if self.config.get("hide_gui") is True and self.tray.isVisible(): w.hide() else: w.show() self.windows.append(w) self.build_tray_menu() run_hook("on_new_window", w) if uri: w.pay_to_URI(uri) return w
def main(self, url): storage = WalletStorage(self.config) if not storage.file_exists: import installwizard wizard = installwizard.InstallWizard(self.config, self.network, storage) wallet = wizard.run() if not wallet: exit() else: wallet = Wallet(storage) wallet.start_threads(self.network) s = Timer() s.start() w = ElectrumWindow(self.config, self.network, self.minimize) w.load_wallet(wallet) self.windows.append(w) if url: w.set_url(url) w.app = self.app w.connect_slots(s) w.update_wallet() self.expert = w self.mini = self.init_lite(wallet, w, url) if self.config.get('lite_mode'): if not self.mini: QMessageBox.warning(None,"Could not start Lite GUI.", "Electrum was unable to load the 'Lite GUI' because it needs Qt version >= 4.7.\nChanging your config to use the 'Classic' GUI") self.config.set_key('lite_mode', False, True) sys.exit(0) else: self.minimize() else: w.show() if self.mini: self.mini.hide() self.app.exec_() wallet.stop_threads()
def start_new_window(self, path, uri): for w in self.windows: if w.wallet.storage.path == path: w.bring_to_top() break else: wallet = self.load_wallet_file(path) if not wallet: return w = ElectrumWindow(self, wallet) w.connect_slots(self.timer) # add to recently visited w.update_recently_visited(path) # initial configuration if self.config.get('hide_gui') is True and self.tray.isVisible(): w.hide() else: w.show() self.windows.append(w) self.build_tray_menu() run_hook('on_new_window', w) if uri: w.pay_to_URI(uri) return w
def main(self): w = ElectrumWindow(config=self.config, network=self.network, plugins=self.plugins, gui_object=self) w.run()