Author: aschnell Date: Wed Nov 19 11:42:20 2008 New Revision: 53402 URL: http://svn.opensuse.org/viewcvs/yast?rev=53402&view=rev Log: - work on asking password for encrypted devices Modified: trunk/storage/storage/src/include/ep-dialogs.ycp Modified: trunk/storage/storage/src/include/ep-dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=53402&r1=53401&r2=53402&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-dialogs.ycp (original) +++ trunk/storage/storage/src/include/ep-dialogs.ycp Wed Nov 19 11:42:20 2008 @@ -59,11 +59,24 @@ boolean do_mount = mount != ""; - boolean AskPassword() + // returns true also when password can be omitted (e.g. encrypted swap) + boolean NeedPassword() { if (!crypt_fs) return false; + if (data["create"]:false && !do_format) + return false; + + return true; + } + + + boolean AskPassword() + { + if (!NeedPassword()) + return false; + // TODO: this is ugly string key = (data["type"]:`unknown != `loop) ? (data["device"]:"error") : (data["fpath"]:"error"); if (Storage::HasClassified(key)) @@ -215,7 +228,7 @@ break; } - case `crypt_fs: + case `crypt_fs: crypt_fs = (boolean) UI::QueryWidget(`id(`crypt_fs), `Value); MiniWorkflow::SetLastStep(!AskPassword()); break; @@ -242,7 +255,7 @@ */ case `do_format: - // TODO + do_format = (boolean) UI::QueryWidget(`id(`do_format), `Value); data["used_fs"] = (symbol) UI::QueryWidget(`id(`fs), `Value); UI::ChangeWidget(`id(`do_format_attachment), `Enabled, true); @@ -251,6 +264,7 @@ break; case `do_not_format: + do_format = (boolean) UI::QueryWidget(`id(`do_format), `Value); UI::ChangeWidget(`id(`do_format_attachment), `Enabled, false); UI::ChangeWidget(`id(`do_not_format_attachment), `Enabled, true); MiniWorkflow::SetLastStep(!AskPassword()); @@ -339,7 +353,7 @@ if (widget == `next) { - if (crypt_fs) + if (NeedPassword()) data["enc_type"] = data["format"]:false ? `luks : `twofish; else data["enc_type"] = `none; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org