Author: aschnell
Date: Thu Aug 7 11:18:52 2008
New Revision: 49806
URL: http://svn.opensuse.org/viewcvs/yast?rev=49806&view=rev
Log:
- import mount points button
Modified:
trunk/storage/storage/src/include/ep-hd.ycp
trunk/storage/storage/src/include/ep-lib.ycp
trunk/storage/storage/src/inst_custom_part.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=49806&r1=49805&r2=49806&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-hd.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd.ycp Thu Aug 7 11:18:52 2008
@@ -12,6 +12,7 @@
import "PackageCallbacks";
import "PackageSystem";
import "FileUtils";
+ import "Mode";
import "Stage";
include "partitioning/ep-hd-dialogs.ycp";
@@ -55,7 +56,7 @@
if (Mode::installation()) {
// push button text
- buttons = add(buttons, `PushButton(`id(`fstab), _("Import Mount Points...")));
+ buttons = add(buttons, `PushButton(`id(`import), _("Import Mount Points...")));
}
buttons = add(buttons, `HStretch());
@@ -150,6 +151,13 @@
Really rescan disks?"), nil, nil);
break;
+ case `import:
+ ImportMountPoints();
+ Storage::CreateTargetBackup("expert-partitioner");
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
+ break;
+
case `iscsi:
// popup text
CallConfig(_("Calling iSCSI configuration cancels all current changes.
Modified: trunk/storage/storage/src/include/ep-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lib.ycp?rev=49806&r1=49805&r2=49806&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-lib.ycp Thu Aug 7 11:18:52 2008
@@ -161,4 +161,37 @@
return false;
}
+
+
+ void ImportMountPoints()
+ {
+ map od = (map)Storage::GetOndiskTarget();
+ list<list> fstab = scanAndReadExistingFstab( od );
+ y2milestone( "adapt_mp fstab %1", fstab );
+ list ti = maplist( list e, fstab, ``(AddFstabToData( od, (list<map>)e)[1]:$[]));
+ y2milestone( "adapt_mp ti %1", ti );
+
+ integer idx = FstabAddDialog( ti );
+ if( idx>=0 )
+ {
+ od = (map)Storage::GetOndiskTarget();
+ y2milestone( "adapt_mp use fstab idx %1", idx );
+ ti = AddFstabToData( od, (list<map>)fstab[idx]:[] );
+ Storage::ResetOndiskTarget();
+ foreach( string d, map disk, ti[0]:$[],
+ ``{
+ foreach( map p, disk["partitions"]:[],
+ ``{
+ if( size(p["mount"]:"")>0 && p["enc_type"]:`none!=`none &&
+ !p["tmpcrypt"]:false )
+ {
+ string pwd = DlgCreateCryptFs( p["device"]:"", 1, false, false );
+ if( pwd != nil && size(pwd)>0 )
+ Storage::SetCryptPwd( p["device"]:"", pwd );
+ }
+ });
+ });
+ Storage::SetTargetMap(ti[0]:$[]);
+ }
+ }
}
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=49806&r1=49805&r2=49806&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_custom_part.ycp (original)
+++ trunk/storage/storage/src/inst_custom_part.ycp Thu Aug 7 11:18:52 2008
@@ -76,8 +76,6 @@
boolean button_expert = true; // Should the "EXPERT"-Button be shown in main window
boolean button_delete_parttable = true; // Should the "Delete partition table and disk label"
// -Button be shown in Expert menu
- boolean button_adapt_mp = false; // Should the "Adapt mount points from
- // existing /etc/fstab" -Button be shown in Expert menu
boolean test_mode = Mode::test ();
string boot_mode = "fritz";
@@ -117,17 +115,6 @@
bsd_label = true;
}
- if( Stage::initial () )
- {
- button_adapt_mp = true;
- }
- if( Mode::repair () )
- {
- button_adapt_mp = false;
- }
-
-
- y2debug( "ARCHIT %1", Arch::architecture () );
////////////////////////////////////////////////////////////////////////
@@ -2175,12 +2162,6 @@
add( expert_item_list ,
// menu entry text
`item( `id (`reread), _("&Reread Partition Table")));
- if( button_adapt_mp )
- expert_item_list =
- add( expert_item_list,
- `item( `id (`adapt_mp),
- // menu entry text
- _("&Import Mount Points from Existing /etc/fstab")));
if ( button_delete_parttable )
expert_item_list =
add( expert_item_list,
@@ -2885,43 +2866,6 @@
}
}
- /////////////////////////////////////////////////////////////
- // Adapt mount points from existing /etc/fstab
- /////////////////////////////////////////////////////////////
-
- if (ret == `adapt_mp && Stage::initial() )
- {
- map od = (map)Storage::GetOndiskTarget();
- list<list> fstab = scanAndReadExistingFstab( od );
- y2milestone( "adapt_mp fstab %1", fstab );
- list ti = maplist( list e, fstab,
- ``(AddFstabToData( od, (list<map>)e)[1]:$[]));
- y2milestone( "adapt_mp ti %1", ti );
-
- integer idx = FstabAddDialog( ti );
- if( idx>=0 )
- {
- od = (map)Storage::GetOndiskTarget();
- y2milestone( "adapt_mp use fstab idx %1", idx );
- ti = AddFstabToData( od, (list<map>)fstab[idx]:[] );
- Storage::ResetOndiskTarget();
- foreach( string d, map disk, ti[0]:$[],
- ``{
- foreach( map p, disk["partitions"]:[],
- ``{
- if( size(p["mount"]:"")>0 && p["enc_type"]:`none!=`none &&
- !p["tmpcrypt"]:false )
- {
- string pwd = DlgCreateCryptFs( p["device"]:"", 1, false, false );
- if( pwd != nil && size(pwd)>0 )
- Storage::SetCryptPwd( p["device"]:"", pwd );
- }
- });
- });
- Storage::SetTargetMap( ti[0]:$[] );
- }
- }
-
/////////////////////////////////////////////////////////////
// End of Actions, Now check the returncode
/////////////////////////////////////////////////////////////
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org