1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 04:48:00 +01:00

Enable/disable the "Disconnect all" button depending on the current connection state

This commit is contained in:
David Paleino
2012-12-01 10:27:50 +01:00
parent e0505c0df6
commit dd30047e80

View File

@@ -217,6 +217,7 @@ class appGui(object):
probar = self.wTree.get_object("progressbar") probar = self.wTree.get_object("progressbar")
probar.set_text(_('Connecting')) probar.set_text(_('Connecting'))
self.disconnect_all_button = self.wTree.get_object('disconnect_button')
self.rfkill_button = self.wTree.get_object("rfkill_button") self.rfkill_button = self.wTree.get_object("rfkill_button")
self.all_network_list = self.wTree.get_object("network_list_vbox") self.all_network_list = self.wTree.get_object("network_list_vbox")
self.all_network_list.show_all() self.all_network_list.show_all()
@@ -598,7 +599,7 @@ class appGui(object):
return True return True
def update_connect_buttons(self, state=None, x=None, force_check=False): def update_connect_buttons(self, state=None, x=None, force_check=False):
""" Updates the connect/disconnect buttons for each network entry. """ Updates the connect/disconnect buttons for the GUI.
If force_check is given, update the buttons even if the If force_check is given, update the buttons even if the
current network state is the same as the previous. current network state is the same as the previous.
@@ -609,6 +610,9 @@ class appGui(object):
if not state: if not state:
state, x = daemon.GetConnectionStatus() state, x = daemon.GetConnectionStatus()
self.disconnect_all_button.set_sensitive(
state in [misc.WIRED, misc.WIRELESS]
)
if self.prev_state != state or force_check: if self.prev_state != state or force_check:
apbssid = wireless.GetApBssid() apbssid = wireless.GetApBssid()
for entry in chain(self.network_list, self.wired_network_box): for entry in chain(self.network_list, self.wired_network_box):