Author: aschnell Date: Tue Apr 8 13:49:59 2008 New Revision: 46229 URL: http://svn.opensuse.org/viewcvs/yast?rev=46229&view=rev Log: - MiniWorkflow remembers title Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp branches/tmp/aschnell/part-redesign/storage/src/modules/MiniWorkflow.ycp 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/sto... ============================================================================== --- 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 Tue Apr 8 13:49:59 2008 @@ -44,8 +44,7 @@ { any StepType() { - MiniWorkflow::SetContents(_("Add Partition"), - Greasemonkey::Transform(`HVSquash(FramePartitionType(possibilities))), + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(FramePartitionType(possibilities))), "help"); MiniWorkflow::SetLastStep(false); @@ -55,8 +54,7 @@ any StepSize() { - MiniWorkflow::SetContents(_("Add Partition"), - Greasemonkey::Transform(`HVSquash(FrameSize(`part))), + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(FrameSize(`part))), "help"); MiniWorkflow::SetLastStep(false); @@ -66,10 +64,9 @@ any StepFormatMount() { - MiniWorkflow::SetContents(_("Add Partition"), - Greasemonkey::Transform(`HVSquash(`VStackFrames( + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(`VStackFrames( FrameFormat(`part), - FrameMount(`part) + FrameMount(`part) ))), "help"); @@ -82,7 +79,7 @@ widget = MiniWorkflow::UserInput(); if (widget == `crypt_fs) - { + { MiniWorkflow::SetLastStep(UI::QueryWidget(`id(`crypt_fs), `Value) != true); } else if (widget == `fs_options) @@ -105,7 +102,7 @@ UI::ChangeWidget(`id(`huhu1), `Enabled, true); UI::ChangeWidget(`id(`huhu2), `Enabled, false); } - + } until (widget == `abort || widget == `back || widget == `next); @@ -122,8 +119,7 @@ any StepPassword() { - MiniWorkflow::SetContents(_("Add Partition"), - `HVSquash(FramePassword()), + MiniWorkflow::SetContents(`HVSquash(FramePassword()), "help"); MiniWorkflow::SetLastStep(true); @@ -153,7 +149,7 @@ "Password" : $[ `finish : `finish ] ]; - symbol ret = MiniWorkflow::Run(aliases, sequence, "Type"); + symbol ret = MiniWorkflow::Run(_("Add Partition"), aliases, sequence, "Type"); return false; } @@ -164,27 +160,62 @@ boolean DlgEditPartition(string device) { - UI::OpenDialog(`opt(`decorated), - // heading in a popup dialog - `VBox(`Left(`Heading(_("Edit Partition"))), - StackFrames([ FrameFormat(`part), - FrameMount(`part) ]), - `HBox( - `PushButton(`id(`cancel), Label::CancelButton()), - `PushButton(`id(`ok), `opt(`default), Label::OKButton()) - ) - ) - ); - - symbol widget = nil; + any StepFormatMount() + { + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(`VStackFrames( + FrameFormat(`part), + FrameMount(`part) + ))), + "help"); + + MiniWorkflow::SetLastStep(true); + + symbol widget = nil; + + repeat + { + widget = (symbol) MiniWorkflow::UserInput(); + } + 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; + } - repeat + any StepPassword() { - widget = (symbol) UI::UserInput(); + MiniWorkflow::SetContents(`HVSquash(FramePassword()), + "help"); + + MiniWorkflow::SetLastStep(true); + + any ret = MiniWorkflow::UserInput(); + + if (ret == `next) + return `finish; + + return ret; } - until (widget == `cancel || widget == `ok); - UI::CloseDialog(); + map<string, any> aliases = $[ + "FormatMount" : ``(StepFormatMount()), + "Password" : ``(StepPassword()) + ]; + + map<string, any> sequence = $[ + "FormatMount" : $[ `next : "Password", + `finish : `finish ], + "Password" : $[ `finish : `finish ] + ]; + + symbol widget = MiniWorkflow::Run(_("Edit Partition"), aliases, sequence, "FormatMount"); 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/sto... ============================================================================== --- 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 Apr 8 13:49:59 2008 @@ -44,8 +44,7 @@ ) ); - MiniWorkflow::SetContents(_("Add Volume Group"), - Greasemonkey::Transform(contents), + MiniWorkflow::SetContents(Greasemonkey::Transform(contents), "help"); MiniWorkflow::SetLastStep(true); @@ -55,7 +54,7 @@ repeat { - widget = (symbol) UI::UserInput(); + widget = (symbol) MiniWorkflow::UserInput(); DualMultiSelectionBox::Handle(widget); if (contains([`add, `add_all, `remove, `remove_all], widget)) @@ -102,7 +101,7 @@ "TheOne" : $[ `finish : `finish ] ]; - symbol widget = MiniWorkflow::Run(aliases, sequence, "TheOne"); + symbol widget = MiniWorkflow::Run(_("Add Volume Group"), aliases, sequence, "TheOne"); if (widget == `finish) { @@ -149,8 +148,7 @@ any StepName() { - MiniWorkflow::SetContents(_("Add Logical Volume"), - Greasemonkey::Transform(`HVSquash(FrameVgNameNew())), + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(FrameVgNameNew())), "help"); MiniWorkflow::SetLastStep(false); @@ -161,8 +159,7 @@ any StepSize() { - MiniWorkflow::SetContents(_("Add Logical Volume"), - Greasemonkey::Transform(`HVSquash(StackFrames([ FrameSize(`lv), + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(StackFrames([ FrameSize(`lv), FrameStripes() ]))), "help"); @@ -175,8 +172,7 @@ any StepFormatMount() { // TODO almost identical to "Add Partitiion" - MiniWorkflow::SetContents(_("Add Logical Volume"), - Greasemonkey::Transform(`HVSquash(StackFrames([ FrameFormat(`lv), + MiniWorkflow::SetContents(Greasemonkey::Transform(`HVSquash(StackFrames([ FrameFormat(`lv), FrameMount(`lv) ]))), "help"); @@ -189,8 +185,7 @@ any StepPassword() { // TODO identical to "Add Partitiion" - MiniWorkflow::SetContents(_("Add Logical Volume"), - `HVSquash(FramePassword()), + MiniWorkflow::SetContents(`HVSquash(FramePassword()), "help"); MiniWorkflow::SetLastStep(true); @@ -220,7 +215,7 @@ "Password" : $[ `finish : `finish ] ]; - symbol ret = MiniWorkflow::Run(aliases, sequence, "Name"); + symbol ret = MiniWorkflow::Run(_("Add Logical Volume"), aliases, sequence, "Name"); return false; } Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/MiniWorkflow.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/modules/MiniWorkflow.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/modules/MiniWorkflow.ycp Tue Apr 8 13:49:59 2008 @@ -15,9 +15,12 @@ import "Sequencer"; - global void SetContents(string title, term contents, string help_text) + string title = ""; + + + global void SetContents(term contents, string help_text) { - Wizard::SetContentsFocus(title, contents, help_text, true, true, true); + Wizard::SetContents(title, contents, help_text, true, true); } @@ -36,9 +39,13 @@ } - global symbol Run(map<string, any> aliases, map<string, any> sequence, string start) + global symbol Run(string new_title, map<string, any> aliases, map<string, any> sequence, + string start) { + title = new_title; + Wizard::OpenNextBackDialog(); + Wizard::SetContents(title, `Empty(), "", false, false); sequence = mapmap(string key, any value, sequence, { if (key != "ws_start" && is(value, map)) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org