Author: aschnell
Date: Mon Jan 4 15:51:00 2010
New Revision: 60220
URL: http://svn.opensuse.org/viewcvs/yast?rev=60220&view=rev
Log:
- use SplitDevice function
Modified:
trunk/storage/storage/src/include/ep-hd.ycp
Modified: trunk/storage/storage/src/include/ep-hd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd.ycp?rev=60220&r1=60219&r2=60220&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-hd.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd.ycp Mon Jan 4 15:51:00 2010
@@ -53,6 +53,7 @@
}
}
+
term HdButtonBox()
{
return `HBox(
@@ -65,37 +66,48 @@
);
}
+
void HandleHdButtons( any user_data, string device, map event )
{
- string disk = "";
+ string disk_device = "";
boolean is_disk = false;
if (user_data == nil)
{
- map dev = Storage::GetDiskPartition( device );
- disk = (string) dev["disk"]:nil;
- // FIXME: is this necessary & sufficient condition?
- is_disk = dev["nr"]:nil == "";
+ map disk = nil;
+ map part = nil;
+
+ map target_map = Storage::GetTargetMap();
+ SplitDevice(target_map, device, disk, part);
+ disk_device = (string) disk["device"]:"";
+ is_disk = part == nil;
}
else
{
- disk = (string) user_data;
+ disk_device = (string) user_data;
}
switch (Event::IsWidgetActivated(event))
{
case `add:
- EpCreatePartition( disk );
+ if (is_disk)
+ EpCreatePartition(disk_device);
+ else
+ // error popup
+ Popup::Error(_("Select a hard disks, BIOS RAIDs or multipath
+devices to add a partition."));
break;
+
case `edit:
- if ( is_disk )
- TreePanel::SwitchToNew( disk );
+ if (is_disk)
+ TreePanel::SwitchToNew( disk_device );
else
EpEditPartition( device );
break;
case `resize:
- if ( is_disk )
+ if (is_disk)
+ // error popup
Popup::Error(_("Hard disks, BIOS RAIDs and multipath
devices cannot be resized."));
else
@@ -103,14 +115,15 @@
break;
case `delete:
- if ( is_disk )
- EpDeleteDisk( device );
+ if (is_disk)
+ EpDeleteDisk(disk_device);
else
EpDeletePartition ( device, UI::WidgetExists(`id(`table)) ? `table : `overview );
break;
}
}
+
void CreateHdMainPanel(any user_data)
{
symbol Predicate(map disk, map partition)
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org