modified: ri_cmd.py
modified: ri_data.py
modified: ../xml/interface.xml
add check network hostname ip netmask DNS.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
import ri_widget
|
||||
import os
|
||||
import ri_tk
|
||||
from ri_data import Network
|
||||
from ri_tk_cmd import network_quit as network_update
|
||||
|
||||
def quit():
|
||||
''' correspond to quit button '''
|
||||
@@ -28,6 +30,10 @@ def previous():
|
||||
def next():
|
||||
''' correspond to next button '''
|
||||
q, t = ri_widget.Sequence.current()
|
||||
|
||||
if not check_date(t):
|
||||
return
|
||||
|
||||
wid_name = ri_widget.Sequence.next()
|
||||
if wid_name is not None:
|
||||
ri_widget.Widget.dict[t].hide()
|
||||
@@ -37,6 +43,17 @@ def next():
|
||||
code = ri_widget.MessageBox.dict["next"].show()
|
||||
if code == True:
|
||||
os.execl('/usr/bin/python','python','ri_install.py', "-d","tk","-l",ri_tk.language)
|
||||
from ri_tk_cmd import *
|
||||
|
||||
|
||||
def check_date(operate):
|
||||
'''check date '''
|
||||
if operate == "network" :
|
||||
network_update()
|
||||
if not Network.hostname:
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
return False
|
||||
if Network.configuration == "static" and not Network.check_ip() :
|
||||
ri_widget.MessageBox.dict['check_ip_hostname'].show()
|
||||
return False
|
||||
return True
|
||||
|
||||
from ri_tk_cmd import *
|
||||
|
||||
@@ -450,6 +450,13 @@ p_node - xml node (parent node)'''
|
||||
to_xml_attr(doc, ntwk, Network, nm)
|
||||
p_node.appendChild(ntwk)
|
||||
|
||||
@staticmethod
|
||||
def check_ip() :
|
||||
"""check network ip"""
|
||||
if Network.ip and Network.mask and Network.gateway and Network.primary_dns:
|
||||
return True
|
||||
return False
|
||||
|
||||
class Group:
|
||||
''' software package group '''
|
||||
dict = {}
|
||||
|
||||
@@ -796,6 +796,7 @@ row 4 | |
|
||||
<message_box name='raid_add_active_numbers' type='showwarning' title='Linx' message='#raid-add-active-numbers'/>
|
||||
<message_box name='raid_add_active_numbers_2' type='showwarning' title='Linx' message='#raid-add-active-numbers-2'/>
|
||||
<message_box name='check_mount_point' type='showwarning' title='Linx' message='#check-mount-point'/>
|
||||
<message_box name='check_ip_hostname' type='showwarning' title='Linx' message='#check-ip-hostname'/>
|
||||
<!--
|
||||
column 0 column 1
|
||||
________________________________________________
|
||||
@@ -891,6 +892,11 @@ row 4 | |
|
||||
<Chinese>挂载点已经被使用或者这个是一个特殊的挂载点, 不能这样挂载, 请看帮助文档</Chinese>
|
||||
</text>
|
||||
|
||||
<text key='#check-ip-hostname'>
|
||||
<English>Hostname must be configured. If you choose a static way to set an IP address,the ip address, netmask, gateway, DNS server must be configured.</English>
|
||||
<Chinese>主机名不能为空.如果是静态IP方式,ip地址,子网掩码,网关,DNS地址都不能为空,请按正确方式填写,详细内容请看帮助文档.</Chinese>
|
||||
</text>
|
||||
|
||||
<text key='#Copyright'>
|
||||
<English>Copyright 2001-2010 Linx Technology Co., Ltd.</English>
|
||||
<Chinese>北京凝思科技有限公司 版权所有</Chinese>
|
||||
|
||||
Reference in New Issue
Block a user