Author: aschnell Date: Tue May 5 15:50:21 2009 New Revision: 57071 URL: http://svn.opensuse.org/viewcvs/yast?rev=57071&view=rev Log: - don't show partitions bargraph for disks used by something, e.g. bios raid and multipath Modified: trunk/storage/storage/src/include/ep-hd.ycp Modified: trunk/storage/storage/src/include/ep-hd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd.ycp?rev=57071&r1=57070&r2=57071&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-hd.ycp (original) +++ trunk/storage/storage/src/include/ep-hd.ycp Tue May 5 15:50:21 2009 @@ -265,27 +265,38 @@ ); } - map ddata = Storage::GetDisk(target_map, device); - list <integer> bits = []; - list <string> labels = []; + term partitions_bargraph = `Empty(); - foreach (map part, ddata["partitions"]:[], { - if ( part["type"]:`primary != `extended) + if (UI::HasSpecialWidget(`BarGraph)) + { + map ddata = Storage::GetDisk(target_map, device); + + if (ddata["used_by"]:`UB_NONE == `UB_NONE) { - list <integer> region = part["region"]:[]; - integer tmp = 100*Region::Length( region )/ddata["cyl_count"]:1; //in % - string descr = part["device"]:"" + "\n" + Storage::KByteToHumanStringOmitZeroes(part["size_k"]:0); - - // Guarantee some minimal share (1%) of total graph width to a segment - // It prevents small partitions e.g. swaps from disappearing completely - bits = add( bits, (tmp < 1) ? 1 : tmp ); - labels = add( labels, descr); + list <integer> bits = []; + list <string> labels = []; + + foreach (map part, ddata["partitions"]:[], { + if (part["type"]:`primary != `extended) + { + list <integer> region = part["region"]:[]; + integer tmp = 100*Region::Length( region )/ddata["cyl_count"]:1; //in % + string descr = part["device"]:"" + "\n" + Storage::KByteToHumanStringOmitZeroes(part["size_k"]:0); + + // Guarantee some minimal share (1%) of total graph width to a segment + // It prevents small partitions e.g. swaps from disappearing completely + bits = add( bits, (tmp < 1) ? 1 : tmp ); + labels = add( labels, descr); + } + }); + + partitions_bargraph = `BarGraph(`id(`bgraph), bits, labels); } - }); + } UI::ReplaceWidget(`tab_panel, `VBox( - UI::TextMode() ? `Empty() : `BarGraph(`id(`bgraph), bits, labels), + partitions_bargraph, `Table(`id(`table), `opt(`keepSorting, `notify, `notifyContextMenu), table_header, table_contents), `HBox( -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org