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

Fixed gui sometimes not updating buttons after clicking the disconnect button for the active network.

Fixed gui not behaving properly after cancelling a connection.
This commit is contained in:
imdano
2008-03-31 21:37:21 +00:00
parent c17b437134
commit 6d5a78b124

22
gui.py
View File

@@ -1576,32 +1576,37 @@ class appGui:
return True return True
fast = self.fast fast = self.fast
wiredConnecting = wired.CheckIfWiredConnecting() wired_connecting = wired.CheckIfWiredConnecting()
wirelessConnecting = wireless.CheckIfWirelessConnecting() wireless_connecting = wireless.CheckIfWirelessConnecting()
connecting = wiredConnecting or wirelessConnecting connecting = wired_connecting or wireless_connecting
if connecting and not self.pulse_active: if connecting:
if not self.pulse_active:
self.pulse_active = True self.pulse_active = True
gobject.timeout_add(100, self.pulse_progress_bar) gobject.timeout_add(100, self.pulse_progress_bar)
self.network_list.set_sensitive(False) self.network_list.set_sensitive(False)
self.status_area.show_all() self.status_area.show_all()
if self.statusID: if self.statusID:
self.status_bar.remove(1, self.statusID) self.status_bar.remove(1, self.statusID)
if wirelessConnecting: if wireless_connecting:
if not fast: if not fast:
iwconfig = wireless.GetIwconfig() iwconfig = wireless.GetIwconfig()
else: else:
iwconfig = '' iwconfig = ''
self.set_status(wireless.GetCurrentNetwork(iwconfig, fast) + ': ' + self.set_status(wireless.GetCurrentNetwork(iwconfig, fast) + ': ' +
language[str(wireless.CheckWirelessConnectingMessage())]) language[str(wireless.CheckWirelessConnectingMessage())])
if wiredConnecting: if wired_connecting:
self.set_status(language['wired_network'] + ': ' + self.set_status(language['wired_network'] + ': ' +
language[str(wired.CheckWiredConnectingMessage())]) language[str(wired.CheckWiredConnectingMessage())])
elif self.pulse_active and not connecting: return True
else:
if self.pulse_active:
self.pulse_progress_bar()
self.pulse_active = False self.pulse_active = False
self.update_connect_buttons() self.update_connect_buttons()
self.network_list.set_sensitive(True) self.network_list.set_sensitive(True)
self.status_area.hide_all() self.status_area.hide_all()
if self.statusID: if self.statusID:
self.status_bar.remove(1, self.statusID) self.status_bar.remove(1, self.statusID)
@@ -1933,11 +1938,12 @@ class appGui:
self.update_statusbar() self.update_statusbar()
def disconnect(self, widget, event, nettype, networkid, networkentry): def disconnect(self, widget, event, nettype, networkid, networkentry):
widget.hide()
networkentry.connect_button.show()
if nettype == "wired": if nettype == "wired":
wired.DisconnectWired() wired.DisconnectWired()
else: else:
wireless.DisconnectWireless() wireless.DisconnectWireless()
self.update_connect_buttons()
def wait_for_events(self, amt=0): def wait_for_events(self, amt=0):
""" Wait for any pending gtk events to finish before moving on. """ Wait for any pending gtk events to finish before moving on.