コード例 #1
0
ファイル: __init__.py プロジェクト: psb777/electrum
    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
コード例 #2
0
    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
コード例 #3
0
ファイル: __init__.py プロジェクト: nordcz/electrum
    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()