Fix bug 1987:

添加安装完成后的动作(重启/关机/待机)

    修改:      interface/ri_data.py
	修改:      interface/ri_inst_cli.py
	修改:      interface/ri_install.py
	修改:      main/setup
	修改:      text/ri_main.py
	修改:      text/ri_newt.py

Signed-off-by: sysadmin <zhihuipeng@linx-info.com>
This commit is contained in:
sysadmin
2014-08-19 10:23:13 +08:00
parent 3594ab8f9c
commit 918bf64ea5
6 changed files with 95 additions and 16 deletions

View File

@@ -51,6 +51,8 @@ while True :
ri_newt.Group()
elif list[count] == 'service':
ri_newt.Service()
elif list[count] == 'finishstate':
ri_newt.FinishState()
elif list[count] == 'information':
ri_newt.Prepar_installation()
s = ri_newt.Screen.dict[list[count]].set_data()

View File

@@ -781,10 +781,43 @@ class Service(Screen):
service.start = 'yes'
else:
service.start = 'no'
ri_data.to_xml()
#ri_data.to_xml()
return s
class FinishState(Screen):
def __init__(self):
Screen.__init__(self, name='finishstate')
self.text = 'After finishing installed Rocky OS system, do you want to reboot, shutdown or just do nothing ?'
Screen.widget_textboxreflowed(50, self.text)
Screen.widget_buttonbar(Screen.buttonlist1)
reboot_value = 0
shutdown_value = 0
nothing_value = 0
default_value = getattr(ri_data.FinishState, 'flag')
if default_value == 'reboot':
reboot_value = 1
elif default_value == 'shutdown':
shutdown_value = 1
else:
nothing_value = 1
self.rb = RadioBar(Screen,(('Reboot', 'reboot', reboot_value), ('Shutdown', \
'shutdown', shutdown_value), ('Nothing', 'nothing', nothing_value)))
Screen.container_grid(1,1,self.rb)
def set_data(self):
#Screen.widget_entry(20, text=getattr(ri_data.FinishState,'flag'))
s = Screen.yesno('finishstate', 1, 5, 'TextboxReflowed', 'eLable', 'Grid', 'eLabel', 'ButtonBar')
if s == 0:
ri_data.FinishState.flag = self.rb.getSelection()
ri_data.to_xml()
return s
class Prepar_installation(Screen):
def __init__(self):
Screen.__init__(self, name='information')