Author: aschnell Date: Thu Apr 17 19:55:05 2008 New Revision: 46797 URL: http://svn.opensuse.org/viewcvs/yast?rev=46797&view=rev Log: - added convenience function Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-all.ycp branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-all.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-all.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-all.ycp Thu Apr 17 19:55:05 2008 @@ -54,14 +54,10 @@ { import "Hostname"; - term header = StorageFields::TableHeader(fields); string short_hostname = Hostname::CurrentHostname(); - map<string, map> target_map = Storage::GetTargetMap(); - list table_list = StorageFields::TableContents(fields, target_map, predicate_all); UI::ReplaceWidget(`tree_panel, - Greasemonkey::Transform( `VBox( `Left(`Heading( sformat(_("Available Storage on %1"), short_hostname))), @@ -79,9 +75,8 @@ `id(filter_))), */ - `Table(`id(`table), `opt(`keepSorting), - header, table_list) - ))); + StorageFields::Table(fields, target_map, predicate_all) + )); Wizard::RestoreHelp("Help about view with all devices"); } Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp Thu Apr 17 19:55:05 2008 @@ -628,6 +628,16 @@ } + global term Table(list<symbol> fields, map<string, map> target_map, + symbol(map, map) predicate) + { + term header = TableHeader(fields); + list<term> content = TableContents(fields, target_map, predicate); + + return `Table(`opt(`keepSorting), header, content); + } + + global term Overview(list<symbol> fields, map<string, map> target_map, string device) { map disk = Storage::GetDisk(target_map, device); @@ -636,13 +646,13 @@ if (part == $[]) part = nil; - string ret = mergestring(maplist(symbol field, fields, { + string text = mergestring(maplist(symbol field, fields, { if (field == `newline) return "\n"; else return MakeSubInfo(disk, part, field, `overview); }), ""); - return `RichText(`opt(`plainText, `hstretch, `vstretch), ret); + return `RichText(`opt(`plainText, `hstretch, `vstretch), text); } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org