Author: aschnell
Date: Thu Aug 7 11:59:00 2008
New Revision: 49810
URL: http://svn.opensuse.org/viewcvs/yast?rev=49810&view=rev
Log:
- removed obsolete code
Modified:
trunk/storage/storage/src/inst_custom_part.ycp
Modified: trunk/storage/storage/src/inst_custom_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_custom_part.ycp?rev=49810&r1=49809&r2=49810&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_custom_part.ycp (original)
+++ trunk/storage/storage/src/inst_custom_part.ycp Thu Aug 7 11:59:00 2008
@@ -81,46 +81,6 @@
string boot_mode = "fritz";
string focusline = "";
- string last_sel_disk = "";
-
-
-
-
- ////////////////////////////////////////////////
- // Testmode, should be commented in release
- // test_mode = true;
- // test_mode = false;
- // Arch::architecture () = "ppc";
- // Arch::architecture () = "axp";
- ////////////////////////////////////////////////
-
- if( Arch::ppc () )
- {
- bsd_label = false;
- }
-
- if( Arch::s390 () )
- {
- button_resize = false;
- button_loop = false;
- }
-
- if( Arch::alpha () )
- {
- bsd_label = (boot_mode == "aboot");
- }
-
- if( Arch::sparc () )
- {
- bsd_label = true;
- }
-
-
-
- ////////////////////////////////////////////////////////////////////////
- // DEFINES //
- ////////////////////////////////////////////////////////////////////////
-
/*---------------------------------------------------------------------
@@ -1824,108 +1784,6 @@
disk["used_by_type"]:`UB_NONE==`UB_NONE );
}
-define string ChooseDisk( map targetMap, string heading, symbol what )
- ``{
- // Header Choose disk dialog
- term diskgroup = `VBox();
- list<string> disks = [];
- integer n = 0;
- string txt = "";
-
- y2milestone( "ChooseDisk last_sel_disk:%1 what:%2", last_sel_disk, what );
-
- disks = maplist( string dv, map ds,
- filter( string dev, map disk, targetMap,
- ``(SelDisk(what,disk))),
- ``(dv));
- y2milestone( "ChooseDisk disks:%1", disks );
- disks = (list<string>)
- merge( filter( string d, disks, ``(search(d,"/dev/mapper/")==0)),
- filter( string d, disks, ``(search(d,"/dev/mapper/")!=0)) );
- y2milestone( "ChooseDisk disks:%1", disks );
- foreach( string dev, disks,
- ``{
- txt = sformat( "&%1: %2", n+1, dev );
- diskgroup = add( diskgroup, `Left( `RadioButton( `id(dev), txt,
- dev==last_sel_disk )));
- n = n + 1;
- });
- if( size(disks)>10 )
- {
- diskgroup = `VBox( `SelectionBox( `id(`disklist), _("Available &Disks"),
- disks ));
- }
- else
- {
- diskgroup = `RadioButtonGroup( `id(`choosedisk), diskgroup );
- }
-
- if( size(disks) > 1 )
- {
- UI::OpenDialog( `opt(`decorated), `VBox(`Heading( heading ),
- `VSpacing(0.5),
- diskgroup,
- `VSpacing(0.5),
- `HBox(
- // popup edit existing partition: OK
- `PushButton(`id(`ok), `opt(`default), Label::OKButton() ),
- // popup edit existing partition: Cancel
- `PushButton(`id(`cancel), Label::CancelButton() )
- )
- )
- );
- if( UI::WidgetExists( `id(`disklist) ))
- {
- UI::ChangeWidget( `id(`disklist), `CurrentItem, last_sel_disk );
- }
- symbol ret = (symbol)UI::UserInput();
-
- if( ret == `cancel)
- {
- UI::CloseDialog();
- return( nil );
- }
- else
- {
- string r = "";
- y2milestone( "ChooseDisk exits %1", UI::WidgetExists( `id(`disklist)) );
- if( !UI::WidgetExists( `id(`disklist) ))
- {
- r = (string)UI::QueryWidget(`id(`choosedisk), `CurrentButton);
- }
- else
- {
- r = (string)UI::QueryWidget(`id(`disklist), `CurrentItem);
- }
- y2milestone( "ChooseDisk r %1", r );
- UI::CloseDialog();
- n=0;
- if( what==`create && targetMap[r,"readonly"]:false )
- {
- Popup::Error( Partitions::RdonlyText( r, true ));
- return( nil );
- }
- last_sel_disk = r;
- y2milestone( "ChooseDisk last_sel_disk:%1", last_sel_disk );
- return(r);
- }
- }
- else if( size(disks) == 1 )
- {
- // if there is only one disk: no
- return( disks[0]:"" );
- }
- else if( size(disks) == 0 )
- {
- string txt = _("There are no partitionable disks available.");
- if( Arch::s390() )
- {
- txt = txt + "\n" + _("You may use dasdfmt in Expert-Button to low level format disks.");
- }
- Popup::Error( txt );
- return( "" );
- }
- };
define term RaidButton( integer num )
``{
@@ -2284,251 +2142,6 @@
}
- /////////////////////////////////////////////////////////////
- //// CREATE
- /////////////////////////////////////////////////////////////
- else if( ret == `create)
- {
- string ddev = ChooseDisk( tg,
- // popup text
- _("Disk to Partition"),
- `create );
-
- if( ddev == nil || size(ddev)==0 )
- {
- ret = `again;
- continue;
- }
-
- symbol create_type = `none;
- map disk = tg[ddev]:$[];
-
- list possibilities = CheckCreatePossibilities( ddev, disk );
- y2milestone( "possibilities %1", possibilities );
-
- boolean primary_is_possible = possibilities[0]:false;
- boolean extended_is_possible = possibilities[1]:false;
- boolean logical_is_possible = possibilities[2]:false;
-
- symbol no_primary_cause = possibilities[3]:`no_space;
- symbol no_extended_cause = possibilities[4]:`no_space;
- symbol no_logical_cause = possibilities[5]:`no_space;
-
- list log_slot = [];
- list p_e_slot = [];
-
- //////////////////////////////////////////////////////////
- // Test if there is space left on the device
- log_slot = GetLogicalSlot(ddev, disk);
- y2milestone( "log_slot %1", log_slot );
- p_e_slot = GetSlot(ddev, disk);
- y2milestone( "p_e_slot %1", p_e_slot );
-
- if ((log_slot == nil) && logical_is_possible )
- no_logical_cause = `no_space;
- if ((p_e_slot == nil) && primary_is_possible )
- no_primary_cause = `no_space;
- if ((p_e_slot == nil) && extended_is_possible)
- no_extended_cause = `no_space;
-
- if (log_slot == nil)
- logical_is_possible = false;
- if (p_e_slot == nil)
- primary_is_possible = false;
- if (p_e_slot == nil)
- extended_is_possible = false;
-
-
-
- /*----------------------------------------------------------------------
- * Intel/Fdisk PPC/Fdisk
- *
- * At the same time is not possible, that both "logial_part_is_possible"
- * and "extended_part_is_possible" are true
- * so we have 6 possible situations
- *
- * to show this we use
- * "P" for primary_part_is_possible
- * "E" for extended_part_is_possible
- * "L" for logial_part_is_possible
- *
- * "p" for primary_part_is_possible == false
- * "e" for extended_part_is_possible == false
- * "l" for logial_part_is_possible == false
- *
- *
- * PE : I can create a primary or exended part.
- * PL : Extended part. exist. I can create a primary or a logical
- * Pel : only a priary is possible, when the extended part. has no space left
- *
- * pE : Not possible, if "E" is possible always "P" is possible too.
- * pL : only a logical is possible, if together 4 primary and extended
- * partitions are already created
- * pel : no partitions are possible
- *
- * --------------------------------------------------------------------
- *
- * BSD-Labeling:
- * "Pel" for primary_part_is_possible
- * "pel" for primary_part_is_possible == false
- *
- *--------------------------------------------------------------------------*/
-
- if( !primary_is_possible && !extended_is_possible &&
- !logical_is_possible )
- {
- // ------pel--------
- string text = "";
-
- if( disk["label"]:"msdos" != "msdos" )
- {
- // popup text , %1 is replaced by a disk name e.g. /dev/hda
- text = sformat( _("It is not possible to create a partition on %1."), ddev);
- }
- else
- {
- // popup text , %1 is replaced by a disk name e.g. /dev/hda
- // %2 is replaced by an explanation
- text = sformat( _("It is not possible to create a partition on %1.
-
-%2
-"), ddev,
- FormatYouCannotCause( primary_is_possible,
- extended_is_possible,
- logical_is_possible,
- no_primary_cause,
- no_extended_cause,
- no_logical_cause ));
- }
- Popup::Warning(text);
- }
- else if( !primary_is_possible && logical_is_possible )
- {
- //------pL----------
- create_type = `logical;
- }
- else if( !primary_is_possible && extended_is_possible )
- {
- //------pE----------
- create_type = `extended;
- }
- else if( primary_is_possible && !extended_is_possible &&
- !logical_is_possible )
- {
- //------Pel----------
- create_type = `primary;
- }
- else if ( primary_is_possible && extended_is_possible )
- {
- //------PE----------
- create_type = ChoosePart("PE"); // ddev
- }
- else if ( primary_is_possible && logical_is_possible )
- {
- //------PL----------
- create_type = ChoosePart("PL"); // popup
- }
- else
- {
- y2error("Error during partition check" );
- create_type = ChoosePart("PEL"); // popup
- }
-
- if( create_type != `none )
- {
- list slot = (create_type!=`logical)?p_e_slot:log_slot;
- y2milestone( "slot:%1", slot );
- map r = Storage::NextPartition( disk["device"]:"",
- create_type );
- integer curr_nr = r["nr"]:0;
-
- //---------------------------------------------------
- // Present the Create-Popups ...
- //---------------------------------------------------
-
- string titleC = "";
- // Popup Create Partition: Description of partition %1 is for example "/dev/hda"
- if ( create_type == `primary ) titleC = sformat( _(" Create a Primary Partition on %1 "), ddev );
- // Popup Create Partition: Description of partition %1 is for example "/dev/hda"
- if ( create_type == `extended ) titleC = sformat( _(" Create an Extended Partition on %1 "), ddev );
- // Popup Create Partition: Description of partition %1 is for example "/dev/hda"
- if ( create_type == `logical ) titleC = sformat( _(" Create a Logical Partition on %1 "), ddev );
-
- map new_val =
- $[
- "create" : true,
- "region" : [ slot[0]:0, slot[1]:0 - slot[0]:0+1 ],
- "type" : create_type,
- "nr" : curr_nr,
- "device" : r["device"]:""
- ];
-
-
- if( create_type == `extended )
- {
- new_val = (map)union( new_val ,
- $[
- "fsid" : Partitions::fsid_extended_win,
- "used_fs" : `unknown,
- ]);
-
- new_val =
- (map)CreateEditExtendedPartDlg( new_val,
- titleC,
- ddev,
- disk,
- disk["cyl_size"]:1000000,
- false,
- bsd_label );
- }
- else
- {
- string mount_point_proposal =
- GetMountPointProposal( Storage::GetTargetMap(), [] );
- symbol used_fs = Partitions::DefaultFs();
- if( mount_point_proposal == Partitions::BootMount() )
- {
- used_fs = Partitions::DefaultBootFs();
- }
- new_val =
- (map)union( new_val,
- $[
- "format" : true,
- "fsid" : Partitions::fsid_native,
- "mount" : mount_point_proposal,
- "used_fs": used_fs,
- ]);
-
- if( Mode::repair() )
- {
- new_val["format"] = false;
- new_val["mount" ] = "";
- }
-
- new_val = EditOrCreatePartDlg( new_val,
- FileSystems::GetAllFileSystems(true, true ),
- titleC, disk,
- bsd_label, edit_cylinder,
- disk["cyl_size"]:1000000,
- Stage::initial() );
- }
-
- if (new_val != nil)
- {
- // set focus to new partition
- focusline = new_val["device"]:"";
- symbol mby = new_val["mountby"]:Storage::GetMountBy(new_val["device"]:"");
- Storage::CreatePartition( disk["device"]:"",
- new_val["device"]:"",
- new_val["type"]:`primary,
- new_val["fsid"]:Partitions::fsid_native,
- new_val["region",0]:0,
- new_val["region",1]:0, mby );
- Storage::ChangeVolumeProperties( new_val );
- }
- }
- }
-
///////////////////////////////////////////////////////////////
//// EDIT
///////////////////////////////////////////////////////////////
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org