modified: ri_install.py
modified: ri_tk_cmd.py
modified: ../xml/interface.xml
add check mount point in ri_tk_cmd
This commit is contained in:
@@ -21,6 +21,7 @@ import getopt
|
||||
import ri_oper
|
||||
import os
|
||||
import os.path
|
||||
import ri_data
|
||||
def install_over(ret):
|
||||
if ri_oper.Rate.value == 100 and ret == 0:
|
||||
if display.set_task_over():
|
||||
|
||||
@@ -61,9 +61,18 @@ def mp_top_init():
|
||||
if fs == fs_values[i]:
|
||||
ri_widget.Widget.dict['mp_top_fs'].tk_widget.selection_set(i)
|
||||
|
||||
def mp_top_check(dev,dir):
|
||||
'''check mount point'''
|
||||
if dir:
|
||||
for d in ri_data.MountPoint.dict.values():
|
||||
if d.device == dev :continue
|
||||
if d.directory == dir : return True
|
||||
return False
|
||||
|
||||
def mp_top_ok():
|
||||
''' mount dir top window OK '''
|
||||
l = []
|
||||
the_same = False
|
||||
for itm in eval(display.var_dict['mount.list'].get()):
|
||||
dev = itm.split()[0]
|
||||
dev2 = display.var_dict['mp_top_dev'].get()
|
||||
@@ -81,6 +90,9 @@ def mp_top_ok():
|
||||
fs = ri_data.Partition.dict[dev].filesystem
|
||||
else:
|
||||
fs = ' '
|
||||
if mp_top_check(dev,dr):
|
||||
the_same = 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
|
||||
@@ -90,6 +102,8 @@ def mp_top_ok():
|
||||
|
||||
display.var_dict['mount.list'].set(value=tuple(l))
|
||||
ri_widget.TopWindow.dict['mount_list_modify'].hide()
|
||||
if the_same:
|
||||
ri_widget.MessageBox.dict['check_mount_point'].show()
|
||||
|
||||
def mp_top_cancel():
|
||||
''' mount dir top window cancel '''
|
||||
|
||||
@@ -728,6 +728,7 @@ row 4 | |
|
||||
<message_box name='raid_delete_warning' type='showwarning' title='raid deleting' message='#raid-delete-warning'/>
|
||||
<message_box name='raid_add_active_numbers' type='showwarning' title='number' message='#raid-add-active-numbers'/>
|
||||
<message_box name='raid_add_active_numbers_2' type='showwarning' title='number' message='#raid-add-active-numbers-2'/>
|
||||
<message_box name='check_mount_point' type='showwarning' title='checking' message='#check-mount-point'/>
|
||||
<!--
|
||||
column 0 column 1
|
||||
________________________________________________
|
||||
@@ -856,6 +857,11 @@ row 4 | |
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<text key='#check-mount-point'>
|
||||
<English>The mount point has been used</English>
|
||||
<Chinese>挂载点已经被使用</Chinese>
|
||||
</text>
|
||||
|
||||
<text key='#dependency.help'>
|
||||
<English>
|
||||
There are two kinds of dependent relationships. Dependent Functions and Dependent Packages.
|
||||
|
||||
Reference in New Issue
Block a user