mirror of
https://github.com/gryf/wicd.git
synced 2026-03-18 07:43:44 +01:00
Merged r316 of experimental-nacl, providing some small feature additions and bufixes.
This commit is contained in:
@@ -107,6 +107,12 @@ class DynIntEdit(DynWrap):
|
|||||||
edit = urwid.IntEdit(caption,edit_text)
|
edit = urwid.IntEdit(caption,edit_text)
|
||||||
self.__super.__init__(edit,sensitive,attrs,focus_attr)
|
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):
|
class MaskingEditException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import urwid.curses_display
|
|||||||
|
|
||||||
from wicd import misc
|
from wicd import misc
|
||||||
from wicd import dbusmanager
|
from wicd import dbusmanager
|
||||||
from curses_misc import SelText,DynWrap,ComboBox,TabColumns
|
from curses_misc import SelText,DynWrap,DynRadioButton,ComboBox,TabColumns
|
||||||
|
|
||||||
daemon = None
|
daemon = None
|
||||||
wireless = None
|
wireless = None
|
||||||
@@ -179,21 +179,24 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
self.dhcp_l = []
|
self.dhcp_l = []
|
||||||
# Automatic
|
# Automatic
|
||||||
self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t)
|
self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t)
|
||||||
self.dhcp1 = urwid.RadioButton(self.dhcp_l,dhcp1_t)
|
self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t)
|
||||||
self.dhcp2 = urwid.RadioButton(self.dhcp_l,dhcp2_t)
|
self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t)
|
||||||
self.dhcp3 = urwid.RadioButton(self.dhcp_l,dhcp3_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_l = []
|
||||||
self.wired_detect_header = urwid.Text(wired_detect_header_t)
|
self.wired_detect_header = urwid.Text(wired_detect_header_t)
|
||||||
self.wired0 = urwid.RadioButton(self.wired_l,automatic_t)
|
self.wired0 = urwid.RadioButton(self.wired_l,automatic_t)
|
||||||
self.wired1 = urwid.RadioButton(self.wired_l,wired1_t)
|
self.wired1 = DynRadioButton(self.wired_l,wired1_t)
|
||||||
self.wired2 = urwid.RadioButton(self.wired_l,wired2_t)
|
self.wired2 = DynRadioButton(self.wired_l,wired2_t)
|
||||||
|
self.wired_l = [self.wired0,self.wired1,self.wired2]
|
||||||
|
|
||||||
self.flush_l = []
|
self.flush_l = []
|
||||||
self.flush_header = urwid.Text(flush_header_t)
|
self.flush_header = urwid.Text(flush_header_t)
|
||||||
self.flush0 = urwid.RadioButton(self.flush_l,automatic_t)
|
self.flush0 = urwid.RadioButton(self.flush_l,automatic_t)
|
||||||
self.flush1 = urwid.RadioButton(self.flush_l,flush1_t)
|
self.flush1 = DynRadioButton(self.flush_l,flush1_t)
|
||||||
self.flush2 = urwid.RadioButton(self.flush_l,flush2_t)
|
self.flush2 = DynRadioButton(self.flush_l,flush2_t)
|
||||||
|
self.flush_l = [self.flush0,self.flush1,self.flush2]
|
||||||
|
|
||||||
externalLB = urwid.ListBox([self.dhcp_header,
|
externalLB = urwid.ListBox([self.dhcp_header,
|
||||||
self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3,
|
self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3,
|
||||||
@@ -267,13 +270,20 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
self.wired_auto_l[daemon.GetWiredAutoConnectMethod()-1]
|
self.wired_auto_l[daemon.GetWiredAutoConnectMethod()-1]
|
||||||
self.auto_reconn_checkb.set_state(daemon.GetAutoReconnect())
|
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
|
### External Programs
|
||||||
|
find_avail(self.dhcp_l)
|
||||||
dhcp_method = daemon.GetDHCPClient()
|
dhcp_method = daemon.GetDHCPClient()
|
||||||
self.dhcp_l[dhcp_method].set_state(True)
|
self.dhcp_l[dhcp_method].set_state(True)
|
||||||
|
|
||||||
|
find_avail(self.wired_l)
|
||||||
wired_link_method = daemon.GetLinkDetectionTool()
|
wired_link_method = daemon.GetLinkDetectionTool()
|
||||||
self.wired_l[wired_link_method].set_state(True)
|
self.wired_l[wired_link_method].set_state(True)
|
||||||
|
|
||||||
|
find_avail(self.flush_l)
|
||||||
flush_method = daemon.GetFlushTool()
|
flush_method = daemon.GetFlushTool()
|
||||||
self.flush_l[flush_method].set_state(True)
|
self.flush_l[flush_method].set_state(True)
|
||||||
|
|
||||||
|
|||||||
@@ -616,7 +616,8 @@ class appGUI():
|
|||||||
self.do_diag_lock = False
|
self.do_diag_lock = False
|
||||||
return True
|
return True
|
||||||
self.update_netlist(force_check=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.screen_locked = False
|
||||||
self.update_ui()
|
self.update_ui()
|
||||||
|
|
||||||
|
|||||||
@@ -296,11 +296,13 @@ class BaseInterface(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
self.dhclient_cmd = self._find_program_path("dhclient")
|
self.dhclient_cmd = self._find_program_path("dhclient")
|
||||||
output = misc.Run(self.dhclient_cmd + " --version", include_stderr=True)
|
if self.dhclient_cmd != None:
|
||||||
if '4.' in output:
|
output = misc.Run(self.dhclient_cmd + " --version",
|
||||||
self.dhclient_needs_verbose = True
|
include_stderr=True)
|
||||||
else:
|
if '4.' in output:
|
||||||
self.dhclient_needs_verbose = False
|
self.dhclient_needs_verbose = True
|
||||||
|
else:
|
||||||
|
self.dhclient_needs_verbose = False
|
||||||
self.dhcpcd_cmd = self._find_program_path("dhcpcd")
|
self.dhcpcd_cmd = self._find_program_path("dhcpcd")
|
||||||
self.pump_cmd = self._find_program_path("pump")
|
self.pump_cmd = self._find_program_path("pump")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user