Ejemplo n.º 1
0
 def choose_server_dialog(self, popup):
     from uix.dialogs.choice_dialog import ChoiceDialog
     protocol = 's'
     def cb2(host):
         from electrum_axe.network import DEFAULT_PORTS
         pp = servers.get(host, DEFAULT_PORTS)
         port = pp.get(protocol, '')
         popup.ids.host.text = host
         popup.ids.port.text = port
     servers = self.network.get_servers()
     ChoiceDialog(_('Choose a server'), sorted(servers), popup.ids.host.text, cb2).open()
Ejemplo n.º 2
0
 def choose_blockchain_dialog(self, dt):
     from uix.dialogs.choice_dialog import ChoiceDialog
     chains = self.network.get_blockchains()
     def cb(name):
         for index, b in self.network.blockchains.items():
             if name == self.network.get_blockchain_name(b):
                 self.network.follow_chain(index)
                 #self.block
     names = [self.network.blockchains[b].get_name() for b in chains]
     if len(names) >1:
         ChoiceDialog(_('Choose your chain'), names, '', cb).open()