Author: kmachalkova
Date: Tue Jul 15 19:16:32 2008
New Revision: 49133
URL: http://svn.opensuse.org/viewcvs/yast?rev=49133&view=rev
Log:
Handle reading sysconfig
+ do not define MSB items statically, it is hard
to preselect some then
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp?rev=49133&r1=49132&r2=49133&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp Tue Jul 15 19:16:32 2008
@@ -7,9 +7,33 @@
{
textdomain "storage";
+ import "Map";
void CreateSettingsPanel(any user_data)
{
+ map visible_fields = $[
+ `cyl : _("Cylinder information"),
+ `mount_by : _("Mount by"),
+ `used_by : _("Used by"),
+ `uuid : _("UUID"),
+ `label : _("Label"),
+ `bios_id : _("BIOS ID"),
+ ];
+
+ void PreselectVisibleFields() {
+ list <symbol> hidden_fields = StorageSettings::GetHiddenFields();
+
+ list <term> msb_items = maplist ( symbol s, ( list <symbol> ) Map::Keys( visible_fields ), {
+ if( contains (hidden_fields, s))
+ return toterm( `item, [ `id(s), visible_fields[s]:"", false ]);
+ else
+ return toterm( `item, [ `id(s), visible_fields[s]:"", true ]);
+ } );
+ UI::ChangeWidget(`id(`visible_fields), `Items, msb_items);
+
+ }
+
+
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
`VBox(
@@ -39,21 +63,16 @@
//This looks extremely ugly, but obviously there are few other means how
//to make MultiSelection widget smaller, yet still readable
`Left( `HBox (
- `MultiSelectionBox(`id(`visible_fields), `opt(`shrinkable),
- _("Visible Information On Storage Devices" ),
- [ `item(`id(`cyl), _("Cylinder information")),
- `item(`id(`mount_by), _("Mount by")),
- `item(`id(`used_by), _("Used by")),
- `item(`id(`uuid), _("UUID")),
- `item(`id(`label), _("Label")),
- `item(`id(`bios_id), _("BIOS ID")) ] ),
- `HStretch()
+ `MultiSelectionBox(`id(`visible_fields), `opt(`shrinkable),
+ _("Visible Information On Storage Devices")),
+ `HStretch()
)
),
`VStretch()
)));
Wizard::RestoreHelp("TODO");
+ PreselectVisibleFields();
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org