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:
@@ -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()
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user