Browse Source

Update servers list once fetched from remote.

283
Amir Taaki 13 years ago
parent
commit
b25e93c4bc
  1. 40
      lib/gui_lite.py

40
lib/gui_lite.py

@ -469,7 +469,8 @@ class ReceivePopup(QDialog):
self.setMouseTracking(True) self.setMouseTracking(True)
self.setWindowTitle("Electrum - " + _("Receive Bitcoin payment")) self.setWindowTitle("Electrum - " + _("Receive Bitcoin payment"))
self.setWindowFlags(Qt.Window|Qt.FramelessWindowHint|Qt.MSWindowsFixedSizeDialogHint) self.setWindowFlags(Qt.Window|Qt.FramelessWindowHint|
Qt.MSWindowsFixedSizeDialogHint)
self.layout().setSizeConstraint(QLayout.SetFixedSize) self.layout().setSizeConstraint(QLayout.SetFixedSize)
#self.setFrameStyle(QFrame.WinPanel|QFrame.Raised) #self.setFrameStyle(QFrame.WinPanel|QFrame.Raised)
#self.setAlignment(Qt.AlignCenter) #self.setAlignment(Qt.AlignCenter)
@ -482,9 +483,11 @@ class ReceivePopup(QDialog):
QCursor.setPos(center_mouse_pos) QCursor.setPos(center_mouse_pos)
self.show() self.show()
class MiniActuator: class MiniActuator(QObject):
def __init__(self, wallet): def __init__(self, wallet):
super(QObject, self).__init__()
self.wallet = wallet self.wallet = wallet
self.theme_name = self.wallet.theme self.theme_name = self.wallet.theme
@ -522,6 +525,7 @@ class MiniActuator:
def set_servers_gui_stuff(self, servers_menu, servers_group): def set_servers_gui_stuff(self, servers_menu, servers_group):
self.servers_menu = servers_menu self.servers_menu = servers_menu
self.servers_group = servers_group self.servers_group = servers_group
self.connect(self, SIGNAL("updateservers()"), self.update_servers_list)
def populate_servers_menu(self): def populate_servers_menu(self):
interface = self.wallet.interface interface = self.wallet.interface
@ -541,21 +545,29 @@ class MiniActuator:
server_action.setCheckable(True) server_action.setCheckable(True)
if server_name == current_server: if server_name == current_server:
server_action.setChecked(True) server_action.setChecked(True)
#class SelectServerFunctor: class SelectServerFunctor:
# def __init__(self, server_name, servers_list): def __init__(self, server_name, server_selected):
# self.server_name = server_name self.server_name = server_name
# self.servers_list = servers_list self.server_selected = server_selected
# def __call__(self, checked): def __call__(self, checked):
# if checked: if checked:
# # call server_list_changed # call server_selected
# self. self.server_selected(self.server_name)
delegate = SelectServerFunctor(server_name, self.server_selected)
server_action.toggled.connect(delegate)
self.servers_group.addAction(server_action) self.servers_group.addAction(server_action)
def server_list_changed(self): def server_list_changed(self):
# clear servers_menu self.emit(SIGNAL("updateservers()"))
# clear servers_group?
# call populate_servers_menu def update_servers_list(self):
print "hello" # Clear servers_group
for action in self.servers_group.actions():
self.servers_group.removeAction(action)
self.populate_servers_menu()
def server_selected(self, server_name):
print server_name
def copy_address(self, receive_popup): def copy_address(self, receive_popup):
addrs = [addr for addr in self.wallet.all_addresses() addrs = [addr for addr in self.wallet.all_addresses()

Loading…
Cancel
Save