Author: aschnell
Date: Wed Apr 2 19:27:27 2008
New Revision: 45990
URL: http://svn.opensuse.org/viewcvs/yast?rev=45990&view=rev
Log:
- backup commit
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=45990&r1=45989&r2=45990&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 Wed Apr 2 19:27:27 2008
@@ -27,22 +27,22 @@
term FrameFormat(symbol flavour)
{
term tmp = `VBox(
- `Left(`RadioButton(`id(`do_not_format),
+ `Left(`RadioButton(`id(`do_not_format), `opt(`notify),
_("Do not format the partition"))));
if (flavour == `part)
- tmp = add(tmp, IndentAfterRadioButton(FsidComboBox($[], FileSystems::GetAllFileSystems(true, true))));
+ tmp = add(tmp, IndentAfterRadioButton(`VBox(`id(`huhu1), FsidComboBox($[], FileSystems::GetAllFileSystems(true, true)))));
return `Frame(_("Format"),
`VBox(
`RadioButtonGroup(`id(`format),
`VBox(
tmp,
- `VBox(
- `Left(`RadioButton(`id(`do_format),
+ `VBox(`Left(`RadioButton(`id(`do_format), `opt(`notify),
_("Format the partition"))),
IndentAfterRadioButton(
- FileSystemsComboBox($[], FileSystems::GetAllFileSystems(true, true))))
+ `VBox(`id(`huhu2),
+ FileSystemsComboBox($[], FileSystems::GetAllFileSystems(true, true)))))
))
)
);
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=45990&r1=45989&r2=45990&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 Wed Apr 2 19:27:27 2008
@@ -39,103 +39,110 @@
-
- // I don't want to set the title 4 times
- // where store globel data, e.g. possibilities
- // where save the collected data?
-
- any StepType(map possibilities)
+ boolean DlgCreatePartition(map possibilities)
{
- MiniWorkflow::SetContents(_("Add Partition"),
- `HVSquash(FramePartitionType(possibilities)),
- "help");
+ any StepType()
+ {
+ MiniWorkflow::SetContents(_("Add Partition"),
+ `HVSquash(FramePartitionType(possibilities)),
+ "help");
- MiniWorkflow::SetLastStep(false);
+ MiniWorkflow::SetLastStep(false);
- return MiniWorkflow::UserInput();
- }
+ return MiniWorkflow::UserInput();
+ }
- any StepSize()
- {
- MiniWorkflow::SetContents(_("Add Partition"),
- `HVSquash(FrameSize(`part)),
- "help");
+ any StepSize()
+ {
+ MiniWorkflow::SetContents(_("Add Partition"),
+ `HVSquash(FrameSize(`part)),
+ "help");
- MiniWorkflow::SetLastStep(false);
+ MiniWorkflow::SetLastStep(false);
- return MiniWorkflow::UserInput();
- }
-
- any StepFormatMount()
- {
- MiniWorkflow::SetContents(_("Add Partition"),
- `HVSquash(StackFrames(
- [ FrameFormat(`part),
- FrameMount(`part) ]
- )),
- "help");
+ return MiniWorkflow::UserInput();
+ }
- MiniWorkflow::SetLastStep(true);
+ any StepFormatMount()
+ {
+ MiniWorkflow::SetContents(_("Add Partition"),
+ `HVSquash(StackFrames(
+ [ FrameFormat(`part),
+ FrameMount(`part) ]
+ )),
+ "help");
- any widget = nil;
+ MiniWorkflow::SetLastStep(true);
- repeat
- {
- widget = MiniWorkflow::UserInput();
+ any widget = nil;
- if (widget == `crypt_fs)
- {
- MiniWorkflow::SetLastStep(UI::QueryWidget(`id(`crypt_fs), `Value) != true);
- }
- else if (widget == `fs_options)
+ repeat
{
- FileSystemOptions($[], $[]);
+ widget = MiniWorkflow::UserInput();
+
+ if (widget == `crypt_fs)
+ {
+ UI::ChangeWidget(`id(`huhu2), `Enabled, false);
+ MiniWorkflow::SetLastStep(UI::QueryWidget(`id(`crypt_fs), `Value) != true);
+ }
+ else if (widget == `fs_options)
+ {
+ FileSystemOptions($[], $[]);
+ }
+ else if (widget == `fstab_options)
+ {
+ FstabOptions($[], $[]);
+ }
+ else if (widget == `do_format)
+ {
+ // can't the UI do that for me?
+ // some widget RadioButtonWithAttachment (would also obsolete IndentAfterRadioButton)
+ UI::ChangeWidget(`id(`huhu1), `Enabled, false);
+ UI::ChangeWidget(`id(`huhu2), `Enabled, true);
+ }
+ else if (widget == `do_not_format)
+ {
+ UI::ChangeWidget(`id(`huhu1), `Enabled, true);
+ UI::ChangeWidget(`id(`huhu2), `Enabled, false);
+ }
+
}
- else if (widget == `fstab_options)
+ until (widget == `abort || widget == `back || widget == `next);
+
+ if (widget == `next)
{
- FstabOptions($[], $[]);
+ if (UI::QueryWidget(`id(`crypt_fs), `Value) == true)
+ return `next;
+ else
+ return `finish;
}
- }
- until (widget == `abort || widget == `back || widget == `next);
- if (widget == `next)
- {
- if (UI::QueryWidget(`id(`crypt_fs), `Value) == true)
- return `next;
- else
- return `finish;
+ return widget;
}
- return widget;
- }
-
- any StepPassword()
- {
- MiniWorkflow::SetContents(_("Add Partition"),
- `HVSquash(FramePassword()),
- "help");
-
- MiniWorkflow::SetLastStep(true);
+ any StepPassword()
+ {
+ MiniWorkflow::SetContents(_("Add Partition"),
+ `HVSquash(FramePassword()),
+ "help");
- any ret = MiniWorkflow::UserInput();
+ MiniWorkflow::SetLastStep(true);
- if (ret == `next)
- return `finish;
+ any ret = MiniWorkflow::UserInput();
- return ret;
- }
+ if (ret == `next)
+ return `finish;
+ return ret;
+ }
- boolean DlgCreatePartition(map possibilities)
- {
- y2milestone("huhu");
map aliases = $[
- "Type" : ``(StepType(possibilities)),
+ "Type" : ``(StepType()),
"Size" : ``(StepSize()),
"FormatMount" : ``(StepFormatMount()),
"Password" : ``(StepPassword())
- ];
+ ];
map sequence = $[
"Type" : $[ `next : "Size" ],
@@ -148,8 +155,6 @@
symbol ret = MiniWorkflow::Run(aliases, sequence, "Type");
- y2milestone("huhu %1", ret);
-
return false;
}
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=45990&r1=45989&r2=45990&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 Wed Apr 2 19:27:27 2008
@@ -13,6 +13,7 @@
import "DualMultiSelectionBox";
+
string DlgCreateVolumeGroupNew()
{
map tg = Storage::GetTargetMap();
@@ -25,87 +26,91 @@
return `item(`id(device), device + " " + ByteToHumanStringWithZero(size_k*1024));
});
- /*
- foreach(string t, ["/dev/hda1", "/dev/hda2", "/dev/hda3", "/dev/hda4", "/dev/hda5",
- "/dev/hdb1", "/dev/hdb2", "/dev/hdb3", "/dev/hdb4", "/dev/hdb5",
- "/dev/hdb6", "/dev/hdb7", "/dev/hdb8", "/dev/hdb9", "/dev/hdb10" ], {
- if (substring(t, 5, 3) == "hda")
- candidates_list = add(candidates_list, `item(`id(t), t + " 10.0 GB"));
- else
- candidates_list = add(candidates_list, `item(`id(t), t + " 100.0 GB"));
- });
- */
-
- // TODO: use Wizard:: ?
- UI::OpenDialog(`opt(`defaultsize),
- `VBox(
- `Heading("Add Volume Group"),
- `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(),
- `PushButton(`id(`cancel), "Cancel"),
- `PushButton(`id(`ok), `opt(`default), "OK")
- )
- )
- );
-
string vgname = "";
string pesize = "";
list<string> pvs = [];
- symbol widget = nil;
- repeat
+ any StepTheOne()
{
- widget = (symbol) UI::UserInput();
- DualMultiSelectionBox::Handle(widget);
+ term contents = `VBox(
+ `Left(`InputField(`id("vgname"), "Volume Group Name")),
+ `Left(`InputField(`id("pesize"), _("&Physical Extent Size"), "4M")),
+ DualMultiSelectionBox::Create(candidates_list),
+ `HBox( // FIXME
+ `HStretch(),
+ `Label(`id(`size), sformat("Total size: %1",
+ Partitions::ByteToHumanStringWithZero(0)))
+ )
+ );
+
+ MiniWorkflow::SetContents(_("Add Volume Group"),
+ contents,
+ "help");
- 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)
+ MiniWorkflow::SetLastStep(true);
+
+
+ symbol widget = nil;
+
+ repeat
{
- vgname = deletechars((string) UI::QueryWidget(`id("vgname"), `Value), " \t");
- pesize = (string) UI::QueryWidget(`id("pesize"), `Value);
+ widget = (symbol) UI::UserInput();
+ DualMultiSelectionBox::Handle(widget);
- 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;
- });
- pvs = maplist(map candidate, candidates_selected, { return candidate["device"]:""; });
+ 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 == `next)
+ {
+ vgname = deletechars((string) UI::QueryWidget(`id("vgname"), `Value), " \t");
+ pesize = (string) UI::QueryWidget(`id("pesize"), `Value);
+
+ 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;
+ });
+ pvs = maplist(map candidate, candidates_selected, { return candidate["device"]:""; });
- // TODO: checks
+ // TODO: checks
+ }
}
+ until (widget == `abort || widget == `back || widget == `next);
+
+ if (widget == `next)
+ return `finish;
+ else
+ return widget;
}
- until (widget == `cancel || widget == `ok);
- UI::CloseDialog();
- if (widget == `ok)
+ map aliases = $[
+ "TheOne" : ``(StepTheOne())
+ ];
+
+ map sequence = $[
+ "TheOne" : $[ `finish : `finish ]
+ ];
+
+ symbol widget = MiniWorkflow::Run(aliases, sequence, "TheOne");
+
+ if (widget == `finish)
{
if (Storage::CreateLvmVgWithDevs(vgname, pesize_str_to_byte (pesize), true, pvs))
return vgname;
}
- return nil;
+ return "";
}
@@ -140,31 +145,82 @@
boolean DlgCreateLogicalVolume()
{
- UI::OpenDialog(`opt(`decorated),
- // heading in a popup dialog
- `VBox(`Left(`Heading(_("Add Logical Volume"))),
- StackFrames([ FrameVgNameNew(),
- FrameSize(`lv),
- FrameStripes(),
- FrameFormat(`lv),
- FrameMount(`lv) ]),
- `HBox(
- `HStretch(),
- `PushButton(`id(`cancel), Label::CancelButton()),
- `PushButton(`id(`ok), `opt(`default), Label::OKButton())
- )
- )
- );
- symbol widget = nil;
- repeat
+ any StepName()
{
- widget = (symbol) UI::UserInput();
+ MiniWorkflow::SetContents(_("Add Logical Volume"),
+ `HVSquash(FrameVgNameNew()),
+ "help");
+
+ MiniWorkflow::SetLastStep(false);
+
+ return MiniWorkflow::UserInput();
}
- until (widget == `cancel || widget == `ok);
+
+
+ any StepSize()
+ {
+ MiniWorkflow::SetContents(_("Add Logical Volume"),
+ `HVSquash(StackFrames([ FrameSize(`lv),
+ FrameStripes() ])),
+ "help");
- UI::CloseDialog();
+ MiniWorkflow::SetLastStep(false);
+
+ return MiniWorkflow::UserInput();
+ }
+
+
+ any StepFormatMount()
+ {
+ // TODO almost identical to "Add Partitiion"
+ MiniWorkflow::SetContents(_("Add Logical Volume"),
+ `HVSquash(StackFrames([ FrameFormat(`lv),
+ FrameMount(`lv) ])),
+ "help");
+
+ MiniWorkflow::SetLastStep(false);
+
+ return MiniWorkflow::UserInput();
+ }
+
+
+ any StepPassword()
+ {
+ // TODO identical to "Add Partitiion"
+ MiniWorkflow::SetContents(_("Add Logical Volume"),
+ `HVSquash(FramePassword()),
+ "help");
+
+ MiniWorkflow::SetLastStep(true);
+
+ any ret = MiniWorkflow::UserInput();
+
+ if (ret == `next)
+ return `finish;
+
+ return ret;
+ }
+
+
+ map aliases = $[
+ "Name" : ``(StepName()),
+ "Size" : ``(StepSize()),
+ "FormatMount" : ``(StepFormatMount()),
+ "Password" : ``(StepPassword())
+ ];
+
+ map sequence = $[
+ "Name" : $[ `next : "Size" ],
+ "Size" : $[ `next : "FormatMount",
+ `finish : `finish ],
+ "FormatMount" : $[ `next : "Password",
+ `finish : `finish ],
+ "Password" : $[ `finish : `finish ]
+ ];
+
+ symbol ret = MiniWorkflow::Run(aliases, sequence, "Name");
return false;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org