Author: aschnell
Date: Mon Jul 14 12:00:29 2008
New Revision: 49026
URL: http://svn.opensuse.org/viewcvs/yast?rev=49026&view=rev
Log:
- moved functions
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.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/storage/src/include/ep-dialogs.ycp?rev=49026&r1=49025&r2=49026&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp Mon Jul 14 12:00:29 2008
@@ -20,210 +20,6 @@
}
- symbol MiniWorkflowStepPartitionSize(map &data)
- {
- y2milestone("MiniWorkflowStepPartitionSize data:%1", data);
-
- list slot = data["slots", data["type"]:`unknown]:[];
- integer max_size = slot[1]:0 * data["cyl_size"]:0;
-
- string tmp = Storage::ByteToHumanString(max_size);
-
- term contents = `HVSquash(
- `Frame(_("Size"),
- `RadioButtonGroup(`id(`size),
- `VBox(
- `LeftRadioButton(`id(`max_size), `opt(`notify),
- sformat(_("Maximum Size (%1)"), tmp)),
- `LeftRadioButtonWithAttachment(`id(`manual_size), `opt(`notify), _("Manual Size"),
- `VBox(`id(`manual_size_attachment),
- `MinWidth(15, `InputField(`id(`size_input), `opt(`shrinkable), _("Size")))
- )
- )
- )
- )));
-
- MiniWorkflow::SetContents(Greasemonkey::Transform(contents), "help");
-
- MiniWorkflow::SetLastStep(data["type"]:`unknown == `extended);
-
- symbol widget = nil;
-
- repeat
- {
- widget = MiniWorkflow::UserInput();
-
- switch (widget)
- {
- case `max_size:
- UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, false);
- break;
-
- case `manual_size:
- UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, true);
- break;
- }
- }
- until (widget == `abort || widget == `back || widget == `next);
-
- if (widget == `next)
- {
- switch ((symbol) UI::QueryWidget(`id(`size), `Value))
- {
- case `max_size:
- {
- data["region"] = slot;
- break;
- }
-
- case `manual_size:
- {
- // TODO
- string s = (string) UI::QueryWidget(`id(`size_input), `Value);
-
- integer i = 0;
- Storage::HumanStringToByte(s, i);
- // integer i = Storage::KmgtStrToByte(s);
-
- integer num_cyl = tointeger(float::ceil(tofloat(i) / tofloat(data["cyl_size"]:42)));
- data["region"] = [ slot[0]:0, num_cyl ];
- break;
- }
- }
-
- if (data["type"]:`unknown == `extended)
- {
- widget = `finish;
- }
-
- Debug("data", data);
- }
-
- y2milestone("MiniWorkflowStepPartitionSize data:%1 ret:%2", data, widget);
-
- return widget;
- }
-
-
- symbol MiniWorkflowStepLvSize(map &data)
- {
- y2milestone("MiniWorkflowStepLvSize data:%1", data);
-
- term frames = `VStackFrames();
-
- integer max_size = data["max_size"]:0;
- integer stripes = data["stripes"]:1;
- integer stripe_size = data["stripesize"]:64*1024;
-
- string tmp = Storage::ByteToHumanString(max_size);
-
- symbol what = `max_size;
- integer manual_size = 0;
-
- frames = add(frames,
- `Frame(_("Size"),
- `RadioButtonGroup(`id(`size),
- `VBox(
- `LeftRadioButton(`id(`max_size), `opt(`notify),
- sformat(_("Maximum Size (%1)"), tmp)),
- `LeftRadioButtonWithAttachment(`id(`manual_size), `opt(`notify), _("Manual Size"),
- `VBox(`id(`manual_size_attachment),
- `MinWidth(15, `InputField(`id(`size_input), `opt(`shrinkable), _("Size")))
- )
- )
- )
- )));
-
-
- list<term> stripes_list = maplist(integer i, Integer::RangeFrom(1, 9), {
- return `item(`id(i), tostring(i));
- });
-
- list<term> stripe_sizes_list = maplist(integer i, Integer::RangeFrom(11, 20), {
- return `item(`id(2 << i), Storage::ByteToHumanStringWithPrecision(2 << i, 2, true));
- });
-
- frames = add(frames, `Frame("Stripes",
- `HBox(
- `Left(`ComboBoxSelected(`id(`stripes), `opt(`notify), _("Number"), stripes_list, `id(stripes))),
- `Left(`ComboBoxSelected(`id(`stripe_size), _("Size"), stripe_sizes_list, `id(stripe_size))),
- `HStretch())
- )
- );
-
- term contents = `HVSquash(frames);
-
- MiniWorkflow::SetContents(Greasemonkey::Transform(contents), "help");
-
- MiniWorkflow::SetLastStep(false);
-
- symbol widget = nil;
-
- repeat
- {
- widget = MiniWorkflow::UserInput();
-
- switch (widget)
- {
- case `max_size:
- UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, false);
- break;
-
- case `manual_size:
- UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, true);
- break;
-
- case `stripes:
- stripes = (integer) UI::QueryWidget(`id(`stripes), `Value);
- UI::ChangeWidget(`id(`stripe_size), `Enabled, stripes > 1);
- break;
-
- case `next:
- what = (symbol) UI::QueryWidget(`id(`size), `Value);
- if (what == `manual_size)
- {
- string s = (string) UI::QueryWidget(`id(`size_input), `Value);
- if (!Storage::HumanStringToByte(s, manual_size))
- {
- Error(_("The size in invalid. TODO"));
- widget = `again;
- }
- }
-
- // TODO min-size check
-
- stripes = (integer) UI::QueryWidget(`id(`stripes), `Value);
- stripe_size = (integer) UI::QueryWidget(`id(`stripe_size), `Value);
- break;
- }
- }
- until (widget == `abort || widget == `back || widget == `next);
-
- if (widget == `next)
- {
- switch (what)
- {
- case `max_size:
- data["size_k"] = max_size / 1024;
- break;
-
- case `manual_size:
- data["size_k"] = manual_size / 1024;
- break;
- }
-
- data["stripes"] = stripes;
- data["stripesize"] = stripe_size/1024;
-
- Debug("data", data);
- }
-
- y2milestone("MiniWorkflowStepLvSize data:%1 ret:%2", data, widget);
-
- return widget;
- }
-
-
symbol MiniWorkflowStepFormatMount(map &data)
{
y2milestone("MiniWorkflowStepFormatMount data:%1", data);
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp?rev=49026&r1=49025&r2=49026&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp Mon Jul 14 12:00:29 2008
@@ -79,6 +79,91 @@
}
+ symbol MiniWorkflowStepPartitionSize(map &data)
+ {
+ y2milestone("MiniWorkflowStepPartitionSize data:%1", data);
+
+ list slot = data["slots", data["type"]:`unknown]:[];
+ integer max_size = slot[1]:0 * data["cyl_size"]:0;
+
+ string tmp = Storage::ByteToHumanString(max_size);
+
+ term contents = `HVSquash(
+ `Frame(_("Size"),
+ `RadioButtonGroup(`id(`size),
+ `VBox(
+ `LeftRadioButton(`id(`max_size), `opt(`notify),
+ sformat(_("Maximum Size (%1)"), tmp)),
+ `LeftRadioButtonWithAttachment(`id(`manual_size), `opt(`notify), _("Manual Size"),
+ `VBox(`id(`manual_size_attachment),
+ `MinWidth(15, `InputField(`id(`size_input), `opt(`shrinkable), _("Size")))
+ )
+ )
+ )
+ )));
+
+ MiniWorkflow::SetContents(Greasemonkey::Transform(contents), "help");
+
+ MiniWorkflow::SetLastStep(data["type"]:`unknown == `extended);
+
+ symbol widget = nil;
+
+ repeat
+ {
+ widget = MiniWorkflow::UserInput();
+
+ switch (widget)
+ {
+ case `max_size:
+ UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, false);
+ break;
+
+ case `manual_size:
+ UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, true);
+ break;
+ }
+ }
+ until (widget == `abort || widget == `back || widget == `next);
+
+ if (widget == `next)
+ {
+ switch ((symbol) UI::QueryWidget(`id(`size), `Value))
+ {
+ case `max_size:
+ {
+ data["region"] = slot;
+ break;
+ }
+
+ case `manual_size:
+ {
+ // TODO
+ string s = (string) UI::QueryWidget(`id(`size_input), `Value);
+
+ integer i = 0;
+ Storage::HumanStringToByte(s, i);
+ // integer i = Storage::KmgtStrToByte(s);
+
+ integer num_cyl = tointeger(float::ceil(tofloat(i) / tofloat(data["cyl_size"]:42)));
+ data["region"] = [ slot[0]:0, num_cyl ];
+ break;
+ }
+ }
+
+ if (data["type"]:`unknown == `extended)
+ {
+ widget = `finish;
+ }
+
+ Debug("data", data);
+ }
+
+ y2milestone("MiniWorkflowStepPartitionSize data:%1 ret:%2", data, widget);
+
+ return widget;
+ }
+
+
boolean DlgCreatePartition(map &data)
{
data["flavour"] = `part;
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=49026&r1=49025&r2=49026&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 Mon Jul 14 12:00:29 2008
@@ -255,6 +255,125 @@
}
+ symbol MiniWorkflowStepLvSize(map &data)
+ {
+ y2milestone("MiniWorkflowStepLvSize data:%1", data);
+
+ term frames = `VStackFrames();
+
+ integer max_size = data["max_size"]:0;
+ integer stripes = data["stripes"]:1;
+ integer stripe_size = data["stripesize"]:64*1024;
+
+ string tmp = Storage::ByteToHumanString(max_size);
+
+ symbol what = `max_size;
+ integer manual_size = 0;
+
+ frames = add(frames,
+ `Frame(_("Size"),
+ `RadioButtonGroup(`id(`size),
+ `VBox(
+ `LeftRadioButton(`id(`max_size), `opt(`notify),
+ sformat(_("Maximum Size (%1)"), tmp)),
+ `LeftRadioButtonWithAttachment(`id(`manual_size), `opt(`notify), _("Manual Size"),
+ `VBox(`id(`manual_size_attachment),
+ `MinWidth(15, `InputField(`id(`size_input), `opt(`shrinkable), _("Size")))
+ )
+ )
+ )
+ )));
+
+
+ list<term> stripes_list = maplist(integer i, Integer::RangeFrom(1, 9), {
+ return `item(`id(i), tostring(i));
+ });
+
+ list<term> stripe_sizes_list = maplist(integer i, Integer::RangeFrom(11, 20), {
+ return `item(`id(2 << i), Storage::ByteToHumanStringWithPrecision(2 << i, 2, true));
+ });
+
+ frames = add(frames, `Frame("Stripes",
+ `HBox(
+ `Left(`ComboBoxSelected(`id(`stripes), `opt(`notify), _("Number"), stripes_list, `id(stripes))),
+ `Left(`ComboBoxSelected(`id(`stripe_size), _("Size"), stripe_sizes_list, `id(stripe_size))),
+ `HStretch())
+ )
+ );
+
+ term contents = `HVSquash(frames);
+
+ MiniWorkflow::SetContents(Greasemonkey::Transform(contents), "help");
+
+ MiniWorkflow::SetLastStep(false);
+
+ symbol widget = nil;
+
+ repeat
+ {
+ widget = MiniWorkflow::UserInput();
+
+ switch (widget)
+ {
+ case `max_size:
+ UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, false);
+ break;
+
+ case `manual_size:
+ UI::ChangeWidget(`id(`manual_size_attachment), `Enabled, true);
+ break;
+
+ case `stripes:
+ stripes = (integer) UI::QueryWidget(`id(`stripes), `Value);
+ UI::ChangeWidget(`id(`stripe_size), `Enabled, stripes > 1);
+ break;
+
+ case `next:
+ what = (symbol) UI::QueryWidget(`id(`size), `Value);
+ if (what == `manual_size)
+ {
+ string s = (string) UI::QueryWidget(`id(`size_input), `Value);
+ if (!Storage::HumanStringToByte(s, manual_size))
+ {
+ Error(_("The size in invalid. TODO"));
+ widget = `again;
+ }
+ }
+
+ // TODO min-size check
+
+ stripes = (integer) UI::QueryWidget(`id(`stripes), `Value);
+ stripe_size = (integer) UI::QueryWidget(`id(`stripe_size), `Value);
+ break;
+ }
+ }
+ until (widget == `abort || widget == `back || widget == `next);
+
+ if (widget == `next)
+ {
+ switch (what)
+ {
+ case `max_size:
+ data["size_k"] = max_size / 1024;
+ break;
+
+ case `manual_size:
+ data["size_k"] = manual_size / 1024;
+ break;
+ }
+
+ data["stripes"] = stripes;
+ data["stripesize"] = stripe_size/1024;
+
+ Debug("data", data);
+ }
+
+ y2milestone("MiniWorkflowStepLvSize data:%1 ret:%2", data, widget);
+
+ return widget;
+ }
+
+
boolean DlgResizeVolumeGroup(map &data)
{
map aliases = $[
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org