Mailinglist Archive: yast-commit (590 mails)

< Previous Next >
[yast-commit] r61711 - in /trunk/storage: package/yast2-storage.changes storage/src/include/custom_part_dialogs.ycp storage/src/include/custom_part_lib.ycp storage/src/include/ep-lib.ycp
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Thu, 15 Apr 2010 10:32:38 -0000
  • Message-id: <E1O2MNC-0002mq-S4@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Thu Apr 15 12:32:38 2010
New Revision: 61711

URL: http://svn.opensuse.org/viewcvs/yast?rev=61711&view=rev
Log:
- improved layout of dialog for importing mount points
- allow to format system volumes in dialog for importing mount points

Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/custom_part_dialogs.ycp
trunk/storage/storage/src/include/custom_part_lib.ycp
trunk/storage/storage/src/include/ep-lib.ycp

Modified: trunk/storage/package/yast2-storage.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=61711&r1=61710&r2=61711&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Apr 15 12:32:38 2010
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Apr 15 12:04:37 CEST 2010 - aschnell@xxxxxxx
+
+- improved layout of dialog for importing mount points
+
+-------------------------------------------------------------------
Fri Apr 09 10:08:21 CEST 2010 - aschnell@xxxxxxx

- added requires for Perl (bnc #595024)

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=61711&r1=61710&r2=61711&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Thu Apr 15
12:32:38 2010
@@ -1161,8 +1161,8 @@
* @return targetMap new or unmodified targetMap
*---------------------------------------------------------------------
*/
-define integer FstabAddDialog( list table_input )
- ``{
+integer FstabAddDialog(list table_input, boolean& format_sys)
+ {
y2milestone( "FstabAddDialog start %1", table_input );
if( table_input == [] || table_input == nil )
{
@@ -1184,9 +1184,7 @@
_("<P>To ignore these mount points, <BR> press <B>No</B>.</P>");

UI::OpenDialog(
- `opt(`decorated ),
- `HBox(
- `VBox( `HSpacing(20), `RichText(help_text)),
+ `opt(`decorated),
`VBox( `VSpacing(1),
`ReplacePoint( `id(`heading), `Empty() ),
`HBox(
@@ -1197,16 +1195,32 @@
),
`HSpacing(3.0)
),
-
+ `ReplacePoint(`id(`select), `Empty()),
+ `VSpacing(1),
+ `Left(`CheckBox(`id(`format_sys), _("Format system
volumes"), true)),
`VSpacing(1),
// popup text
`Heading(_("Would you like to use these mount points
for your new installation?")),
`VSpacing(1),
- `ReplacePoint( `id(`bbox), `Empty() )
- ))
+ `ButtonBox(
+ `PushButton(`id(`help), `opt(`helpButton),
Label::HelpButton()),
+ `PushButton(`id(`ok), `opt(`default),
Label::YesButton()),
+ `PushButton(`id(`cancel), Label::NoButton())
+ )
+ )
);

+ UI::ChangeWidget(`help, `HelpText, help_text);
+
+ if (size(table_input) > 1)
+ {
+ UI::ReplaceWidget(`id(`select), `HBox(
+ `PushButton(`id(`show_prev), _("Show &Previous")),
+ `PushButton(`id(`show_next), _("Show &Next"))
+ ));
+ }
+
symbol userinput = `none;
integer idx = 0;
repeat
@@ -1217,50 +1231,41 @@
/etc/fstab found on %1"), table_input[idx,"root"]:"/dev/emil" );
UI::ReplaceWidget( `id(`heading), `Heading( tmp ) );

- UI::ChangeWidget( `id(`table), `Items, table_input[idx,"tbl"]:[] );
+ UI::ChangeWidget(`id(`table), `Items, table_input[idx, "tbl"]:[]);
+ UI::ChangeWidget(`id(`table), `CurrentItem, nil);

- term bbox = `HBox( `PushButton( `id(`ok), `opt(`default),
- Label::YesButton() ),
- `PushButton(`id(`cancel), Label::NoButton())
- );
- if( size(table_input)>0 )
- {
- bbox = add( bbox, `HSpacing(5) );
- if( idx>0 )
- {
- bbox = add( bbox,
- `PushButton( `id(`show_p), _("Show &Previous") ));
- }
- if( idx<size(table_input)-1 )
- {
- bbox = add( bbox,
- `PushButton( `id(`show_n), _("Show &Next") ));
- }
- }
- y2milestone( "userinput UI::ReplaceWidget" );
- UI::ReplaceWidget( `id(`bbox), bbox );
- y2milestone( "after UI::ReplaceWidget" );
+ if (size(table_input) > 1)
+ {
+ UI::ChangeWidget(`id(`show_prev), `Enabled, idx > 0);
+ UI::ChangeWidget(`id(`show_next), `Enabled, idx < size(table_input)
- 1);
+ }

- userinput = (symbol)UI::UserInput();
- y2milestone( "userinput %1", userinput );
+ userinput = (symbol) UI::UserInput();
+ y2milestone("userinput %1", userinput);

- if( userinput == `show_n )
- {
- idx = idx+1;
- }
- else if( userinput == `show_p )
- {
- idx = idx-1;
- }
+ switch (userinput)
+ {
+ case `show_next:
+ idx = idx + 1;
+ break;
+
+ case `show_prev:
+ idx = idx - 1;
+ break;
+ }
y2milestone( "idx %1", idx );
}
until( userinput == `ok || userinput == `cancel );
+
+ format_sys = (boolean) UI::QueryWidget(`id(`format_sys), `Value);
+
UI::CloseDialog();

integer ret = userinput == `ok ? idx : -1;
y2milestone( "ret %1", ret );
return ret;
- };
+ }
+

//FIXME: y2-repair uses this, need to find
//a better place for it

Modified: trunk/storage/storage/src/include/custom_part_lib.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_lib.ycp?rev=61711&r1=61710&r2=61711&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_lib.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_lib.ycp Thu Apr 15 12:32:38
2010
@@ -93,7 +93,7 @@
/////////////////////////////////////////////////////////////////
// foreach partition on each target
list<list> fstab = [];
- list skip_fs = [ `unknown, `swap, `vfat, `ntfs ];
+ list<symbol> skip_fs = [ `unknown, `swap, `vfat, `ntfs ];

foreach( string dev, map disk, targetMap,
``{
@@ -908,7 +908,7 @@
* @return return ( [ targetMap, table_input ]
*
*/
-list AddFstabToData(map<string, map> targetMap, list<map> fstab)
+list AddFstabToData(map<string, map> targetMap, list<map> fstab, boolean
format_sys)
{
if( fstab == nil )
return [ targetMap ];
@@ -935,6 +935,8 @@
!Storage::IsInstallationSource(partition["device"]:""))
{
new_partition["mount"] = mount_fstab;
+ if (format_sys && FileSystems::IsSystemMp(mount_fstab,
false))
+ new_partition["format"] = true;
if( !isempty(fstab_entry["fstopt"]:"") &&
fstab_entry["fstopt"]:"" != "default" )
{

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=61711&r1=61710&r2=61711&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-lib.ycp Thu Apr 15 12:32:38 2010
@@ -279,14 +279,15 @@
map<string, map> target_map = Storage::GetOndiskTarget();
list<list> fstab = scanAndReadExistingFstab(target_map);
y2milestone( "adapt_mp fstab %1", fstab );
- list ti = maplist( list e, fstab, ``(AddFstabToData( target_map,
(list<map>)e)[1]:$[]));
+ list ti = maplist(list e, fstab, ``(AddFstabToData(target_map,
(list<map>) e, false)[1]:$[]));
y2milestone( "adapt_mp ti %1", ti );

- integer idx = FstabAddDialog( ti );
+ boolean format_sys = true;
+ integer idx = FstabAddDialog(ti, format_sys);
if( idx>=0 )
{
y2milestone( "adapt_mp use fstab idx %1", idx );
- ti = AddFstabToData( target_map, (list<map>)fstab[idx]:[] );
+ ti = AddFstabToData(target_map, (list<map>) fstab[idx]:[],
format_sys);
foreach( string d, map disk, ti[0]:$[],
``{
foreach( map p, disk["partitions"]:[],

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages