modified: ri_cmd.py
modified: ri_oper.py
modified: ri_tk.py
modified: ri_tk_cmd.py
modified: ri_widget.py
add network check ip and hostname update
This commit is contained in:
@@ -30,7 +30,7 @@ def next():
|
||||
q, t = ri_widget.Sequence.current()
|
||||
wid_name = ri_widget.Sequence.next()
|
||||
if wid_name is not None:
|
||||
ri_widget.Widget.dict[t].hide(t)
|
||||
ri_widget.Widget.dict[t].hide()
|
||||
|
||||
ri_widget.Widget.dict[wid_name].show()
|
||||
else:
|
||||
|
||||
@@ -331,7 +331,7 @@ class ConfigureBootloader(Operation):
|
||||
list = string.split('-')
|
||||
fd.close()
|
||||
|
||||
bootloader=['-t',tp,'-o',list[0][5:].split('.')[0]+'.'+list[0][5:].split('.')[1],'-k','vga=791 linx_serial=%s' %ri_data.SerialNumber.value.strip()]
|
||||
bootloader=['-t',tp,'-o',list[0][5:].split('.')[0]+'.'+list[0][5:].split('.')[1],'-k','"linx_serial=%s vga=791 quiet"' %ri_data.SerialNumber.value.strip()]
|
||||
|
||||
for k in Mount.dict.keys():
|
||||
if '/' == Mount.dict[k]:
|
||||
|
||||
@@ -154,21 +154,18 @@ def create_widget_sub(w, p_win):
|
||||
# while destroying a widget, only destroy one. Tk functions will
|
||||
# destroy all descendant.
|
||||
# so init is a little different from quit.
|
||||
def process_action_quit(w,step=''):
|
||||
def process_action_quit(w):
|
||||
''' process action quit '''
|
||||
if 'action' in dir(w) and 'quit' in w.action.dict:
|
||||
if step == 'network':
|
||||
getattr(sys.modules['ri_cmd'], w.action.dict['quit'])(step)
|
||||
else:
|
||||
getattr(sys.modules['ri_cmd'], w.action.dict['quit'])()
|
||||
getattr(sys.modules['ri_cmd'], w.action.dict['quit'])()
|
||||
|
||||
if 'widgets' in dir(w):
|
||||
for sub_w in w.widgets:
|
||||
process_action_quit(sub_w)
|
||||
|
||||
def destroy_widget(w,step=''):
|
||||
def destroy_widget(w):
|
||||
''' w - Widget instance '''
|
||||
process_action_quit(w,step)
|
||||
process_action_quit(w)
|
||||
w.tk_widget.destroy()
|
||||
|
||||
def create_message_box(w):
|
||||
|
||||
@@ -116,7 +116,7 @@ def network_init():
|
||||
display.var_dict['network_primary_dns']. set(value=ri_data.Network.primary_dns)
|
||||
display.var_dict['network_secondary_dns'].set(value=ri_data.Network.secondary_dns)
|
||||
|
||||
def network_quit(step=''):
|
||||
def network_quit():
|
||||
''' network quit '''
|
||||
ri_data.Network.hostname = display.var_dict['network_host_name'].get()
|
||||
ri_data.Network.configuration = display.var_dict['network_config_method'].get()
|
||||
@@ -127,15 +127,14 @@ def network_quit(step=''):
|
||||
ri_data.Network.primary_dns = display.var_dict['network_primary_dns'].get()
|
||||
ri_data.Network.secondary_dns = display.var_dict['network_secondary_dns'].get()
|
||||
|
||||
if step == "network":
|
||||
if not ri_data.Network.hostname:
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
if ri_data.Network.configuration == "static" and \
|
||||
not ri_data.Network.ip and \
|
||||
not ri_data.Network.mask and \
|
||||
not ri_data.Network.gateway and \
|
||||
not ri_data.Network.primary_dns :
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
if not ri_data.Network.hostname:
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
elif ri_data.Network.configuration == "static" and \
|
||||
(not ri_data.Network.ip or \
|
||||
not ri_data.Network.mask or \
|
||||
not ri_data.Network.gateway or \
|
||||
not ri_data.Network.primary_dns) :
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
|
||||
def ncm_dynamic():
|
||||
''' when radio button ncm dynamic is checked, several data entry will be set 'disable' '''
|
||||
|
||||
@@ -89,8 +89,8 @@ class Widget:
|
||||
Widget.current_widget = self
|
||||
display.create_widget(self)
|
||||
|
||||
def hide(self,step=''):
|
||||
display.destroy_widget(self,step)
|
||||
def hide(self):
|
||||
display.destroy_widget(self)
|
||||
|
||||
class MessageBox:
|
||||
''' implement dialog in interface.xml '''
|
||||
|
||||
Reference in New Issue
Block a user