Author: aschnell Date: Thu Feb 21 14:21:39 2008 New Revision: 44743 URL: http://svn.opensuse.org/viewcvs/yast?rev=44743&view=rev Log: - playing with resize dialog Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.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=44743&r1=44742&r2=44743&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 Thu Feb 21 14:21:39 2008 @@ -88,5 +88,55 @@ return nil; } -} + + void DlgResizeLogicalVolumeGroupNew(string device) + { + integer lv_used = 3500; + integer lv_free = 7000; + integer lv_min_free = 10; + integer vg_free = 80000; + integer vg_min_free = 0; + + integer total_free = lv_free + vg_free; + + // Unit for partition resizing - currently Megabytes + string unit = _("MB"); + + // Labels for bar graph. "%1" will be replace with a numeric value. + string bargraph_label_lv_used = _("LV\nUsed\n%1") + unit; + // Labels for bar graph. "%1" will be replace with a numeric value. + string bargraph_label_lv_free = _("LV\nFree\n%1") + unit; + // Labels for bar graph. "%1" will be replace with a numeric value. + string bargraph_label_vg_free = _("VG\nFree\n%1") + unit; + + // Labels for input fields. "%1" will be replaced with the current unit (MB). + string field_label_lv_free = sformat(_("LV Free (%1)"), unit); + // Labels for input fields. "%1" will be replaced with the current unit (MB). + string field_label_vg_free = sformat(_("VG (%1)"), unit); + + UI::OpenDialog( + `VBox( + `Left(`Heading(_("Resize Volume Group"))), + `HSpacing(60), + `PartitionSplitter(lv_used, total_free, vg_free, vg_min_free, lv_min_free, + bargraph_label_lv_used, bargraph_label_lv_free, + bargraph_label_vg_free, field_label_lv_free, + field_label_vg_free), + `HBox( + `HStretch(), + `PushButton(`id(`cancel), Label::CancelButton()), + `PushButton(`id(`ok), `opt(`default), Label::OKButton()) + ) + ) + ); + + any widget = UI::UserInput(); + + UI::CloseDialog(); + + if (widget == `ok) + { + } + } +} 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=44743&r1=44742&r2=44743&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 Thu Feb 21 14:21:39 2008 @@ -80,7 +80,7 @@ } } } - + void CreateLvmVgLvsTab(any user_data) { @@ -128,6 +128,11 @@ void HandleLvmVgLvsTab(any user_data, any widget) { string device = (string) user_data; + + if (widget == `resize) + { + DlgResizeLogicalVolumeGroupNew(device); + } } @@ -226,4 +231,15 @@ ) ); } + + + void HandleLvmLvPanel(any user_data, any widget) + { + string device = (string) user_data; + + if (widget == `resize) + { + DlgResizeLogicalVolumeGroupNew(device); + } + } } Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp?rev=44743&r1=44742&r2=44743&view=diff ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp Thu Feb 21 14:21:39 2008 @@ -409,7 +409,7 @@ foreach(map partition, partitions, ``{ string d = partition["device"]:""; tmp = add(tmp, `item(`id(d), d)); - data = add(data, d, $[ `create : CreateLvmLvPanel, `user_data : d ]); + data = add(data, d, $[ `create : CreateLvmLvPanel, `handle : HandleLvmLvPanel, `user_data : d ]); }); haha[`lvm] = add(haha[`lvm]:[], `item(`id(device), device, tmp)); data = add(data, device, $[ `create : CreateLvmVgPanel, `handle : HandleLvmVgPanel, `user_data : device ]); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org