Author: aschnell
Date: Wed Jul 7 17:47:45 2010
New Revision: 62196
URL: http://svn.opensuse.org/viewcvs/yast?rev=62196&view=rev
Log:
- added "Import Partition Setup" button
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/ep-import.ycp
trunk/storage/storage/src/inst_disk_proposal.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=62196&r1=62195&r2=62196&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Wed Jul 7 17:47:45 2010
@@ -2,6 +2,7 @@
Wed Jul 07 12:51:11 CEST 2010 - aschnell@suse.de
- improved layout of dialog for importing mount points
+- added "Import Partition Setup" button
-------------------------------------------------------------------
Mon Jul 05 15:13:18 CEST 2010 - aschnell@suse.de
Modified: trunk/storage/storage/src/include/ep-import.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-import.ycp?rev=62196&r1=62195&r2=62196&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-import.ycp (original)
+++ trunk/storage/storage/src/include/ep-import.ycp Wed Jul 7 17:47:45 2010
@@ -5,13 +5,20 @@
* Authors: Michael Hager
* Johannes Buchhold
* Arvin Schnell
- *
- * This file must only be included in other Expert Partitioner files ("ep-*.ycp").
*/
{
textdomain "storage";
+ import "Directory";
+ import "FileSystems";
+ import "Label";
+ import "Popup";
+ import "Storage";
+ import "StorageFields";
+ import "StorageSettings";
+
+
string MountVar(map var, map root, string rdev, string mp, map target_map)
{
string ret = "";
@@ -213,11 +220,11 @@
{
// help text, richtext format
string helptext = _("<p>YaST2 has scanned your hard disks and found
-one or several old Linux systems with mount points. The old mount points are
-shown in the table.</p>");
+one or several existing Linux systems with mount points. The old mount points
+are shown in the table.</p>");
// help text, richtext format
- helptext = helptext + _("<p>You can choose whether the old system
+ helptext = helptext + _("<p>You can choose whether the existing system
volumes, e.g. / and /usr, will be formatted during the
installation. Non-system volumes, e.g. /home, will not be formatted.</p>");
@@ -263,7 +270,7 @@
`opt(`decorated),
`VBox( `VSpacing(0.45),
// dialog heading
- `Left(`Heading(_("Import Mount Points from old System:"))),
+ `Left(`Heading(_("Import Mount Points from existing System:"))),
`MarginBox(1, 0.5,
`VBox(
`Left(`ReplacePoint(`id(`device), `Empty())),
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=62196&r1=62195&r2=62196&view=diff
==============================================================================
--- trunk/storage/storage/src/inst_disk_proposal.ycp (original)
+++ trunk/storage/storage/src/inst_disk_proposal.ycp Wed Jul 7 17:47:45 2010
@@ -35,10 +35,11 @@
include "partitioning/custom_part_dialogs.ycp";
+ include "partitioning/ep-import.ycp";
-define boolean AskOverwriteChanges()
- ``{
+boolean AskOverwriteChanges()
+ {
boolean ret = true;
string target_is = Storage::GetPartMode();
y2milestone( "AskOverwriteChanges target_is %1", target_is );
@@ -53,9 +54,17 @@
return( ret );
}
-define void execSubscreens( boolean detailed )
- ``{
- y2milestone( "execSubscreens detailed %1", detailed );
+
+void execSubscreens(symbol mode)
+ {
+ y2milestone( "execSubscreens mode:%1", mode );
+
+ if (Mode::autoinst())
+ {
+ Storage::SetPartMode("PROP_MODIFY");
+ }
+ else
+ {
map aliases =
$[ "disk" :
``(WFM::CallFunction("inst_disk", [true, true])),
@@ -66,15 +75,15 @@
"resize_ui" :
``(WFM::CallFunction("inst_resize_ui", [true, true])),
];
+
map seq = $[];
seq["disk"] = $[ `abort : `abort, `cancel: `cancel, `next: `next ];
- if (Mode::autoinst())
- {
- Storage::SetPartMode("PROP_MODIFY");
- seq["ws_start"] = "disk";
- }
- else
- {
+
+ switch (mode)
+ {
+ case `modify:
+ case `detailed:
+ {
y2milestone( "ProposalActive %1 ProposalMode %2 PartMode %3",
Storage::GetPartProposalActive(),
Storage::GetPartProposalMode(), Storage::GetPartMode() );
@@ -90,7 +99,7 @@
}
seq["disk"] = $[ `abort : `abort, `cancel: `cancel, `next : `next ];
y2milestone( "execSubscreens GetPartMode %1", Storage::GetPartMode() );
- if( detailed && Storage::GetPartMode()!="CUSTOM" )
+ if( mode == `detailed && Storage::GetPartMode()!="CUSTOM" )
seq["ws_start"] = "target_sel";
else
seq["ws_start"] = "disk";
@@ -100,7 +109,17 @@
Wizard::OpenNextBackDialog();
symbol result = Sequencer::Run(aliases, seq);
Wizard::CloseDialog();
- Storage::HandleProposalPackages();
+ }
+ break;
+
+ case `import:
+ {
+ ImportMountPoints();
+ }
+ break;
+ }
+
+ Storage::HandleProposalPackages();
}
}
@@ -121,6 +140,8 @@
// Radiobutton for partition dialog
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");
@@ -178,11 +199,12 @@
);
term bframe =
- `HBox(
+ `VBox(
`PushButton( `id(`detailed), detailed_str ),
- `HSpacing(5),
- `PushButton( `id(`modify), modify_str ),
- `HSpacing(5)
+ `VSpacing(0.45),
+ `PushButton( `id(`import), import_str ),
+ `VSpacing(0.45),
+ `PushButton( `id(`modify), modify_str )
);
@@ -192,10 +214,10 @@
`HBox(
`HSpacing(2),
`VBox(
- `MinHeight( 7, `RichText( `id("richtext"), changes )),
+ `MinHeight(8, `RichText(`id(`richtext), changes)),
`VSpacing(1),
`RadioButtonGroup( `id("prop_mode"), rframe ),
- `VSpacing(4),
+ `VSpacing(2),
bframe,
`VStretch()
),
@@ -219,6 +241,14 @@
"), deletechars(modify_str,"&"));
// help text continued
+// %1 is replaced by button text
+help_text = help_text + sformat(_("<p>
+To import the mount points from an existing Linux
+system choose <b>%1</b>. You can still make modification
+afterwards in the expert partitioner dialog.</p>
+"), deletechars(import_str, "&"));
+
+// help text continued
help_text = help_text + sformat(_("<p>
If the suggestion does not fit your needs, create
your own partition setup starting with the partitions as
@@ -317,14 +347,14 @@
Storage::SetPartMode( target_is );
Storage::SetTargetMap( targetMap );
changes = Storage::ChangeText();
- UI::ChangeWidget( `id("richtext"), `Value, changes );
+ UI::ChangeWidget(`id(`richtext), `Value, changes);
}
else
{
UI::ChangeWidget( `id("prop_mode"), `CurrentButton, old_mode );
}
}
- else if (contains([ `modify, `detailed ], ret))
+ else if (contains([ `modify, `detailed, `import ], ret))
{
Storage::SetPartProposalFirst( false );
Storage::SetPartProposalActive( false );
@@ -352,12 +382,19 @@
Storage::SetPartProposalMode( "detailed" );
}
break;
+
+ case `import:
+ {
+ target_is = "PROP_MODIFY";
+ Storage::SetPartProposalMode("modify");
+ }
+ break;
}
Storage::SetPartMode( target_is );
- execSubscreens( ret==`detailed );
+ execSubscreens( ret );
changes = Storage::ChangeText();
- UI::ChangeWidget( `id("richtext"), `Value, changes );
+ UI::ChangeWidget(`id(`richtext), `Value, changes);
if( ret==`detailed )
{
UI::ChangeWidget(`id(`part), `Value, !StorageProposal::GetProposalLvm());
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org