Author: jsuchome Date: Tue Oct 18 11:11:06 2011 New Revision: 66473 URL: http://svn.opensuse.org/viewcvs/yast?rev=66473&view=rev Log: - added UI for disk encryption (fate#312486) Modified: trunk/product-creator/package/yast2-product-creator.changes trunk/product-creator/src/kiwi_dialogs.ycp Modified: trunk/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-product-creator.changes?rev=66473&r1=66472&r2=66473&view=diff ============================================================================== --- trunk/product-creator/package/yast2-product-creator.changes (original) +++ trunk/product-creator/package/yast2-product-creator.changes Tue Oct 18 11:11:06 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Tue Oct 18 11:09:16 CEST 2011 - jsuchome@suse.cz + +- added UI for disk encryption (fate#312486) + +------------------------------------------------------------------- Mon Oct 17 15:28:32 CEST 2011 - jsuchome@suse.cz - call SLEPOS specific XSL transformation (bnc#723031) Modified: trunk/product-creator/src/kiwi_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/kiwi_dialogs.ycp?rev=66473&r1=66472&r2=66473&view=diff ============================================================================== --- trunk/product-creator/src/kiwi_dialogs.ycp (original) +++ trunk/product-creator/src/kiwi_dialogs.ycp Tue Oct 18 11:11:06 2011 @@ -123,6 +123,54 @@ return nil; } + void InitDiskPassword (string id) { + + string disk_password = ""; + foreach (map typemap, (list<map>)KiwiConfig["preferences",0,"type"]:[], { + if (typemap["image"]:"" == kiwi_task) + { + disk_password = typemap["luks"]:disk_password; + } + }); + UI::ChangeWidget (`id (id), `Value, disk_password); + UI::ChangeWidget (`id (id), `Enabled, disk_password != ""); + UI::ChangeWidget (`id ("encrypt_disk"), `Value, disk_password != ""); + } + + void StoreDiskPassword (string key, map event) { + + string disk_password = (string) UI::QueryWidget (`id (key), `Value); + if (UI::ChangeWidget (`id ("encrypt_disk"), `Value) == false) + disk_password = ""; + + KiwiConfig["preferences",0,"type"] = maplist (map typemap, + (list<map>)KiwiConfig["preferences",0,"type"]:[], + { + if (typemap["image"]:"" == kiwi_task) + { + if (disk_password == "") + { + if (haskey (typemap, "luks")) + typemap = remove (typemap, "luks"); + } + else + typemap["luks"] = disk_password; + } + return typemap; + }); + } + + symbol HandleDiskPassword (string key, map event) { + if (event["ID"]:nil == `next) StoreDiskPassword (key, event); + return nil; + } + + symbol HandleEncryptDisk (string key, map event) { + boolean value = (boolean) UI::QueryWidget (`id (key), `Value); + UI::ChangeWidget (`id ("disk_password"), `Enabled, value); + return nil; + } + /** * Initialize the widget with ignored packages */ @@ -1676,6 +1724,13 @@ show_compression ? `HWeight (1, "compression") : `HBox () ), `HBox ( + `VBox ( + `Label (""), + "encrypt_disk" + ), + "disk_password" + ), + `HBox ( `HWeight (2, `VBox ( "sw_selection", `Left (`Label (_("Installed Software"))), @@ -1689,6 +1744,7 @@ "widget_names" : [ "version", "size", "sizeunit", "additive", + "encrypt_disk", "disk_password", "sw_selection", "rt_sw", "configure_sw", "delete_sw", @@ -1884,6 +1940,24 @@ "label" : _("Additive"), "no_help" : true, ], + "encrypt_disk" : $[ + "widget" : `checkbox, + "opt" : [ `notify ], + // check box label + "label" : _("Encrypt Image with LUKS"), + // help text + "help" : _("<p>For creating encrypted file system, check <b>Encrypt Image with LUKS</b> and enter the password.</p>"), + "handle" : HandleEncryptDisk, + ], + "disk_password" : $[ + "widget" : `textentry, + // textentry label + "label" : _("Encrypted Image LUKS Password"), + "init" : InitDiskPassword, + "store" : StoreDiskPassword, + "handle" : HandleDiskPassword, + "no_help" : true, + ], // ---------------- widgtes for directory structure "general_scripts" : $[ "widget" : `empty, -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org