Author: kmachalkova
Date: Wed Nov 4 18:37:37 2009
New Revision: 59303
URL: http://svn.opensuse.org/viewcvs/yast?rev=59303&view=rev
Log:
Multiple devices can be selected to be a clone
Modified:
branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp?rev=59303&r1=59302&r2=59303&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-hd-lib.ycp Wed Nov 4 18:37:37 2009
@@ -8,6 +8,7 @@
textdomain "storage";
import "Map";
+ import "HTML";
void EpCreatePartitionTable(string disk_device)
{
@@ -376,6 +377,26 @@
return items;
}
+ boolean ConfirmDeletePartitions( list <string> to_delete) {
+
+ UI::OpenDialog( `VBox(
+ `Label(_("The following partitions will be deleted\n and all data on them will be lost:")),
+ `VSpacing(1),
+ `RichText(HTML::List( to_delete)),
+ `Left(`Label(_("Really delete these partitions?"))),
+ `VSpacing(1),
+ `ButtonBox(
+ `PushButton(`id(`ok), `opt(`default), Label::DeleteButton()),
+ `PushButton(`id(`cancel), Label::CancelButton())
+ )
+ )
+ );
+ symbol ret = (symbol) UI::UserInput();
+ UI::CloseDialog();
+
+ return (ret == `ok);
+ }
+
if (size(myparts) == 0) {
Popup::Error(_("There are no partitions on this disk (a clonable
disk must have at least one partition).
@@ -396,18 +417,17 @@
Storage::KByteToHumanString( target_map[one_disk, "size_k"]:42)));
});
- ui_items = prepend(ui_items, `item(`id(`none), _("--none--")));
-
- UI::OpenDialog ( `VBox(
+ UI::OpenDialog (`MinSize( 60, 20, `VBox(
`Heading(sformat(_("Clone partition layout of %1"), device)),
- `Left(`ComboBox(`id(`tdisk), `opt(`notify), _("Target disk:"), ui_items )),
`VSpacing(1),
- `RichText(`id(`summary), _("some sample text")),
+ `MultiSelectionBox(`id(`tdisk), _("Available target disks:"), ui_items ),
+ `VSpacing(1),
`ButtonBox(
`PushButton(`id(`help), Label::HelpButton()),
`PushButton(`id(`ok), `opt(`default), Label::OKButton()),
`PushButton(`id(`cancel), Label::CancelButton())
)
+ )
));
any ret = nil;
@@ -415,23 +435,11 @@
while(ret != `ok && ret != `cancel) {
ret = UI::UserInput();
- any this_disk = UI::QueryWidget(`id(`tdisk), `Value);
- boolean any_disk_selected = this_disk != `none;
- boolean has_any_partitions = any_disk_selected ?
- size(target_map[(string)this_disk, "partitions"]:[]) > 0
- : false;
- if (ret == `tdisk) {
- if ( has_any_partitions &&
- !Popup::YesNo( sformat(_("There are some partitions on %1. If you
-proceed, these partitions will be deleted and
-all data on them will be lost.\n
-Really use this target disk?"), this_disk))) {
- UI::ChangeWidget(`id(`tdisk), `Value, `none);
- continue;
- }
- }
- else if( ret == `ok) {
+ if( ret == `ok) {
+ list <string> selected_disks = (list <string>) UI::QueryWidget(`id(`tdisk), `SelectedItems);
+ boolean any_disk_selected = size(selected_disks) > 0;
+
if (!any_disk_selected) {
Popup::Error(_("Select some target disk for creating a clone"));
UI::SetFocus(`id(`tdisk));
@@ -439,30 +447,66 @@
continue;
}
- map