[yast-commit] r45142 - in /branches/tmp/aschnell/part-redesign/storage/src: include/ep-dialogs.ycp include/ep-hd.ycp include/ep-lvm.ycp include/ep-raid.ycp inst_custom_part.ycp

Author: aschnell Date: Fri Feb 29 16:17:53 2008 New Revision: 45142 URL: http://svn.opensuse.org/viewcvs/yast?rev=45142&view=rev Log: - work on overviews 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 branches/tmp/aschnell/part-redesign/storage/src/inst_custom_part.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/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp Fri Feb 29 16:17:53 2008 @@ -72,60 +72,188 @@ } - // TODO: symbols here and resulting content should be identical to the once - // used in MakePartitionList - // - // TODO: we could use RichText formatting capabilities (but table is only - // supported by qt) - term MakeInfo(map data, list<symbol> rows) + // TODO: somehow use in MakePartitionList + string MakeSubInfo(map disk, map part, symbol what) { - string ret = ""; + map data = (part == nil ? disk : part); - 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) { - if (false) { - ret = ret + "ID: " + mergestring(data["udev_id"]:[], " ") + "\n"; + switch (what) + { + case `size: + { + return "Size: " + ByteToHumanStringWithZero(data["size_k"]:0*1024) + "\n"; + } + + case `type: + { + string value = ""; + // TODO: see ep-main.ycp + return value; + } + + case `format: + { + string value = ""; + if (part == nil) { + if (disk["dasdfmt"]:false) + value = value + "X"; } else { - integer i = 1; - foreach(string id, data["udev_id"]:[], { - ret = ret + "ID " + i + ": " + id + "\n"; - i = i + 1; - }); + if (part["enc_type"]:`none != `none) + value = value + "C"; + if (part["format"]:false) + value = value + "F"; + } + return "Format: " + value + "\n"; + } + + case `encrypted: + { + string value = data["enc_type"]:`none != `none ? "Yes" : "No"; + return "Encrypted: " + value; + } + + case `fs_type: + { + return "File System: " + FileSystems::GetName(data["used_fs"]:`unknown, "") + "\n"; + } + + case `mount_point: + { + string value = data["mount"]:""; + if (Mode::normal() && data["inactive"]:false ) + value = value + " *"; + return "Mount Point: " + value + "\n"; + } + + case `mount_by: + { + string value = ""; + if (data["mount"]:"" != "") { + map tmp = $[ `device : "K", `uuid : "U", `label : "L", `id : "I", `path : "P" ]; + symbol mount_by = data["mountby"]:`device; + value = tmp[mount_by]:""; } - } 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) { + return "Mount By: " + value + "\n"; + } + + case `used_by: + { + return "Used By: " + usedByString(data["used_by_type"]:`UB_NONE, data["used_by"]:"") + "\n"; + } + + case `device: + { + return "Kernel Name: " + data["device"]:"" + "\n"; + } + + case `uuid: + { + return "UUID: " + data["uuid"]:"" + "\n"; + } + + case `label: + { + return "Label: " + data["label"]:"" + "\n"; + } + + case `udev_path: + { + return "Path: " + data["udev_path"]:"" + "\n"; + } + + case `udev_id: + { + string ret = ""; + integer i = 1; + foreach(string id, data["udev_id"]:[], { + ret = ret + "ID " + i + ": " + id + "\n"; + i = i + 1; + }); + return ret; + } + + case `bios_id: + { + return "BIOS ID: " + data["bios_id"]:"" + "\n"; + } + + case `vendor: + { + return "Vendor: " + data["vendor"]:"" + "\n"; + } + + case `model: + { + return "Model: " + data["model"]:"" + "\n"; + } + + case `bus: + { + return "Bus: " + data["bus"]:"" + "\n"; + } + + case `lvm_type: + { + return "Metadata Type: " + (data["lvm2"]:true ? "LVM2" : "LVM1") + "\n"; + } + + case `pe_size: + { + return "Physical Extend Size: " + ByteToHumanStringWithZero(data["pesize"]:0) + "\n"; + } + + case `stripes: + { integer stripes = data["stripes"]:1; if (stripes == 1) - ret = ret + "Stripes: " + stripes + "\n"; + return "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"; - else if (row == `label) - ret = ret + "Label: " + data["label"]:"" + "\n"; + return "Stripes: " + stripes + " (4 KB)" + "\n"; // FIXME + } + + case `raid_type: + { + return "RAID Type: " + data["raid_type"]:"" + "\n"; + } + + case `cyl_start: + { + string value = "--"; + if (Storage::IsPartitionable(disk)) { + if (part == nil) + value = sformat("%1", 0); + else + value = sformat("%1", part["region", 0]:0); + } + return "Start Cyl: " + value + "\n"; + } + + case `cyl_end: + { + string value = "--"; + if (Storage::IsPartitionable(disk)) { + if (part == nil) + value = sformat("%1", disk["cyl_count"]:0 - 1); + else + value = sformat("%1", part["region", 0]:0 + part["region", 1]:0 - 1); + } + return "End Cyl: " + value + "\n"; + } + } + + return nil; + } + + + term MakeInfo(map disk, map part, list<symbol> rows) + { + string ret = ""; + + foreach(symbol row, rows, { + if (row == `newline) + ret = ret + "\n"; + else + ret = ret + MakeSubInfo(disk, part, row); }); return `Left(`RichText(`opt(`plainText), ret)); Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp Fri Feb 29 16:17:53 2008 @@ -48,7 +48,8 @@ UI::ReplaceWidget(`tab_panel, `VBox( `HStretch(), - MakeInfo(disk, [ `device, `vendor, `model, `size, `newline, `bus, `udev_path, `udev_id ]), + MakeInfo(disk, nil, [ `device, `vendor, `model, `size, `newline, + `bus, `udev_path, `udev_id, `cyl_start, `cyl_end ]), `VStretch(), `HBox( `PushButton(`id(`smart), "Smart..." ), @@ -180,13 +181,16 @@ { string device = (string) user_data; map<string, map> tg = Storage::GetTargetMap(); + map disk = Storage::GetDisk(tg, device); map partition = Storage::GetPartition(tg, device); UI::ReplaceWidget(`tree_panel, `VBox( `HStretch(), `Left(`Heading("Partition: " + device)), - MakeInfo(partition, [ `mount_point, `size, `fs_type, `uuid, `udev_path, `udev_id ]), + MakeInfo(disk, partition, [ `device, `mount_point, `mount_by, `size, `fs_type, `newline, + `uuid, `label, `udev_path, `udev_id, `used_by, `cyl_start, `cyl_end, + `encrypted ]), `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/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp Fri Feb 29 16:17:53 2008 @@ -58,7 +58,7 @@ UI::ReplaceWidget(`tab_panel, `VBox( `HStretch(), - MakeInfo(disk, [ `size, `pe_size, `lvm_type ]), + MakeInfo(disk, nil, [ `size, `pe_size, `lvm_type ]), `VStretch(), `HBox( `PushButton(`id(`delete), "Delete..."), @@ -229,13 +229,15 @@ { string device = (string) user_data; map<string, map> tg = Storage::GetTargetMap(); + map disk = Storage::GetDisk(tg, device); map partition = Storage::GetPartition(tg, device); UI::ReplaceWidget(`tree_panel, `VBox( `HStretch(), `Left(`Heading("Logical Volume: " + device)), - MakeInfo(partition, [ `mount_point, `mount_by, `size, `stripes, `fs_type, `uuid ]), + MakeInfo(disk, partition, [ `mount_point, `mount_by, `size, `stripes, `fs_type, + `uuid, `label ]), `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/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp Fri Feb 29 16:17:53 2008 @@ -39,12 +39,13 @@ string part_device = (string) user_data; map<string, map> tg = Storage::GetTargetMap(); + map disk = Storage::GetDisk(tg, part_device); map partition = Storage::GetPartition(tg, part_device); UI::ReplaceWidget(`tab_panel, `VBox( `HStretch(), - MakeInfo(partition, [ `mount_point, `size, `raid_type ]), + MakeInfo(disk, partition, [ `mount_point, `size, `raid_type ]), `VStretch(), `HBox( `PushButton(`id(`edit), "Edit..."), Modified: branches/tmp/aschnell/part-redesign/storage/src/inst_custom_part.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/inst_custom_part.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/inst_custom_part.ycp Fri Feb 29 16:17:53 2008 @@ -884,9 +884,11 @@ ret = "DM " + used_by; else if( ub_type == `UB_DMRAID ) ret = "RAID " + used_by; - else if( ub_type != `UN_NONE ) + else if( ub_type == `UB_MD ) + ret = "RAID " + used_by; + else if( ub_type != `UB_NONE ) ret = used_by; - return( ret ); + return ret; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org