Author: aschnell
Date: Thu Jun 26 14:45:42 2008
New Revision: 48546
URL: http://svn.opensuse.org/viewcvs/yast?rev=48546&view=rev
Log:
- added checks
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-dm-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-dm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-dm-lib.ycp?rev=48546&r1=48545&r2=48546&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-dm-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-dm-lib.ycp Thu Jun 26 14:45:42 2008
@@ -10,6 +10,12 @@
void EpEditDmDevice(string device)
{
+ if (device == nil)
+ {
+ Error(_("No DM device selected."));
+ return;
+ }
+
if (DlgEditDmVolume(device))
{
UpdateNavigationTree(nil);
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp?rev=48546&r1=48545&r2=48546&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp Thu Jun 26 14:45:42 2008
@@ -10,6 +10,12 @@
void EpCreatePartitionTable(string disk_device)
{
+ if (disk_device == nil)
+ {
+ Error(_("No hard disk selected."));
+ return;
+ }
+
if (YesNo(sformat(_("Really create new partition table on %1? This will delete all data
on %1 and all RAIDs and Volume Groups using %1."), disk_device)))
{
@@ -64,6 +70,12 @@
*/
void EpCreatePartition(string disk_device)
{
+ if (disk_device == nil)
+ {
+ Error(_("No hard disk selected."));
+ return;
+ }
+
map target_map = Storage::GetTargetMap();
map disk = target_map[disk_device]:$[];
@@ -96,6 +108,12 @@
void EpEditPartition(string device)
{
+ if (device == nil)
+ {
+ Error(_("No partition selected."));
+ return;
+ }
+
if (DlgEditPartition(device))
{
UpdateNavigationTree(nil);
@@ -106,12 +124,24 @@
void EpResizePartition(string device)
{
+ if (device == nil)
+ {
+ Error(_("No partition selected."));
+ return;
+ }
+
DlgResizePartition(device);
}
void EpDeletePartition(string device)
{
+ if (device == nil)
+ {
+ Error(_("No partition selected."));
+ return;
+ }
+
string parent = ParentDevice(device);
if (EpDeleteDevice(device))
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp?rev=48546&r1=48545&r2=48546&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp Thu Jun 26 14:45:42 2008
@@ -25,6 +25,12 @@
void EpResizeVolumeGroup(string device)
{
+ if (device == nil)
+ {
+ Error(_("No volume group selected."));
+ return;
+ }
+
if (DlgResizeVolumeGroup(device))
{
UpdateNavigationTree(nil);
@@ -35,6 +41,12 @@
void EpDeleteVolumeGroup(string device)
{
+ if (device == nil)
+ {
+ Error(_("No volume group selected."));
+ return;
+ }
+
string vgname = substring(device, 5);
map tg = Storage::GetTargetMap();
@@ -65,6 +77,12 @@
void EpCreateLogicalVolume(string device)
{
+ if (device == nil)
+ {
+ Error(_("No logical volume selected."));
+ return;
+ }
+
if (DlgCreateLogicalVolume(device))
{
UpdateNavigationTree(nil);
@@ -75,6 +93,12 @@
void EpEditLogicalVolume(string device)
{
+ if (device == nil)
+ {
+ Error(_("No logical volume selected."));
+ return;
+ }
+
if (DlgEditLogicalVolume(device))
{
UpdateNavigationTree(nil);
@@ -85,12 +109,24 @@
void EpResizeLogicalVolume(string device)
{
+ if (device == nil)
+ {
+ Error(_("No logical volume selected."));
+ return;
+ }
+
DlgResizeLogicalVolumeNew(device);
}
void EpDeleteLogicalVolume(string device)
{
+ if (device == nil)
+ {
+ Error(_("No logical volume selected."));
+ return;
+ }
+
string parent = ParentDevice(device);
if (EpDeleteDevice(device))
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp?rev=48546&r1=48545&r2=48546&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp Thu Jun 26 14:45:42 2008
@@ -25,6 +25,12 @@
void EpEditRaid(string device)
{
+ if (device == nil)
+ {
+ Error(_("No RAID selected."));
+ return;
+ }
+
if (DlgEditRaid(device))
{
UpdateNavigationTree(nil);
@@ -35,6 +41,12 @@
void EpResizeRaid(string device)
{
+ if (device == nil)
+ {
+ Error(_("No RAID selected."));
+ return;
+ }
+
map target_map = Storage::GetTargetMap();
map data = Storage::GetPartition(target_map, device);
@@ -51,6 +63,12 @@
void EpDeleteRaid(string device)
{
+ if (device == nil)
+ {
+ Error(_("No RAID selected."));
+ return;
+ }
+
if (EpDeleteDevice(device))
{
UpdateNavigationTree(`md);
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org