summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iw/partition_gui.py18
-rw-r--r--partitioning.py12
-rw-r--r--textw/partition_text.py24
3 files changed, 43 insertions, 11 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 840530365..e0c85e713 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -733,15 +733,18 @@ class PartitionWindow(InstallWindow):
row = row + 1
# Partition Type
- maintable.attach(createAlignedLabel(_("Original Filesystem Type:")),
- 0, 1, row, row + 1)
-
if origrequest.type == REQUEST_NEW:
+ maintable.attach(createAlignedLabel(_("Filesystem Type:")),
+ 0, 1, row, row + 1)
+
(newfstype, newfstypeMenu) = createFSTypeMenu(origrequest.fstype,
fstypechangeCB,
mountCombo)
maintable.attach(newfstype, 1, 2, row, row + 1)
else:
+ maintable.attach(createAlignedLabel(_("Original Filesystem Type:")),
+ 0, 1, row, row + 1)
+
if origrequest.origfstype:
typestr = origrequest.origfstype.getName()
else:
@@ -772,6 +775,15 @@ class PartitionWindow(InstallWindow):
row = row + 1
+ # original fs label
+ if origrequest.type != REQUEST_NEW and origrequest.fslabel:
+ maintable.attach(createAlignedLabel(_("Original Filesystem Label:")),
+ 0, 1, row, row + 1)
+ fslabel = GtkLabel(origrequest.fslabel)
+ maintable.attach(fslabel, 1, 2, row, row + 1)
+
+ row = row + 1
+
# size
if origrequest.type == REQUEST_NEW:
if not newbycyl:
diff --git a/partitioning.py b/partitioning.py
index deeca0d19..a0e4331d8 100644
--- a/partitioning.py
+++ b/partitioning.py
@@ -513,7 +513,7 @@ class PartitionSpec:
format = None, options = None,
constraint = None, migrate = None,
raidmembers = None, raidlevel = None,
- raidspares = None, badblocks = None):
+ raidspares = None, badblocks = None, fslabel = None):
#
# requesttype: REQUEST_PREEXIST or REQUEST_NEW or REQUEST_RAID
#
@@ -549,6 +549,9 @@ class PartitionSpec:
self.raidmembers = raidmembers
self.raidlevel = raidlevel
self.raidspares = raidspares
+
+ # fs label (if pre-existing, otherwise None)
+ self.fslabel = fslabel
# device is what we currently think the device is
# realDevice is used by partitions which are pre-existing
@@ -661,6 +664,7 @@ class Partitions:
self.deletes = []
self.requests = []
diskset.refreshDevices()
+ labels = diskset.getLabels()
drives = diskset.disks.keys()
drives.sort()
for drive in drives:
@@ -697,6 +701,12 @@ class Partitions:
drive = drive, format = format)
spec.device = fsset.PartedPartitionDevice(part).getDevice()
+ # set label if makes sense
+ if ptype and ptype.isMountable() and ptype.getName != "foreign":
+ if spec.device in labels.keys():
+ if labels[spec.device] and len(labels[spec.device])>0:
+ spec.fslabel = labels[spec.device]
+
self.addRequest(spec)
part = disk.next_partition(part)
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 0925560ef..efe93de09 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -185,7 +185,7 @@ class PartitionWindow:
def makeMountEntry(self, request):
mountgrid = Grid(2, 1)
mountLbl = Label(_("Mount Point:"))
- mountgrid.setField(mountLbl, 0, 0, (0,0,6,0), anchorLeft = 1)
+ mountgrid.setField(mountLbl, 0, 0, (0,0,0,0), anchorLeft = 1)
mountpoint = request.mountpoint
if mountpoint:
mount = Entry(20, mountpoint)
@@ -565,18 +565,28 @@ class PartitionWindow:
else:
subgrid = Grid(2, 4)
# filesystem type selection
+ srow = 0
typeLbl = Label(_("Filesystem Type:"))
- subgrid.setField(typeLbl, 0, 0, (0,0,2,0), anchorLeft = 1)
+ subgrid.setField(typeLbl, 0, srow, (0,0,0,1), anchorLeft = 1)
type = Label(origrequest.fstype.getName())
- subgrid.setField(type, 1, 0, anchorRight = 1)
+ subgrid.setField(type, 1, srow, (0,0,0,1), anchorRight = 1)
+ srow = srow +1
+ if origrequest.type != REQUEST_NEW and origrequest.fslabel:
+ fsLbl = Label(_("Filesystem Label:"))
+ subgrid.setField(fsLbl, 0, srow, (0,0,0,1), anchorLeft = 1)
+ label = Label(origrequest.fslabel)
+ subgrid.setField(label, 1, srow, (0,0,0,1), anchorRight = 1)
+ srow = srow + 1
+
sizeLbl = Label(_("Size (MB):"))
- subgrid.setField(sizeLbl, 0, 1, (0,1,2,0), anchorLeft = 1)
+ subgrid.setField(sizeLbl, 0, srow, (0,0,0,1), anchorLeft = 1)
size = Label("%s" %(int(origrequest.size)))
- subgrid.setField(size, 1, 1, (0,1,0,0), anchorRight = 1)
+ subgrid.setField(size, 1, srow, (0,0,0,1), anchorRight = 1)
+ srow = srow + 1
tmpLbl = Label(_("Filesystem Option:"))
- subgrid.setField(tmpLbl, 0, 2, (0,1,2,0), anchorLeft = 1)
+ subgrid.setField(tmpLbl, 0, srow, (0,0,0,1), anchorLeft = 1)
fsoptLbl = Label("")
- subgrid.setField(fsoptLbl, 1, 2, (0,1,2,0), anchorLeft = 1)
+ subgrid.setField(fsoptLbl, 1, srow, (0,0,0,1), anchorLeft = 1)
poplevel.add(subgrid, 0, row, (0,1,0,0))