1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-23 22:52:33 +01:00

Merged r316 of experimental-nacl, providing some small feature additions and bufixes.

This commit is contained in:
Andrew Psaltis
2009-04-21 17:47:46 -04:00
4 changed files with 33 additions and 14 deletions

View File

@@ -107,6 +107,12 @@ class DynIntEdit(DynWrap):
edit = urwid.IntEdit(caption,edit_text)
self.__super.__init__(edit,sensitive,attrs,focus_attr)
class DynRadioButton(DynWrap):
def __init__(self,group,label,state='first True',on_state_change=None, user_data=None, sensitive=True, attrs=('body','editnfc'),focus_attr='body'):
#caption = ('editcp',caption + ':')
button = urwid.RadioButton(group,label,state,on_state_change,user_data)
self.__super.__init__(button,sensitive,attrs,focus_attr)
class MaskingEditException(Exception):
pass

View File

@@ -24,7 +24,7 @@ import urwid.curses_display
from wicd import misc
from wicd import dbusmanager
from curses_misc import SelText,DynWrap,ComboBox,TabColumns
from curses_misc import SelText,DynWrap,DynRadioButton,ComboBox,TabColumns
daemon = None
wireless = None
@@ -179,21 +179,24 @@ class PrefsDialog(urwid.WidgetWrap):
self.dhcp_l = []
# Automatic
self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t)
self.dhcp1 = urwid.RadioButton(self.dhcp_l,dhcp1_t)
self.dhcp2 = urwid.RadioButton(self.dhcp_l,dhcp2_t)
self.dhcp3 = urwid.RadioButton(self.dhcp_l,dhcp3_t)
self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t)
self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t)
self.dhcp3 = DynRadioButton(self.dhcp_l,dhcp3_t)
self.dhcp_l = [self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3]
self.wired_l = []
self.wired_detect_header = urwid.Text(wired_detect_header_t)
self.wired0 = urwid.RadioButton(self.wired_l,automatic_t)
self.wired1 = urwid.RadioButton(self.wired_l,wired1_t)
self.wired2 = urwid.RadioButton(self.wired_l,wired2_t)
self.wired1 = DynRadioButton(self.wired_l,wired1_t)
self.wired2 = DynRadioButton(self.wired_l,wired2_t)
self.wired_l = [self.wired0,self.wired1,self.wired2]
self.flush_l = []
self.flush_header = urwid.Text(flush_header_t)
self.flush0 = urwid.RadioButton(self.flush_l,automatic_t)
self.flush1 = urwid.RadioButton(self.flush_l,flush1_t)
self.flush2 = urwid.RadioButton(self.flush_l,flush2_t)
self.flush1 = DynRadioButton(self.flush_l,flush1_t)
self.flush2 = DynRadioButton(self.flush_l,flush2_t)
self.flush_l = [self.flush0,self.flush1,self.flush2]
externalLB = urwid.ListBox([self.dhcp_header,
self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3,
@@ -267,13 +270,20 @@ class PrefsDialog(urwid.WidgetWrap):
self.wired_auto_l[daemon.GetWiredAutoConnectMethod()-1]
self.auto_reconn_checkb.set_state(daemon.GetAutoReconnect())
def find_avail(apps):
for app in apps[1:]:
app.set_sensitive(daemon.GetAppAvailable(app.get_label()))
### External Programs
find_avail(self.dhcp_l)
dhcp_method = daemon.GetDHCPClient()
self.dhcp_l[dhcp_method].set_state(True)
find_avail(self.wired_l)
wired_link_method = daemon.GetLinkDetectionTool()
self.wired_l[wired_link_method].set_state(True)
find_avail(self.flush_l)
flush_method = daemon.GetFlushTool()
self.flush_l[flush_method].set_state(True)

View File

@@ -616,7 +616,8 @@ class appGUI():
self.do_diag_lock = False
return True
self.update_netlist(force_check=True)
self.frame.set_body(self.thePile)
if not self.diag:
self.frame.set_body(self.thePile)
self.screen_locked = False
self.update_ui()

View File

@@ -296,11 +296,13 @@ class BaseInterface(object):
"""
self.dhclient_cmd = self._find_program_path("dhclient")
output = misc.Run(self.dhclient_cmd + " --version", include_stderr=True)
if '4.' in output:
self.dhclient_needs_verbose = True
else:
self.dhclient_needs_verbose = False
if self.dhclient_cmd != None:
output = misc.Run(self.dhclient_cmd + " --version",
include_stderr=True)
if '4.' in output:
self.dhclient_needs_verbose = True
else:
self.dhclient_needs_verbose = False
self.dhcpcd_cmd = self._find_program_path("dhcpcd")
self.pump_cmd = self._find_program_path("pump")