modified: ri_data.py

modified:   ri_tk_cmd.py
	modified:   ../xml/interface.xml
    updata  add message box for specal mount point
This commit is contained in:
fling
2010-11-10 17:15:51 +08:00
parent ad712491c3
commit 6de793eeb9
3 changed files with 28 additions and 31 deletions

View File

@@ -62,11 +62,11 @@ def mp_top_init():
if fs == fs_values[i]:
ri_widget.Widget.dict['mp_top_fs'].tk_widget.selection_set(i)
def mp_top_ok():
''' mount dir top window OK '''
l = []
isdir_in_mp = False
isspecial_dir = False
isdir_feasible = True
for itm in eval(display.var_dict['mount.list'].get()):
dev = itm.split()[0]
dev2 = display.var_dict['mp_top_dev'].get()
@@ -85,37 +85,25 @@ def mp_top_ok():
else:
fs = ' '
# check mount point is existent or not
if dr and dr in [ m.directory for m in ri_data.MountPoint.dict.values() if m.device != dev ]:
isdir_in_mp = True
dr = ri_data.MountPoint.dict[dev].directory
# check mount point is special or not
if dr in ['/etc','/bin','/sbin','/lib']:
isspecial_dir = True
dr = ri_data.MountPoint.dict[dev].directory
elif dr in ['/','/boot'] and fs in ['reiserfs','xfs']:
isspecial_dir = True
dr = ri_data.MountPoint.dict[dev].directory
s2 = dev.ljust(10) + dr.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6) + ri_data.Partition.unit
l.append(s2)
# make change in internal data structure
ri_data.MountPoint.change(dev, dr, fs, fm)
# check mount point is feasible
if ri_data.MountPoint.is_check_data(dev,dr,fs):
s2 = dev.ljust(10) + dr.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6) + ri_data.Partition.unit
ri_data.MountPoint.change(dev, dr, fs, fm)
l.append(s2)
else:
isdir_feasible=False
l.append(itm)
else:
l.append(itm)
display.var_dict['mount.list'].set(value=tuple(l))
ri_widget.TopWindow.dict['mount_list_modify'].hide()
if isdir_in_mp:
if not isdir_feasible:
ri_widget.MessageBox.dict['check_mount_point'].show()
if isspecial_dir:
ri_widget.MessageBox.dict['check_special_mount_point'].show()
def mp_top_cancel():
''' mount dir top window cancel '''
ri_widget.TopWindow.dict['mount_list_modify'].hide()
pass
def network_init():
''' network initialize '''