bug# 1241 ,check partition, modify fstab
add a yesorno dialog when check partition: if yes,continue; if no,exit modified: dialog/di_dialog.py modified: interface/ri_data.py modified: interface/ri_tk_cmd.py modified: xml/interface.xml
This commit is contained in:
@@ -234,18 +234,16 @@ class MountPoint(Dialog):
|
||||
return n
|
||||
|
||||
def set_data(self):
|
||||
ret = ri_data.Partition.check_partitions()
|
||||
if ret != 0:
|
||||
Dialog.message("Sorry, your hard disk has no partitions, \
|
||||
\nplease partition you hard disk first!")
|
||||
sys.exit(1)
|
||||
|
||||
ri_data.MountPoint.init_from_internal()
|
||||
while True:
|
||||
list=[]
|
||||
keys=ri_data.MountPoint.dict.keys()
|
||||
keys.sort()
|
||||
|
||||
if len(list) == 0:
|
||||
Dialog.message("Sorry, your hard disk has no partitions,Please partition your disk first!!")
|
||||
sys.exit(1)
|
||||
|
||||
for d in keys:
|
||||
list.append((ri_data.MountPoint.dict[d].device,
|
||||
ri_data.MountPoint.dict[d].directory.ljust(10)+
|
||||
|
||||
@@ -54,7 +54,7 @@ class Partition:
|
||||
|
||||
@staticmethod
|
||||
def check_partitions():
|
||||
cmd = "grep d[a-z][0-9] /proc/partitions>/dev/null"
|
||||
cmd = "grep [a-zA-Z][0-9] /proc/partitions>/dev/null"
|
||||
ret = os.system(cmd)
|
||||
return ret
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
''' handle gui commands '''
|
||||
import ri_tk as display
|
||||
import tkMessageBox
|
||||
import ri_widget
|
||||
import ri_data
|
||||
import ri_dep
|
||||
import ri_func_dep
|
||||
import ri_oper
|
||||
from ri_oper import language
|
||||
import re
|
||||
import copy
|
||||
import sys
|
||||
@@ -35,10 +32,7 @@ def mount_list_init():
|
||||
display.var_dict['mount.list'].set(value=tuple([str(i) for i in l]))
|
||||
''' if disk has no partition, do this '''
|
||||
ret = ri_data.Partition.check_partitions()
|
||||
if ret != 0:
|
||||
tkMessageBox.showerror(title='Linx', message="%s"%( language == 'chinese' and u"对不起,\
|
||||
您的硬盘还没有分区,请先对硬盘分区后再进行安装操作!" or \
|
||||
"Sorry, You have not patition your hard disk, please partition at first!"))
|
||||
if ret != 0 and not ri_widget.MessageBox.dict["check_partitions"].show():
|
||||
sys.exit(1)
|
||||
|
||||
def mount_quit():
|
||||
|
||||
@@ -796,6 +796,7 @@ row 4 | |
|
||||
<message_box name='raid_delete_warning' type='showwarning' title='Linx' message='#raid-delete-warning'/>
|
||||
<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_partitions' type='askokcancel' title='Linx' message='#check-partitions'/>
|
||||
<message_box name='check_mount_point' type='showwarning' title='Linx' message='#check-mount-point'/>
|
||||
<message_box name='check_special_mount' type='showwarning' title='Linx' message='#check-special-mount'/>
|
||||
<message_box name='check_ip_hostname' type='showwarning' title='Linx' message='#check-ip-hostname'/>
|
||||
@@ -889,6 +890,10 @@ row 4 | |
|
||||
|
||||
</top_window>
|
||||
|
||||
<text key='#check-partitions'>
|
||||
<English>Sorry, Your hard disk have no partition, \nYou may not perform the following operations!\nContinue or not?</English>
|
||||
<Chinese>对不起,您的硬盘还没有分区,可能无法进行下面的操作!继续(Y)/返回(N)?</Chinese>
|
||||
</text>
|
||||
|
||||
<text key='#check-special-mount'>
|
||||
<English>Special platform to set a special mount point, please refer to the left of the help documentation</English>
|
||||
|
||||
Reference in New Issue
Block a user