Author: aschnell
Date: Wed Feb 27 14:22:51 2008
New Revision: 45081
URL: http://svn.opensuse.org/viewcvs/yast?rev=45081&view=rev
Log:
- added general function to make info about disk/partition
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp Wed Feb 27 14:22:51 2008
@@ -72,6 +72,53 @@
}
+ // TODO: symbols here and resulting content should be identical to the once
+ // used in MakePartitionList
+ term MakeInfo(map data, list<symbol> rows)
+ {
+ string ret = "";
+
+ foreach(symbol row, rows, {
+ if (row == `newline)
+ ret = ret + "\n";
+ else if (row == `device)
+ ret = ret + "Kernel Name: " + data["device"]:"" + "\n";
+ else if (row == `vendor)
+ ret = ret + "Vendor: " + data["vendor"]:"" + "\n";
+ else if (row == `model)
+ ret = ret + "Model: " + data["model"]:"" + "\n";
+ else if (row == `bus)
+ ret = ret + "Bus: " + data["bus"]:"" + "\n";
+ else if (row == `udev_path)
+ ret = ret + "Path: " + data["udev_path"]:"" + "\n";
+ else if (row == `udev_id)
+ ret = ret + "ID: " + mergestring(data["udev_id"]:[], " ") + "\n";
+ else if (row == `mount_point)
+ ret = ret + "Mount Point: " + data["mount"]:"" + "\n";
+ else if (row == `size)
+ ret = ret + "Size: " + ByteToHumanStringWithZero(data["size_k"]:0*1024) + "\n";
+ else if (row == `stripes) {
+ integer stripes = data["stripes"]:1;
+ if (stripes == 1)
+ ret = ret + "Stripes: " + stripes + "\n";
+ else
+ ret = ret + "Stripes: " + stripes + " (4 KB)" + "\n"; // FIXME
+ } else if (row == `lvm_type)
+ ret = ret + "Metadata Type: " + (data["lvm2"]:true ? "LVM2" : "LVM1") + "\n";
+ else if (row == `raid_type)
+ ret = ret + "RAID Type: " + data["raid_type"]:"" + "\n";
+ else if (row == `pe_size)
+ ret = ret + "PE Size: " + ByteToHumanStringWithZero(data["pesize"]:0) + "\n";
+ else if (row == `fs_type)
+ ret = ret + "File System: " + FileSystems::GetName(data["used_fs"]:`unknown, "unknown") + "\n";
+ else if (row == `uuid)
+ ret = ret + "UUID: " + data["uuid"]:"" + "\n";
+ });
+
+ return `Left(`Label(ret));
+ }
+
+
map DlgResize(symbol flavour)
{
integer lv_used = 3500;
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp Wed Feb 27 14:22:51 2008
@@ -48,12 +48,7 @@
UI::ReplaceWidget(`tab_panel,
`VBox(
`HStretch(),
- `Left(`Label("Kernel Name: " + disk["device"]:"")),
- `Left(`Label("Vendor: " + disk["vendor"]:"")),
- `Left(`Label("Model: " + disk["model"]:"")),
- `Left(`Label("Size: " + ByteToHumanString(disk["size_k"]:0*1024))),
- `Left(`Label("Bus: " + disk["bus"]:"")),
- `Left(`Label("Path: " + disk["udev_path"]:"")),
+ MakeInfo(disk, [ `device, `vendor, `model, `size, `newline, `bus, `udev_path ]),
`VStretch(),
`HBox(
`PushButton(`id(`smart), "Smart..." ),
@@ -191,8 +186,7 @@
`VBox(
`HStretch(),
`Left(`Heading("Partition: " + device)),
- `Left(`Label("Mount Point: " + partition["mount"]:"")),
- `Left(`Label("Size: " + ByteToHumanString(partition["size_k"]:0*1024))),
+ MakeInfo(partition, [ `mount_point, `size, `fs_type, `uuid, `udev_path, `udev_id ]),
`VStretch(),
`HBox(
`PushButton(`id(`edit), "Edit..."),
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp Wed Feb 27 14:22:51 2008
@@ -58,8 +58,7 @@
UI::ReplaceWidget(`tab_panel,
`VBox(
`HStretch(),
- `Left(`Label("Size: " + ByteToHumanString(disk["size_k"]:0*1024))),
- `Left(`Label("Metadata Type: " + (disk["lvm2"]:true ? "LVM2" : "LVM1"))),
+ MakeInfo(disk, [ `size, `pe_size, `lvm_type ]),
`VStretch(),
`HBox(
`PushButton(`id(`delete), "Delete..."),
@@ -175,7 +174,7 @@
}
}
- list<symbol> columns = [ `device, `size, `format, `fs ];
+ list<symbol> columns = [ `device, `size, `format, `fs, `used_by ];
term header = GetTableHeaderNew(columns);
list table_list = MakePartitionList(tg, columns, predicate);
@@ -236,9 +235,7 @@
`VBox(
`HStretch(),
`Left(`Heading("Logical Volume: " + device)),
- `Left(`Label("Mount Point: " + partition["mount"]:"")),
- `Left(`Label("Size: " + ByteToHumanString(partition["size_k"]:0*1024))),
- `Left(`Label("Stripes: " + partition["stripes"]:1)),
+ MakeInfo(partition, [ `mount_point, `mount_by, `size, `stripes, `fs_type, `uuid ]),
`VStretch(),
`HBox(
`PushButton(`id(`edit), "Edit..."),
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp?rev=45081&r1=45080&r2=45081&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp Wed Feb 27 14:22:51 2008
@@ -44,9 +44,7 @@
UI::ReplaceWidget(`tab_panel,
`VBox(
`HStretch(),
- `Left(`Label("Size: " + ByteToHumanString(partition["size_k"]:0*1024))),
- `Left(`Label("RAID Type: " + partition["raid_type"]:"")),
- `Left(`Label("Mount Point: " + partition["mount"]:"")),
+ MakeInfo(partition, [ `mount_point, `size, `raid_type ]),
`VStretch(),
`HBox(
`PushButton(`id(`edit), "Edit..."),
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org