mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Yet another checkpoint in building the Preferences Dialog up to completion. Some of the code isn't used yet, but this should all be done relatively soon.
curses/curses_misc.py: Added a function in the ToggleEdit to set its text to something Changed the name of ComboText to ComboBox Provided the ability to generate the initial parts of a ComboBox w/o needing the screen. Added ComboBoxException, a simple derived exception for the ComboBox. Used it to die of the user never called build_combobox() curses/prefs_curses.py: Changed the names of some of the widgets. Adjusted the code to use the modified ComboBox widget curses/wicd-curses.py: Adjusted the code to use the modified ComboBox widget
This commit is contained in:
@@ -64,7 +64,10 @@ class ToggleEdit(urwid.WidgetWrap):
|
|||||||
else:
|
else:
|
||||||
self._w.set_attr('body')
|
self._w.set_attr('body')
|
||||||
|
|
||||||
# If we aren't sensitive, don't be selectab;e
|
def set_edit_text(self,text):
|
||||||
|
self._w.set_edit_text(text)
|
||||||
|
|
||||||
|
# If we aren't sensitive, don't be selectable
|
||||||
def selectable(self):
|
def selectable(self):
|
||||||
return self.sensitive
|
return self.sensitive
|
||||||
|
|
||||||
@@ -125,10 +128,16 @@ class TabColumns(urwid.WidgetWrap):
|
|||||||
return key
|
return key
|
||||||
# self.listbox.body = lw
|
# self.listbox.body = lw
|
||||||
|
|
||||||
|
|
||||||
|
### Combo box code begins here
|
||||||
|
|
||||||
|
class ComboBoxException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
# A "combo box" of SelTexts
|
# A "combo box" of SelTexts
|
||||||
# I based this off of the code found here:
|
# I based this off of the code found here:
|
||||||
# http://excess.org/urwid/browser/contrib/trunk/rbreu_menus.py
|
# http://excess.org/urwid/browser/contrib/trunk/rbreu_menus.py
|
||||||
class ComboText(urwid.WidgetWrap):
|
class ComboBox(urwid.WidgetWrap):
|
||||||
"""A ComboBox of text objects"""
|
"""A ComboBox of text objects"""
|
||||||
class ComboSpace(urwid.WidgetWrap):
|
class ComboSpace(urwid.WidgetWrap):
|
||||||
"""The actual menu-like space that comes down from the ComboText"""
|
"""The actual menu-like space that comes down from the ComboText"""
|
||||||
@@ -183,8 +192,7 @@ class ComboText(urwid.WidgetWrap):
|
|||||||
|
|
||||||
#def get_size(self):
|
#def get_size(self):
|
||||||
|
|
||||||
def __init__(self,label,list,body,ui,row = 0,show_first=0,attr=('body','focus'),
|
def __init__(self,label='',list=[],attr=('body','focus'),use_enter=True,show_first=0):
|
||||||
use_enter=True):
|
|
||||||
"""
|
"""
|
||||||
label : bit of text that preceeds the combobox. If it is "", then
|
label : bit of text that preceeds the combobox. If it is "", then
|
||||||
ignore it
|
ignore it
|
||||||
@@ -196,29 +204,58 @@ class ComboText(urwid.WidgetWrap):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.label = urwid.Text(label)
|
self.label = urwid.Text(label)
|
||||||
|
self.attr = attr
|
||||||
|
self.list = list
|
||||||
str,trash = self.label.get_text()
|
str,trash = self.label.get_text()
|
||||||
|
|
||||||
self.cbox = urwid.AttrWrap(SelText([list[show_first]+' vvv']),
|
self.overlay = None
|
||||||
attr[0],attr[1])
|
|
||||||
|
self.cbox = urwid.AttrWrap(SelText(' vvv'),attr[0],attr[1])
|
||||||
# Unicode will kill me sooner or later. ^_^
|
# Unicode will kill me sooner or later. ^_^
|
||||||
if label != '':
|
if label != '':
|
||||||
w = urwid.Columns([('fixed',len(str),self.label),self.cbox],dividechars=1)
|
w = urwid.Columns([('fixed',len(str),self.label),self.cbox],dividechars=1)
|
||||||
self.overlay = self.ComboSpace(list,body,ui,show_first,pos=(len(str)+1,row))
|
|
||||||
else:
|
else:
|
||||||
w = urwid.Columns([self.cbox])
|
w = urwid.Columns([self.cbox])
|
||||||
self.overlay = self.ComboSpace(list,body,ui,show_first,pos=(0,row))
|
|
||||||
self.__super.__init__(w)
|
self.__super.__init__(w)
|
||||||
|
|
||||||
# We need this to control the keypress
|
# We need this to pick our keypresses
|
||||||
|
self.use_enter = use_enter
|
||||||
|
|
||||||
|
# Set the focus at the beginning to 0
|
||||||
|
self.show_first = show_first
|
||||||
|
|
||||||
|
def set_list(self,list):
|
||||||
|
self.list = list
|
||||||
|
|
||||||
|
def set_show_first(self,show_first):
|
||||||
|
self.show_first = show_first
|
||||||
|
|
||||||
|
def build_combobox(self,body,ui,row,show_first=0):
|
||||||
|
str,trash = self.label.get_text()
|
||||||
|
self.cbox = urwid.AttrWrap(SelText([self.list[show_first]+' vvv']),
|
||||||
|
self.attr[0],self.attr[1])
|
||||||
|
if str != '':
|
||||||
|
w = urwid.Columns([('fixed',len(str),self.label),self.cbox],dividechars=1)
|
||||||
|
self.overlay = self.ComboSpace(self.list,body,ui,self.show_first,
|
||||||
|
pos=(len(str)+1,row))
|
||||||
|
else:
|
||||||
|
w = urwid.Columns([self.cbox])
|
||||||
|
self.overlay = self.ComboSpace(self.list,body,ui,self.show_first,
|
||||||
|
pos=(0,row))
|
||||||
|
|
||||||
|
self.set_w(w)
|
||||||
self.body = body
|
self.body = body
|
||||||
self.ui = ui
|
self.ui = ui
|
||||||
self.use_enter = use_enter
|
|
||||||
# If we press space or enter, be a combo box!
|
# If we press space or enter, be a combo box!
|
||||||
def keypress(self,size,key):
|
def keypress(self,size,key):
|
||||||
activate = key == ' '
|
activate = key == ' '
|
||||||
if self.use_enter:
|
if self.use_enter:
|
||||||
activate = activate or key == 'enter'
|
activate = activate or key == 'enter'
|
||||||
if activate:
|
if activate:
|
||||||
|
# Die if the user didn't prepare the combobox overlay
|
||||||
|
if self.overlay == None:
|
||||||
|
raise ComboBoxException('ComboBox must be built before use!')
|
||||||
retval = self.overlay.show(self.ui,self.body)
|
retval = self.overlay.show(self.ui,self.body)
|
||||||
if retval != None:
|
if retval != None:
|
||||||
self.cbox.set_w(SelText(retval+' vvv'))
|
self.cbox.set_w(SelText(retval+' vvv'))
|
||||||
|
|||||||
@@ -22,7 +22,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,ToggleEdit,ComboText,TabColumns
|
from curses_misc import SelText,ToggleEdit,ComboBox,TabColumns
|
||||||
|
|
||||||
daemon = None
|
daemon = None
|
||||||
wireless = None
|
wireless = None
|
||||||
@@ -33,7 +33,6 @@ language = misc.get_language_list_gui()
|
|||||||
class PrefsDialog(urwid.WidgetWrap):
|
class PrefsDialog(urwid.WidgetWrap):
|
||||||
def __init__(self,body,pos,ui,dbus=None):
|
def __init__(self,body,pos,ui,dbus=None):
|
||||||
global daemon, wireless, wired
|
global daemon, wireless, wired
|
||||||
self.ui = ui
|
|
||||||
|
|
||||||
daemon = dbus['daemon']
|
daemon = dbus['daemon']
|
||||||
wireless = dbus['wireless']
|
wireless = dbus['wireless']
|
||||||
@@ -91,9 +90,9 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
wired1_t = 'ethtool'
|
wired1_t = 'ethtool'
|
||||||
wired2_t = 'mii-tool'
|
wired2_t = 'mii-tool'
|
||||||
|
|
||||||
route_table_header_t = ('header',language["route_flush"])
|
flush_header_t = ('header',language["route_flush"])
|
||||||
route1_t = 'ip'
|
flush1_t = 'ip'
|
||||||
route2_t = 'route'
|
flush2_t = 'route'
|
||||||
|
|
||||||
#### Advanced Settings
|
#### Advanced Settings
|
||||||
#wpa_t=('editcp',language['wpa_supplicant_driver']+':')
|
#wpa_t=('editcp',language['wpa_supplicant_driver']+':')
|
||||||
@@ -122,10 +121,12 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
|
|
||||||
# General Settings
|
# General Settings
|
||||||
self.net_cat = urwid.Text(net_cat_t)
|
self.net_cat = urwid.Text(net_cat_t)
|
||||||
self.wired_iface = urwid.AttrWrap(urwid.Edit(wired_t),'editbx','editfc')
|
self.wired_edit = urwid.AttrWrap(urwid.Edit(wired_t),'editbx','editfc')
|
||||||
self.wless_iface = urwid.AttrWrap(urwid.Edit(wless_t),'editbx','editfc')
|
self.wless_edit = urwid.AttrWrap(urwid.Edit(wless_t),'editbx','editfc')
|
||||||
|
|
||||||
self.global_dns_cat = urwid.Text(global_dns_cat_t)
|
self.global_dns_cat = urwid.Text(global_dns_cat_t)
|
||||||
|
# Default the global DNS settings to off. They will be reenabled later
|
||||||
|
# if so required.
|
||||||
global_dns_state = False
|
global_dns_state = False
|
||||||
self.global_dns_checkb = urwid.CheckBox(global_dns_t,global_dns_state,
|
self.global_dns_checkb = urwid.CheckBox(global_dns_t,global_dns_state,
|
||||||
on_state_change=self.global_dns_trigger)
|
on_state_change=self.global_dns_trigger)
|
||||||
@@ -142,8 +143,8 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
self.wired_auto_2 = urwid.RadioButton(wired_auto_l,wired_auto_2_t)
|
self.wired_auto_2 = urwid.RadioButton(wired_auto_l,wired_auto_2_t)
|
||||||
self.wired_auto_3 = urwid.RadioButton(wired_auto_l,wired_auto_3_t)
|
self.wired_auto_3 = urwid.RadioButton(wired_auto_l,wired_auto_3_t)
|
||||||
generalLB = urwid.ListBox([self.net_cat,
|
generalLB = urwid.ListBox([self.net_cat,
|
||||||
self.wless_iface,#self._blank,
|
self.wless_edit,#self._blank,
|
||||||
self.wired_iface,
|
self.wired_edit,
|
||||||
self.always_show_wired_checkb,self._blank,
|
self.always_show_wired_checkb,self._blank,
|
||||||
self.global_dns_cat,
|
self.global_dns_cat,
|
||||||
self.global_dns_checkb,#self._blank,
|
self.global_dns_checkb,#self._blank,
|
||||||
@@ -159,24 +160,24 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
automatic_t = language['wicd_auto_config']
|
automatic_t = language['wicd_auto_config']
|
||||||
|
|
||||||
self.dhcp_header = urwid.Text(dhcp_header_t)
|
self.dhcp_header = urwid.Text(dhcp_header_t)
|
||||||
dhcp_l = []
|
self.dhcp_l = []
|
||||||
# Automatic
|
# Automatic
|
||||||
self.dhcp0 = urwid.RadioButton(dhcp_l,automatic_t)
|
self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t)
|
||||||
self.dhcp1 = urwid.RadioButton(dhcp_l,dhcp1_t)
|
self.dhcp1 = urwid.RadioButton(self.dhcp_l,dhcp1_t)
|
||||||
self.dhcp2 = urwid.RadioButton(dhcp_l,dhcp2_t)
|
self.dhcp2 = urwid.RadioButton(self.dhcp_l,dhcp2_t)
|
||||||
self.dhcp3 = urwid.RadioButton(dhcp_l,dhcp3_t)
|
self.dhcp3 = urwid.RadioButton(self.dhcp_l,dhcp3_t)
|
||||||
|
|
||||||
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(wired_l,automatic_t)
|
self.wired0 = urwid.RadioButton(self.wired_l,automatic_t)
|
||||||
self.wired1 = urwid.RadioButton(wired_l,wired1_t)
|
self.wired1 = urwid.RadioButton(self.wired_l,wired1_t)
|
||||||
self.wired2 = urwid.RadioButton(wired_l,wired2_t)
|
self.wired2 = urwid.RadioButton(self.wired_l,wired2_t)
|
||||||
|
|
||||||
route_l = []
|
self.flush_l = []
|
||||||
self.route_table_header = urwid.Text(route_table_header_t)
|
self.flush_header = urwid.Text(flush_header_t)
|
||||||
self.route0 = urwid.RadioButton(route_l,automatic_t)
|
self.flush0 = urwid.RadioButton(self.flush_l,automatic_t)
|
||||||
self.route1 = urwid.RadioButton(route_l,route1_t)
|
self.flush1 = urwid.RadioButton(self.flush_l,flush1_t)
|
||||||
self.route2 = urwid.RadioButton(route_l,route2_t)
|
self.flush2 = urwid.RadioButton(self.flush_l,flush2_t)
|
||||||
|
|
||||||
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,
|
||||||
@@ -184,18 +185,18 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
self.wired_detect_header,
|
self.wired_detect_header,
|
||||||
self.wired0,self.wired1,self.wired2,
|
self.wired0,self.wired1,self.wired2,
|
||||||
self._blank,
|
self._blank,
|
||||||
self.route_table_header,
|
self.flush_header,
|
||||||
self.route0,self.route1,self.route2
|
self.flush0,self.flush1,self.flush2
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
#### Advanced settings
|
#### Advanced settings
|
||||||
self.wpa_cat = urwid.Text(wpa_cat_t)
|
self.wpa_cat = urwid.Text(wpa_cat_t)
|
||||||
self.wpa_cbox = ComboText(wpa_t,wpa_list,self,ui,4)
|
self.wpa_cbox = ComboBox(wpa_t)
|
||||||
self.wpa_warn = urwid.Text(wpa_warn_t)
|
self.wpa_warn = urwid.Text(wpa_warn_t)
|
||||||
|
|
||||||
self.backend_cat = urwid.Text(backend_cat_t)
|
self.backend_cat = urwid.Text(backend_cat_t)
|
||||||
self.backend_cbox = ComboText(backend_t,backend_list,self,ui,8)
|
self.backend_cbox = ComboBox(backend_t)
|
||||||
|
|
||||||
self.debug_cat = urwid.Text(debug_cat_t)
|
self.debug_cat = urwid.Text(debug_cat_t)
|
||||||
self.debug_mode_checkb = urwid.CheckBox(debug_mode_t)
|
self.debug_mode_checkb = urwid.CheckBox(debug_mode_t)
|
||||||
@@ -223,7 +224,7 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
self.tab_map = {self.header0 : generalLB,
|
self.tab_map = {self.header0 : generalLB,
|
||||||
self.header1 : externalLB,
|
self.header1 : externalLB,
|
||||||
self.header2 : advancedLB}
|
self.header2 : advancedLB}
|
||||||
self.load_settings()
|
#self.load_settings()
|
||||||
|
|
||||||
# Now for the buttons:
|
# Now for the buttons:
|
||||||
|
|
||||||
@@ -266,6 +267,11 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
def global_dns_trigger(self,check_box,new_state,user_data=None):
|
def global_dns_trigger(self,check_box,new_state,user_data=None):
|
||||||
for w in self.search_dom,self.dns1,self.dns2,self.dns3:
|
for w in self.search_dom,self.dns1,self.dns2,self.dns3:
|
||||||
w.set_sensitive(new_state)
|
w.set_sensitive(new_state)
|
||||||
|
|
||||||
|
def ready_comboboxes(self,ui,body):
|
||||||
|
self.wpa_cbox.build_combobox(body,ui,4)
|
||||||
|
self.backend_cbox.build_combobox(body,ui,8)
|
||||||
|
|
||||||
# Normal keypress, but if we are at the top, then be "tabbish" instead
|
# Normal keypress, but if we are at the top, then be "tabbish" instead
|
||||||
#def keypress(self,size,ui):
|
#def keypress(self,size,ui):
|
||||||
# self._w.keypress(size,ui)
|
# self._w.keypress(size,ui)
|
||||||
@@ -283,16 +289,16 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
# Put the widget into an overlay, and run!
|
# Put the widget into an overlay, and run!
|
||||||
def run(self,ui, dim, display):
|
def run(self,ui, dim, display):
|
||||||
width,height = ui.get_cols_rows()
|
width,height = ui.get_cols_rows()
|
||||||
|
self.load_settings()
|
||||||
|
# TODO: The below, if things go 'well'
|
||||||
# If we are small, "tabbify" the interface
|
# If we are small, "tabbify" the interface
|
||||||
|
|
||||||
# Else, pile it together
|
# Else, pile it together
|
||||||
|
|
||||||
overlay = urwid.Overlay(self.tabs, display, ('fixed left', 0),width
|
overlay = urwid.Overlay(self.tabs, display, ('fixed left', 0),width
|
||||||
, ('fixed top',1), height-3)
|
, ('fixed top',1), height-3)
|
||||||
|
# Will need once we actually get the comboboxes filled with stuff
|
||||||
|
#self.ready_comboboxes(ui,overlay)
|
||||||
|
|
||||||
#dialog = TabbedOverlay(["Foo", "Bar", "Quit"],
|
|
||||||
# ('body', 'focus'), (1, 1), display)
|
|
||||||
|
|
||||||
#dialog = PrefOverlay(display,(0,1))
|
|
||||||
keys = True
|
keys = True
|
||||||
while True:
|
while True:
|
||||||
if keys:
|
if keys:
|
||||||
@@ -308,10 +314,13 @@ class PrefsDialog(urwid.WidgetWrap):
|
|||||||
#Send key to underlying widget:
|
#Send key to underlying widget:
|
||||||
overlay.keypress(dim, k)
|
overlay.keypress(dim, k)
|
||||||
|
|
||||||
def run():
|
def run_it():
|
||||||
dialog = PrefsDialog(None,(0,0),ui,dbusmanager.get_dbus_ifaces())
|
dialog = PrefsDialog(None,(0,0),ui,dbusmanager.get_dbus_ifaces())
|
||||||
keys = True
|
keys = True
|
||||||
dim = ui.get_cols_rows()
|
dim = ui.get_cols_rows()
|
||||||
|
dialog.load_settings()
|
||||||
|
# Will need once we actually get the comboboxes filled with stuff
|
||||||
|
#self.ready_comboboxes(ui,overlay)
|
||||||
while True:
|
while True:
|
||||||
if keys:
|
if keys:
|
||||||
ui.draw_screen(dim, dialog.render(dim, True))
|
ui.draw_screen(dim, dialog.render(dim, True))
|
||||||
@@ -347,4 +356,4 @@ if __name__=='__main__':
|
|||||||
('editbx', 'light gray', 'dark blue'),
|
('editbx', 'light gray', 'dark blue'),
|
||||||
('editfc', 'white','dark blue', 'bold'),
|
('editfc', 'white','dark blue', 'bold'),
|
||||||
('tab active','dark green','light gray')])
|
('tab active','dark green','light gray')])
|
||||||
ui.run_wrapper(run)
|
ui.run_wrapper(run_it)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import sys
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
# Curses UIs for other stuff
|
# Curses UIs for other stuff
|
||||||
from curses_misc import SelText,ComboText
|
from curses_misc import SelText,ComboBox
|
||||||
import prefs_curses
|
import prefs_curses
|
||||||
from prefs_curses import PrefsDialog
|
from prefs_curses import PrefsDialog
|
||||||
|
|
||||||
@@ -230,21 +230,8 @@ class appGUI():
|
|||||||
self.wiredH=urwid.Filler(urwid.Text("Wired Network(s)"))
|
self.wiredH=urwid.Filler(urwid.Text("Wired Network(s)"))
|
||||||
self.wlessH=urwid.Filler(urwid.Text("Wireless Network(s)"))
|
self.wlessH=urwid.Filler(urwid.Text("Wireless Network(s)"))
|
||||||
|
|
||||||
self.footer1 = urwid.AttrWrap(urwid.Text("Something important will eventually go here."),'body')
|
|
||||||
self.footer2 = urwid.AttrWrap(urwid.Text("If you are seeing this, then something has gone wrong!"),'important')
|
|
||||||
self.footerList = urwid.ListBox([self.footer1,self.footer2])
|
|
||||||
# Pop takes a number!
|
|
||||||
#walker.pop(1)
|
|
||||||
nothingness = urwid.Filler(urwid.Text('Hello, world!'))
|
|
||||||
self.frame = urwid.Frame(nothingness,
|
|
||||||
header=header,
|
|
||||||
footer=urwid.BoxAdapter(self.footerList,2))
|
|
||||||
self.frame.set_focus('body')
|
|
||||||
|
|
||||||
# Miiiiiiiiiiight be changing this back to something like how it was
|
|
||||||
# originally
|
|
||||||
wiredL,wlessL = gen_network_list()
|
wiredL,wlessL = gen_network_list()
|
||||||
self.wiredCB = urwid.Filler(ComboText('',wiredL,self.frame,ui,3,use_enter=False))
|
self.wiredCB = urwid.Filler(ComboBox(list=wiredL,use_enter=False))
|
||||||
self.wlessLB = urwid.ListBox(wlessL)
|
self.wlessLB = urwid.ListBox(wlessL)
|
||||||
# Stuff I used to simulate large lists
|
# Stuff I used to simulate large lists
|
||||||
#spam = SelText('spam')
|
#spam = SelText('spam')
|
||||||
@@ -259,6 +246,17 @@ class appGUI():
|
|||||||
('fixed',1,self.wlessH),
|
('fixed',1,self.wlessH),
|
||||||
self.wlessLB] )
|
self.wlessLB] )
|
||||||
|
|
||||||
|
self.footer1 = urwid.AttrWrap(urwid.Text("Something important will eventually go here."),'body')
|
||||||
|
self.footer2 = urwid.AttrWrap(urwid.Text("If you are seeing this, then something has gone wrong!"),'important')
|
||||||
|
self.footerList = urwid.ListBox([self.footer1,self.footer2])
|
||||||
|
# Pop takes a number!
|
||||||
|
#walker.pop(1)
|
||||||
|
nothingness = urwid.Filler(urwid.Text('Hello, world!'))
|
||||||
|
self.frame = urwid.Frame(self.thePile,
|
||||||
|
header=header,
|
||||||
|
footer=urwid.BoxAdapter(self.footerList,2))
|
||||||
|
self.wiredCB.get_body().build_combobox(self.frame,ui,3)
|
||||||
|
|
||||||
self.frame.set_body(self.thePile)
|
self.frame.set_body(self.thePile)
|
||||||
# Booleans gallore!
|
# Booleans gallore!
|
||||||
self.prev_state = False
|
self.prev_state = False
|
||||||
@@ -270,7 +268,6 @@ class appGUI():
|
|||||||
|
|
||||||
#self.dialog = PrefOverlay(self.frame,self.size)
|
#self.dialog = PrefOverlay(self.frame,self.size)
|
||||||
|
|
||||||
|
|
||||||
# Does what it says it does
|
# Does what it says it does
|
||||||
def lock_screen(self):
|
def lock_screen(self):
|
||||||
self.frame.set_body(self.screen_locker)
|
self.frame.set_body(self.screen_locker)
|
||||||
@@ -294,8 +291,10 @@ class appGUI():
|
|||||||
state, x = daemon.GetConnectionStatus()
|
state, x = daemon.GetConnectionStatus()
|
||||||
if self.prev_state != state or force_check:
|
if self.prev_state != state or force_check:
|
||||||
wiredL,wlessL = gen_network_list()
|
wiredL,wlessL = gen_network_list()
|
||||||
self.wiredCB = urwid.Filler(ComboText('',wiredL,self.frame,ui,3,
|
#self.wiredCB = urwid.Filler(ComboBox(wiredL,self.frame,ui,3,
|
||||||
use_enter=False))
|
# use_enter=False))
|
||||||
|
self.wiredCB.get_body().set_list(wiredL)
|
||||||
|
self.wiredCB.get_body().build_combobox(self.frame,ui,3)
|
||||||
self.wlessLB.body = urwid.SimpleListWalker(wlessL)
|
self.wlessLB.body = urwid.SimpleListWalker(wlessL)
|
||||||
|
|
||||||
self.prev_state = state
|
self.prev_state = state
|
||||||
@@ -440,7 +439,7 @@ class appGUI():
|
|||||||
self.frame.keypress( self.size, k )
|
self.frame.keypress( self.size, k )
|
||||||
|
|
||||||
if " " in keys:
|
if " " in keys:
|
||||||
self.set_status('space pressed on wiredCB!')
|
#self.set_status('space pressed on wiredCB!')
|
||||||
wid,pos = self.wiredCB.get_body().get_selected()
|
wid,pos = self.wiredCB.get_body().get_selected()
|
||||||
text,attr = wid.get_text()
|
text,attr = wid.get_text()
|
||||||
wired.ReadWiredNetworkProfile(text)
|
wired.ReadWiredNetworkProfile(text)
|
||||||
|
|||||||
Reference in New Issue
Block a user