[yast-commit] r45339 - /branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp
![](https://seccdn.libravatar.org/avatar/ca8d90c49f67ad61282a8e30ff67a25e.jpg?s=120&d=mm&r=g)
Author: aschnell Date: Tue Mar 11 10:30:19 2008 New Revision: 45339 URL: http://svn.opensuse.org/viewcvs/yast?rev=45339&view=rev Log: - added total size info Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp?rev=45339&r1=45338&r2=45339&view=diff ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp Tue Mar 11 10:30:19 2008 @@ -9,6 +9,7 @@ textdomain "storage"; + import "Partitions"; import "DualMultiSelectionBox"; @@ -42,6 +43,11 @@ `InputField(`id("vgname"), "Volume Group Name:"), `InputField(`id("pesize"), _("&Physical Extent Size:"), "4M"), DualMultiSelectionBox::Create(candidates_list), + `HBox( // FIXME + `HStretch(), + `Label(`id(`size), sformat("Total size: %1", + Partitions::ByteToHumanStringWithZero(0))) + ), `HBox( `PushButton(`id(`help), "Help"), `HStretch(), @@ -55,14 +61,26 @@ string pesize = ""; list<string> pvs = []; - any widget = nil; + symbol widget = nil; repeat { - widget = UI::UserInput(); + widget = (symbol) UI::UserInput(); DualMultiSelectionBox::Handle(widget); - if (widget == `ok) + if (contains([`add, `add_all, `remove, `remove_all], widget)) + { + integer size_k = 0; + list<term> tmp1 = DualMultiSelectionBox::GetSelectedItems(); + list<map> candidates_selected = filter(map candidate, candidates, { + any id = `id(candidate["device"]:""); + return find (term t, tmp1, { return t[0]:nil == id; }) != nil; + }); + foreach(map candidate, candidates_selected, { size_k = size_k + candidate["size_k"]:10; }); + UI::ChangeWidget(`id(`size), `Value, sformat("Total size: %1", + Partitions::ByteToHumanStringWithZero(size_k*1024))); + } + else if (widget == `ok) { vgname = deletechars((string) UI::QueryWidget(`id("vgname"), `Value), " \t"); pesize = (string) UI::QueryWidget(`id("pesize"), `Value); -- 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