Author: aschnell Date: Mon May 11 15:31:47 2009 New Revision: 57119 URL: http://svn.opensuse.org/viewcvs/yast?rev=57119&view=rev Log: - ask for partition table type when creating new partition table from menu (see fate #303026) Modified: branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_dialogs.ycp branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp Modified: branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes?rev=57119&r1=57118&r2=57119&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes Mon May 11 15:31:47 2009 @@ -1,9 +1,15 @@ ------------------------------------------------------------------- +Mon May 11 03:17:22 CEST 2009 - aschnell@suse.de + +- ask for partition table type when creating new partition table + from menu (see fate #303026) +- version 2.13.106 + +------------------------------------------------------------------- Mon May 11 01:55:21 CEST 2009 - aschnell@suse.de - use provided fstab options when mounting filesystems (bnc #495530) -- version 2.13.106 ------------------------------------------------------------------- Fri Feb 13 16:51:26 CET 2009 - aschnell@suse.de Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=57119&r1=57118&r2=57119&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/custom_part_dialogs.ycp Mon May 11 15:31:47 2009 @@ -1518,23 +1518,56 @@ }; +boolean DDZeroPartitionTable(string del_dev, integer size_k) +{ + string default_label = Storage::DefaultDiskLabel(size_k); + + list<string> labels = [ default_label ]; + if (!contains(labels, "gpt")) + labels = add(labels, "gpt"); + + string label = default_label; + if (size(labels) > 1) + { + term tmp = `VBox(); + foreach(string label, labels, { + tmp = add(tmp, `Left(`RadioButton(`id(label), toupper(label), label == default_label))); + }); + + UI::OpenDialog(`opt(`decorated), + `VBox( + // dialog heading + `Label(sformat(_("Select new partition table type for %1."), del_dev)), + `MarginBox(2, 0.4, `RadioButtonGroup(`id(`labels), `VBox(tmp))), + `HBox( + `PushButton(`id(`ok), `opt(`default), Label::OKButton()), + `PushButton(`id(`cancel), Label::CancelButton()) + ) + ) + ); + symbol widget = (symbol) UI::UserInput(); + + label = (string) UI::QueryWidget(`id(`labels), `Value); + + UI::CloseDialog(); + + if (widget != `ok) + return false; + } -define boolean DDZeroPartitionTable( string del_dev, integer size_k ) - ``{ // popup text - if( Popup::YesNo(sformat(_("CAUTION + if (!Popup::YesNo(sformat(_("CAUTION If you delete the partition table and disk label of device %1, data on this device will be lost. Really do this? "), del_dev))) - { - Storage::DeletePartitionTable(del_dev,size_k); - return true; - } - return false; - }; + return false; + + Storage::CreatePartitionTable(del_dev, label); + return true; +} define symbol ReallyInstPrepdisk( ) Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp?rev=57119&r1=57118&r2=57119&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp (original) +++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/modules/Storage.ycp Mon May 11 15:31:47 2009 @@ -2983,6 +2983,27 @@ return( ret==0 ); } + +global string DefaultDiskLabel(integer size_k) +{ + y2milestone("DefaultDiskLabel size_k:%1", size_k); + string label = LibStorage::StorageInterface::defaultDiskLabelSize(sint, size_k); + y2milestone("DefaultDiskLabel label:%1", label); + return label; +} + + +global boolean CreatePartitionTable(string disk, string label) +{ + y2milestone("CreatePartitionTable %1 label:%2", disk, label); + integer ret = LibStorage::StorageInterface::destroyPartitionTable(sint, disk, label); + if (ret < 0) + y2error("CreatePartitionTable sint ret:%1", ret); + UpdateTargetMap(); + return ret == 0; +} + + global symbol GetMountBy( string device ); /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org