mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 04:48:00 +01:00
Made scans asynchronous so that users can actually access preferences while the daemon is scanning.
This commit is contained in:
@@ -586,6 +586,7 @@ class appGUI():
|
|||||||
self.connecting = False
|
self.connecting = False
|
||||||
self.screen_locked = False
|
self.screen_locked = False
|
||||||
self.do_diag_lock = False
|
self.do_diag_lock = False
|
||||||
|
self.scanning = False
|
||||||
|
|
||||||
self.pref = None
|
self.pref = None
|
||||||
|
|
||||||
@@ -593,6 +594,11 @@ class appGUI():
|
|||||||
|
|
||||||
#self.dialog = PrefOverlay(self.frame,self.size)
|
#self.dialog = PrefOverlay(self.frame,self.size)
|
||||||
|
|
||||||
|
def doScan(self, sync=False):
|
||||||
|
self.scanning = True
|
||||||
|
wireless.Scan(False)
|
||||||
|
|
||||||
|
|
||||||
def init_other_optcols(self):
|
def init_other_optcols(self):
|
||||||
# The "tabbed" preferences dialog
|
# The "tabbed" preferences dialog
|
||||||
self.prefCols = OptCols( [('meta enter','OK'),
|
self.prefCols = OptCols( [('meta enter','OK'),
|
||||||
@@ -631,7 +637,7 @@ class appGUI():
|
|||||||
# That dialog will sit there for a while if I don't get rid of it
|
# That dialog will sit there for a while if I don't get rid of it
|
||||||
self.update_ui()
|
self.update_ui()
|
||||||
wireless.SetHiddenNetworkESSID(misc.noneToString(hidden))
|
wireless.SetHiddenNetworkESSID(misc.noneToString(hidden))
|
||||||
wireless.Scan(True)
|
wireless.Scan(False)
|
||||||
wireless.SetHiddenNetworkESSID("")
|
wireless.SetHiddenNetworkESSID("")
|
||||||
|
|
||||||
def update_focusloc(self):
|
def update_focusloc(self):
|
||||||
@@ -815,14 +821,16 @@ class appGUI():
|
|||||||
#if not self.connecting:
|
#if not self.connecting:
|
||||||
# gobject.idle_add(self.refresh_networks, None, False, None)
|
# gobject.idle_add(self.refresh_networks, None, False, None)
|
||||||
self.unlock_screen()
|
self.unlock_screen()
|
||||||
|
self.scanning = False
|
||||||
|
|
||||||
# Same, same, same, same, same, same
|
# Same, same, same, same, same, same
|
||||||
#@wrap_exceptions()
|
#@wrap_exceptions()
|
||||||
def dbus_scan_started(self):
|
def dbus_scan_started(self):
|
||||||
|
self.scanning = True
|
||||||
self.lock_screen()
|
self.lock_screen()
|
||||||
|
|
||||||
def restore_primary(self):
|
def restore_primary(self):
|
||||||
if self.do_diag_lock:
|
if self.do_diag_lock or self.scanning:
|
||||||
self.frame.set_body(self.screen_locker)
|
self.frame.set_body(self.screen_locker)
|
||||||
self.do_diag_lock = False
|
self.do_diag_lock = False
|
||||||
else:
|
else:
|
||||||
@@ -839,23 +847,24 @@ class appGUI():
|
|||||||
#return False
|
#return False
|
||||||
if "f5" in keys or 'R' in keys:
|
if "f5" in keys or 'R' in keys:
|
||||||
self.lock_screen()
|
self.lock_screen()
|
||||||
wireless.Scan(True)
|
self.doScan()
|
||||||
if "D" in keys:
|
if "D" in keys:
|
||||||
# Disconnect from all networks.
|
# Disconnect from all networks.
|
||||||
daemon.Disconnect()
|
daemon.Disconnect()
|
||||||
self.update_netlist()
|
self.update_netlist()
|
||||||
if 'right' in keys:
|
if 'right' in keys:
|
||||||
focus = self.thePile.get_focus()
|
if not self.scanning:
|
||||||
self.frame.set_footer(urwid.Pile([self.confCols,self.footer2]))
|
focus = self.thePile.get_focus()
|
||||||
if focus == self.wiredCB:
|
self.frame.set_footer(urwid.Pile([self.confCols,self.footer2]))
|
||||||
self.diag = WiredSettingsDialog(self.wiredCB.get_body().get_selected_profile())
|
if focus == self.wiredCB:
|
||||||
self.frame.set_body(self.diag)
|
self.diag = WiredSettingsDialog(self.wiredCB.get_body().get_selected_profile())
|
||||||
else:
|
self.frame.set_body(self.diag)
|
||||||
# wireless list only other option
|
else:
|
||||||
wid,pos = self.thePile.get_focus().get_focus()
|
# wireless list only other option
|
||||||
self.diag = WirelessSettingsDialog(pos,self.frame)
|
wid,pos = self.thePile.get_focus().get_focus()
|
||||||
self.diag.ready_widgets(ui,self.frame)
|
self.diag = WirelessSettingsDialog(pos,self.frame)
|
||||||
self.frame.set_body(self.diag)
|
self.diag.ready_widgets(ui,self.frame)
|
||||||
|
self.frame.set_body(self.diag)
|
||||||
# Guess what! I actually need to put this here, else I'll have
|
# Guess what! I actually need to put this here, else I'll have
|
||||||
# tons of references to self.frame lying around. ^_^
|
# tons of references to self.frame lying around. ^_^
|
||||||
if "enter" in keys:
|
if "enter" in keys:
|
||||||
|
|||||||
Reference in New Issue
Block a user