Author: fehr
Date: Thu Feb 17 15:49:12 2011
New Revision: 63439
URL: http://svn.opensuse.org/viewcvs/yast?rev=63439&view=rev
Log:
add option to demand and proposal using btrfs as default filesystem
Added:
trunk/storage/storage/src/testsuite/.cvsignore
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/custom_part_dialogs.ycp
trunk/storage/storage/src/inst_disk_proposal.ycp
trunk/storage/storage/src/inst_target_part.ycp
trunk/storage/storage/src/modules/Partitions.ycp
trunk/storage/storage/src/modules/StorageProposal.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=63439&r1=63438&r2=63439&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Feb 17 15:49:12 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Feb 17 15:47:57 CET 2011 - fehr@suse.de
+
+- add option to demand and proposal using btrfs as default
+ filesystem
+
+-------------------------------------------------------------------
Wed Jan 26 16:03:35 CET 2011 - fehr@suse.de
- add button to trigger query for crypt password (bnc #666883)
Modified: trunk/storage/storage/src/include/custom_part_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_dialogs.ycp?rev=63439&r1=63438&r2=63439&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Thu Feb 17 15:49:12 2011
@@ -70,74 +70,6 @@
}
- boolean QueryProposalPassword()
- {
- if (!isempty(StorageProposal::GetProposalPassword()))
- return true;
-
- UI::OpenDialog(`VBox(
- `Label(_("Enter your password for the proposal encryption.")),
- `MinWidth(40,
- `Password(`id(`pw1),
- // Label: get password for user root
- // Please use newline if label is longer than 40 characters
- _("Password:"), "")),
- `VSpacing(0.5),
- `MinWidth(40,
- `Password(`id(`pw2),
- // Label: get same password again for verification
- // Please use newline if label is longer than 40 characters
- _("Reenter the password for verification:"), "")),
- `Label(_("Don't forget what you enter here!")),
- `ButtonBox(
- `PushButton(`id(`ok), `opt(`default), Label::OKButton()),
- `PushButton(`id(`cancel), Label::CancelButton())
- )
- ));
-
- string password = "";
- symbol widget = nil;
-
- repeat
- {
- // Clear password fields on every round.
- UI::ChangeWidget(`id(`pw1), `Value, "");
- UI::ChangeWidget(`id(`pw2), `Value, "");
-
- UI::SetFocus(`id(`pw1));
-
- widget = (symbol) UI::UserInput();
-
- switch (widget)
- {
- case `ok:
-
- password = (string) UI::QueryWidget(`id(`pw1), `Value);
- string tmp = (string) UI::QueryWidget(`id(`pw2), `Value);
-
- if (!Storage::CheckEncryptionPasswords(password, tmp, 8, false))
- widget = `again;
-
- break;
- }
-
- } until (widget == `cancel || widget == `ok);
-
- UI::CloseDialog();
-
- if (widget == `ok)
- {
- StorageProposal::SetProposalPassword(password);
- return true;
- }
- else
- {
- return false;
- }
-
- }
-
-
//////////////////////////////////////////////////////////////////////////////
// Dialog Password for Crypted FS Update
//////////////////////////////////////////////////////////////////////////////
Modified: trunk/storage/storage/src/inst_disk_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_disk_proposal.ycp?rev=63439&r1=63438&r2=63439&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_disk_proposal.ycp (original)
+++ trunk/storage/storage/src/inst_disk_proposal.ycp Thu Feb 17 15:49:12 2011
@@ -141,12 +141,6 @@
string detailed_str = _("&Create Partition Setup...");
// Radiobutton for partition dialog
string import_str = _("&Import Partition Setup...");
-// Radiobutton for partition dialog
-string part_str = _("&Partition Based");
-// Radiobutton for partition dialog
-string lvm_str = _("&LVM Based");
-// Checkbox for partition dialog
-string encrypt_str = _("Encrypt Volume Group");
string target_is = "";
@@ -185,18 +179,10 @@
y2milestone( "current proposal: %1", changes );
-term rframe =
- `HBox(
- `HSpacing(3),
- `Top(`MinWidth(20, `Left(`RadioButton(`id(`part), `opt(`notify), part_str,
- !StorageProposal::GetProposalLvm())))),
- `HSpacing(3),
- `Top(`MinWidth(20, `VBox(`Left(`RadioButton(`id(`lvm), `opt(`notify), lvm_str,
- StorageProposal::GetProposalLvm())),
- `Left(`HBox(`HSpacing(4), `CheckBox(`id(`encrypt), `opt(`notify), encrypt_str,
- StorageProposal::GetProposalEncrypt())))))),
- `HSpacing(3)
- );
+term rframe =
+ `HBox( `HSpacing(20),
+ StorageProposal::AddCommonWidgets(),
+ `HSpacing(3) );
term bframe =
`VBox(
@@ -215,8 +201,7 @@
`HSpacing(2),
`VBox(
`MinHeight(8, `RichText(`id(`richtext), changes)),
- `VSpacing(1),
- `RadioButtonGroup( `id("prop_mode"), rframe ),
+ rframe,
`VSpacing(2),
bframe,
`VStretch()
@@ -282,8 +267,7 @@
repeat
{
- symbol old_mode = (symbol) UI::QueryWidget(`id("prop_mode"), `CurrentButton);
- y2milestone( "old_mode %1", old_mode );
+ boolean val = false;
Wizard::SetFocusToNextButton();
ret = (symbol)Wizard::UserInput();
y2milestone( "USERINPUT %1", ret );
@@ -291,45 +275,13 @@
if( ret == `abort && Popup::ReallyAbort(true) )
return `abort;
- if( contains( [ `lvm, `part, `encrypt ], ret ) )
+ if( contains( [ `lvm, `home, `btrfs, `encrypt ], ret ) )
{
+ val = (boolean) UI::QueryWidget(`id(ret), `Value);
if( AskOverwriteChanges() )
{
target_is = "SUGGESTION";
-
- switch (ret)
- {
- case `part:
- StorageProposal::SetProposalLvm(false);
- UI::ChangeWidget(`id(`encrypt), `Enabled, false);
- break;
-
- case `lvm:
- StorageProposal::SetProposalLvm(true);
- UI::ChangeWidget(`id(`encrypt), `Enabled, true);
- break;
-
- case `encrypt:
-
- if ((boolean) UI::QueryWidget(`id(`encrypt), `Value))
- {
- if (QueryProposalPassword())
- {
- StorageProposal::SetProposalEncrypt(true);
- }
- else
- {
- UI::ChangeWidget(`id(`encrypt), `Value, false);
- continue;
- }
- }
- else
- {
- StorageProposal::SetProposalEncrypt(false);
- }
- break;
- }
-
+ StorageProposal::HandleCommonWidgets( ret );
Storage::ResetOndiskTarget();
Storage::AddMountPointsForWin(Storage::GetTargetMap());
map prop = StorageProposal::get_inst_prop(Storage::GetTargetMap());
@@ -350,9 +302,7 @@
UI::ChangeWidget(`id(`richtext), `Value, changes);
}
else
- {
- UI::ChangeWidget( `id("prop_mode"), `CurrentButton, old_mode );
- }
+ UI::ChangeWidget(`id(ret), `Value, !val);
}
else if (contains([ `modify, `detailed, `import ], ret))
{
@@ -395,13 +345,15 @@
execSubscreens( ret );
changes = Storage::ChangeText();
UI::ChangeWidget(`id(`richtext), `Value, changes);
- if( ret==`detailed )
- {
- UI::ChangeWidget(`id(`part), `Value, !StorageProposal::GetProposalLvm());
- UI::ChangeWidget(`id(`lvm), `Value, StorageProposal::GetProposalLvm());
- UI::ChangeWidget(`id(`encrypt), `Enabled, StorageProposal::GetProposalLvm());
- UI::ChangeWidget(`id(`encrypt), `Value, StorageProposal::GetProposalEncrypt());
- }
+ val = StorageProposal::GetProposalLvm();
+ UI::ChangeWidget(`id(`lvm), `Value, val );
+ UI::ChangeWidget(`id(`encrypt), `Enabled, val );
+ UI::ChangeWidget( `id(`encrypt), `Value,
+ val && StorageProposal::GetProposalEncrypt() );
+ UI::ChangeWidget(`id(`home), `Value,
+ StorageProposal::GetProposalHome() );
+ UI::ChangeWidget(`id(`btrfs), `Value,
+ StorageProposal::GetProposalBtrfs() );
}
} until ( ret == `next || ret == `back || ret == `cancel );
Modified: trunk/storage/storage/src/inst_target_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_target_part.ycp?rev=63439&r1=63438&r2=63439&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_target_part.ycp (original)
+++ trunk/storage/storage/src/inst_target_part.ycp Thu Feb 17 15:49:12 2011
@@ -17,6 +17,7 @@
import "Mode";
import "Popup";
import "Storage";
+ import "StorageProposal";
import "Partitions";
import "Product";
import "Label";
@@ -160,7 +161,7 @@
// this is the resize case
//
vbox = create_resize_dialog (partitions, target["cyl_size"]:1 );
- vbox = add_common_widgets( vbox );
+ vbox = add( vbox, StorageProposal::AddCommonWidgets());
y2milestone ("can resize !");
}
else
@@ -170,7 +171,7 @@
map tmp = construct_partition_dialog( partitions,
target["label"]:"",
target["cyl_size"]:1 );
- vbox = add_common_widgets( tmp["term"]:`Empty() );
+ vbox = add( tmp["term"]:`VBox(), StorageProposal::AddCommonWidgets());
}
}
@@ -179,7 +180,7 @@
else
{
vbox = create_whole_disk_dialog();
- vbox = add_common_widgets( vbox );
+ vbox = add( vbox, StorageProposal::AddCommonWidgets());
}
// Since resize case and normal case have different help texts we need
@@ -220,18 +221,10 @@
{
break;
}
- else if (ret == `lvm)
- {
- UI::ChangeWidget(`id(`encrypt), `Enabled, (boolean) UI::QueryWidget(`id(`lvm), `Value));
- }
- else if (ret == `encrypt)
- {
- if ((boolean) UI::QueryWidget(`id(`encrypt), `Value))
+ else if( contains( [ `lvm, `home, `btrfs, `encrypt ], ret ) )
{
- if (!QueryProposalPassword())
- UI::ChangeWidget(`id(`encrypt), `Value, false);
- }
- }
+ StorageProposal::HandleCommonWidgets(ret);
+ }
else if (ret == `full)
{
// Set all checkboxes
@@ -396,12 +389,7 @@
y2milestone ("partitions '%1'", partitions);
- StorageProposal::SetProposalHome( (boolean)UI::QueryWidget( `id(`home), `Value ));
- StorageProposal::SetProposalLvm((boolean) UI::QueryWidget(`id(`lvm), `Value));
- StorageProposal::SetProposalEncrypt((boolean) UI::QueryWidget(`id(`encrypt), `Value));
-
ok = create_partitions( targetMap, target, partitions );
- StorageProposal::SetProposalDefault(true);
if( !ok )
{
string reason = _("Too few partitions are marked for removal
Modified: trunk/storage/storage/src/modules/Partitions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Partitions.ycp?rev=63439&r1=63438&r2=63439&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Partitions.ycp (original)
+++ trunk/storage/storage/src/modules/Partitions.ycp Thu Feb 17 15:49:12 2011
@@ -131,7 +131,11 @@
{
if (default_boot_fs == `unknown)
{
- default_boot_fs = DefaultFs();
+
+ if( DefaultFs()!=`btrfs )
+ default_boot_fs = DefaultFs();
+ else
+ default_boot_fs = `ext4;
if (EfiBoot())
{
default_boot_fs = `vfat;
Modified: trunk/storage/storage/src/modules/StorageProposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageProposal.ycp?rev=63439&r1=63438&r2=63439&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageProposal.ycp (original)
+++ trunk/storage/storage/src/modules/StorageProposal.ycp Thu Feb 17 15:49:12 2011
@@ -19,6 +19,7 @@
import "FileSystems";
import "Partitions";
+ import "Label";
import "Storage";
import "ProductFeatures";
import "Arch";
@@ -49,6 +50,7 @@
boolean proposal_home = false;
boolean proposal_lvm = false;
boolean proposal_encrypt = false;
+ boolean proposal_btrfs = false;
string proposal_password = "";
map