fix a bug in service screen, add service_init
This commit is contained in:
@@ -205,21 +205,32 @@ def service_construct(w):
|
||||
w - Widget instance '''
|
||||
|
||||
# first refresh service state
|
||||
ri_data.Service.change_state()
|
||||
wit = w.widgets.pop()
|
||||
for i in ri_data.Service.list:
|
||||
wi = copy.deepcopy(wit)
|
||||
wi.attr['text'] = i.name
|
||||
vn = "service_%s" %(i.name)
|
||||
# process widget name
|
||||
wi.name = vn
|
||||
ri_widget.Widget.dict[vn] = wi
|
||||
wi.attr['text'] = i.name
|
||||
wi.attr['variable'] = vn
|
||||
wi.variables = [(vn, 'StringVar', i.start=='yes' and 'yes' or 'no')]
|
||||
if i.start == 'disable':
|
||||
wi.attr['state'] = 'disable'
|
||||
wi.variables = [(vn, 'StringVar', '')]
|
||||
idx = ri_data.Service.list.index(i)
|
||||
wi.grid_location.dict['column'] = idx % int(w.grid_management.columns)
|
||||
wi.grid_location.dict['row'] = idx / int(w.grid_management.columns)
|
||||
w.add_sub_widget(wi)
|
||||
|
||||
def service_init():
|
||||
''' initialize service checkboxes, based on package selection '''
|
||||
# first refresh service state
|
||||
ri_data.Service.change_state()
|
||||
for i in ri_data.Service.list:
|
||||
vn = "service_%s" %(i.name)
|
||||
win = ri_widget.Widget.dict[vn].tk_widget
|
||||
if i.start == 'disable':
|
||||
win.configure(state = 'disable')
|
||||
display.var_dict[vn].set(value=i.start=='yes' and 'yes' or 'no')
|
||||
|
||||
def service_quit():
|
||||
''' record service state '''
|
||||
for i in ri_data.Service.list:
|
||||
|
||||
@@ -75,7 +75,6 @@ class Widget:
|
||||
self.action = Action(node)
|
||||
elif node.nodeName == 'binding':
|
||||
seq = node.attributes["sequence"].value
|
||||
print seq
|
||||
self.bindings.append((seq, \
|
||||
node.attributes["function"].value))
|
||||
|
||||
|
||||
@@ -31,20 +31,20 @@
|
||||
</raid>
|
||||
</raids>
|
||||
<mount-points>
|
||||
<mount-point device='md0' directory='/usr' file-system='' format='no'/>
|
||||
<mount-point device='md1' directory='/usr/lib64' file-system='' format='no'/>
|
||||
<mount-point device='sda1' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sda2' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sda3' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sda4' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sdb1' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sdb2' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sdb3' directory='/olp' file-system='reiserfs' format='yes'/>
|
||||
<mount-point device='sdb4' directory='/' file-system='ext3' format='yes'/>
|
||||
<mount-point device='md0' directory='/usr' file-system='' format='no'/>
|
||||
<mount-point device='sda1' directory='' file-system='' format='no'/>
|
||||
<mount-point device='sdb1' directory='' file-system='' format='no'/>
|
||||
<mount-point device='md1' directory='/usr/lib64' file-system='' format='no'/>
|
||||
</mount-points>
|
||||
<network domain='' secondary_dns='' ip='172.115.155.144' hostname='lizhi' mask='' primary_dns='' configuration='static' gateway=''/>
|
||||
<groups>
|
||||
<group name='development' install='yes'>
|
||||
<group name='development' install='no'>
|
||||
<description>
|
||||
开发类包括 C、C++(Fortran)、DDD 等开发工具。
|
||||
开发类软件包分为必选包和可选包,当选择安装该类后,必选包是默认安装的,可选包可以自由选择安装。
|
||||
@@ -101,7 +101,7 @@
|
||||
<package name='trac' install='yes'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group name='office' install='yes'>
|
||||
<group name='office' install='no'>
|
||||
<description>
|
||||
办公类包括 OpenOffice.org 等办公软件。
|
||||
办公类都是必选软件包,当选择安装该类后,必选包是默认安装的。
|
||||
@@ -110,7 +110,7 @@
|
||||
<package name='openoffice'/>
|
||||
</mandatory>
|
||||
</group>
|
||||
<group name='kde' install='yes'>
|
||||
<group name='kde' install='no'>
|
||||
<description>
|
||||
KDE是一种著名的自由图形工作环境,整个系统采用Qt程序库
|
||||
KDE桌面类都是可选软件包,可以自由选择安装。
|
||||
@@ -137,7 +137,7 @@
|
||||
<package name='kdewebdev' install='no'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group name='gui' install='yes'>
|
||||
<group name='gui' install='no'>
|
||||
<description>
|
||||
图形类包括 X11 相关的各种程序。
|
||||
图形类软件包分为必选包和可选包,当选择安装该类后,必选包是默认安装的,可选包可以自由选择安装。
|
||||
@@ -201,7 +201,7 @@
|
||||
<package name='xkeyboard-config'/>
|
||||
<package name='x11-fonts-chinese'/>
|
||||
</mandatory>
|
||||
<optional selection='manual'>
|
||||
<optional selection='all'>
|
||||
<package name='arts' install='no'/>
|
||||
<package name='atk' install='no'/>
|
||||
<package name='cairo' install='no'/>
|
||||
@@ -238,7 +238,7 @@
|
||||
<package name='xosview' install='no'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group name='network_tools' install='yes'>
|
||||
<group name='network_tools' install='no'>
|
||||
<description>
|
||||
网络工具类包括 tcpdump 等网络工具。
|
||||
网络工具类都是可选软件包,可以自由选择安装。
|
||||
@@ -249,7 +249,7 @@
|
||||
<package name='wireshark' install='no'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group name='vm' install='yes'>
|
||||
<group name='vm' install='no'>
|
||||
<description>
|
||||
通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统
|
||||
虚拟机类都是可选软件包,可以自由选择安装
|
||||
@@ -402,7 +402,7 @@
|
||||
网络服务类包括各种网络服务包。
|
||||
网络服务类都是可选软件包,可以自由选择安装。
|
||||
</description>
|
||||
<optional selection='all'>
|
||||
<optional selection='manual'>
|
||||
<package name='apache' install='no'/>
|
||||
<package name='apr' install='no'/>
|
||||
<package name='bind' install='no'/>
|
||||
@@ -418,7 +418,7 @@
|
||||
<package name='mod_php' install='no'/>
|
||||
<package name='nail' install='no'/>
|
||||
<package name='net-snmp' install='no'/>
|
||||
<package name='netkit-rsh' install='no'/>
|
||||
<package name='netkit-rsh' install='yes'/>
|
||||
<package name='netkit-telnet' install='no'/>
|
||||
<package name='nfs-utils' install='no'/>
|
||||
<package name='ntp' install='no'/>
|
||||
@@ -427,7 +427,7 @@
|
||||
<package name='postfix' install='no'/>
|
||||
<package name='ppp' install='no'/>
|
||||
<package name='procmail' install='no'/>
|
||||
<package name='proftpd' install='no'/>
|
||||
<package name='proftpd' install='yes'/>
|
||||
<package name='rdate' install='no'/>
|
||||
<package name='rsync' install='no'/>
|
||||
<package name='samba' install='no'/>
|
||||
@@ -436,7 +436,7 @@
|
||||
<package name='webfs' install='no'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group name='internet' install='yes'>
|
||||
<group name='internet' install='no'>
|
||||
<description>
|
||||
因特网类包括万维网浏览器 Firefox 等。
|
||||
因特网类软件包都是必选包,当选择安装该类后,必选包是默认安装的。
|
||||
@@ -451,7 +451,7 @@
|
||||
<package name='thunderbird' install='no'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group name='multi-media' install='yes'>
|
||||
<group name='multi-media' install='no'>
|
||||
<description>
|
||||
多媒体类包括各种媒体库。
|
||||
多媒体类都是可选软件包,可以自由选择安装。
|
||||
|
||||
@@ -714,7 +714,7 @@ row 4 | |
|
||||
<configure column='2' weight='1'/>
|
||||
</grid_management>
|
||||
<grid_location row='2' column='1' columnspan='2' sticky='NSWE'/>
|
||||
<action quit='service_quit'/>
|
||||
<action init='service_init' quit='service_quit'/>
|
||||
<!-- a template for service item -->
|
||||
<widget type='Checkbutton' name='service-item'>
|
||||
<widget_attribute text='' variable='' onvalue='yes' offvalue='no'/>
|
||||
|
||||
Reference in New Issue
Block a user