[yast-commit] r48520 - in /branches/tmp/aschnell/part-redesign/storage/src/include: ep-dialogs.ycp ep-hd-lib.ycp ep-hd.ycp ep-lib.ycp ep-lvm-lib.ycp
Author: aschnell Date: Wed Jun 25 10:27:34 2008 New Revision: 48520 URL: http://svn.opensuse.org/viewcvs/yast?rev=48520&view=rev Log: - work on delete functions Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-lib.ycp branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp Wed Jun 25 10:27:34 2008 @@ -8,6 +8,11 @@ textdomain "storage"; + boolean YesNo(string text) + { + return Popup::YesNo(String::WrapAt(text, 50, "")); + } + void Error(string text) { Popup::Error(String::WrapAt(text, 50, "")); 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/sto... ============================================================================== --- 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 Wed Jun 25 10:27:34 2008 @@ -8,6 +8,19 @@ textdomain "storage"; + void EpCreatePartitionTable(string disk_device) + { + 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))) + { + map<string, map> target_map = Storage::GetTargetMap(); + Storage::DeletePartitionTable(disk_device, target_map[disk_device, "size_k"]:0); + UpdateNavigationTree(nil); + TreePanel::Create(); + } + } + + map GetPossibleSlots(map disk, string disk_device) { list<map> slots = []; Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp Wed Jun 25 10:27:34 2008 @@ -239,9 +239,9 @@ list<term> table_contents = StorageFields::TableContents(fields, target_map, Predicate); list<term> expert_cmds = [ - `item(`id(`delete_parttable), + `item(`id(`create_partition_table), // menu entry text - _("Delete Partition &Table and Disk Label")) + _("Create New Partition Table")) ]; if (Arch::s390()) @@ -291,6 +291,14 @@ case `delete: EpDeletePartition(part_device); break; + + case `create_partition_table: + EpCreatePartitionTable(disk_device); + break; + + case `dasdfmt: + // TODO + break; } } Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/sto... ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lib.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lib.ycp Wed Jun 25 10:27:34 2008 @@ -3,7 +3,6 @@ * Package: yast2-storage * Summary: Expert Partitioner * Authors: Arvin Schnell <aschnell@suse.de> - * */ { textdomain "storage"; @@ -47,12 +46,14 @@ { if( deleteAllDevPartitions( disk, Stage::initial(), bsd_label )) Storage::DeleteDmraid( id ); + return true; } } // YesNo popup text %1 is replaced by a disk name e.g. /dev/hda else if( Popup::YesNo( sformat(_("Really delete all partitions on %1?"), id ))) { deleteAllDevPartitions( disk, Stage::initial(), bsd_label ); + return true; } } else if( part["type"]:`unknown==`lvm ) @@ -62,7 +63,10 @@ return false; } else + { HandleRemoveLv( tg, id ); + return true; + } } else { 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/sto... ============================================================================== --- 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 Wed Jun 25 10:27:34 2008 @@ -23,11 +23,11 @@ } } - + void EpDeleteVolumeGroup(string device) { string vgname = substring(device, 5); - + map<string,map> tg = Storage::GetTargetMap(); integer count = size(get_lv_names(tg, vgname)); @@ -42,12 +42,11 @@ else { // popup text - if (Popup::ContinueCancel(sformat(_("Really remove the volume group \"%1\"?"), vgname))) + if (Popup::YesNo(sformat(_("Really delete the volume group \"%1\"?"), vgname))) { if (Storage::DeleteLvmVg(vgname)) - { - // TODO: update tree (with focus) - UpdateNavigationTree(nil); + { + UpdateNavigationTree(`lvm); TreePanel::Create(); } } @@ -74,7 +73,7 @@ } } - + void EpResizeLogicalVolume(string device) { DlgResizeLogicalVolumeNew(device); @@ -83,5 +82,10 @@ void EpDeleteLogicalVolume(string device) { - } + if (EpDeleteDevice(device)) + { + UpdateNavigationTree(`lvm); // TODO + TreePanel::Create(); + } + } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org